[Fix-13144][UI] Worked out the issue with failing to query workflow instances by the incorrect workflow status.
#13243
This commit is contained in:
parent
32a76ee419
commit
fbbfbda9ed
|
|
@ -36,8 +36,8 @@ import {
|
||||||
} from '@vicons/antd'
|
} from '@vicons/antd'
|
||||||
import { format, parseISO } from 'date-fns'
|
import { format, parseISO } from 'date-fns'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { ITaskStateConfig } from './types'
|
|
||||||
|
|
||||||
|
import { ITaskStateConfig, IWorkflowExecutionStateConfig } from './types'
|
||||||
/**
|
/**
|
||||||
* Intelligent display kb m
|
* Intelligent display kb m
|
||||||
*/
|
*/
|
||||||
|
|
@ -139,6 +139,21 @@ export const stateType = (t: any) => [
|
||||||
}))
|
}))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* State code table
|
||||||
|
*/
|
||||||
|
export const workflowExecutionStateType = (t: any) => [
|
||||||
|
{
|
||||||
|
value: '',
|
||||||
|
label: `${t('project.workflow.all_status')}`
|
||||||
|
},
|
||||||
|
...Object.entries(workflowExecutionState(t)).map(([key, item]) => ({
|
||||||
|
value: key,
|
||||||
|
label: item.desc
|
||||||
|
}))
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream task state
|
* Stream task state
|
||||||
*/
|
*/
|
||||||
|
|
@ -314,6 +329,113 @@ export const tasksState = (t: any): ITaskStateConfig => ({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Workflow execution status
|
||||||
|
* @id id
|
||||||
|
* @desc tooltip
|
||||||
|
* @color color
|
||||||
|
* @icon icon
|
||||||
|
* @isSpin is loading (Need to execute the code block to write if judgment)
|
||||||
|
*/
|
||||||
|
export const workflowExecutionState = (t: any): IWorkflowExecutionStateConfig => ({
|
||||||
|
SUBMITTED_SUCCESS: {
|
||||||
|
id: 0,
|
||||||
|
desc: `${t('project.workflow.submit_success')}`,
|
||||||
|
color: '#A9A9A9',
|
||||||
|
icon: IssuesCloseOutlined,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'submitted_success'
|
||||||
|
},
|
||||||
|
RUNNING_EXECUTION: {
|
||||||
|
id: 1,
|
||||||
|
desc: `${t('project.workflow.executing')}`,
|
||||||
|
color: '#0097e0',
|
||||||
|
icon: SettingFilled,
|
||||||
|
isSpin: true,
|
||||||
|
classNames: 'running_execution'
|
||||||
|
},
|
||||||
|
READY_PAUSE: {
|
||||||
|
id: 2,
|
||||||
|
desc: `${t('project.workflow.ready_to_pause')}`,
|
||||||
|
color: '#07b1a3',
|
||||||
|
icon: SettingOutlined,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'ready_pause'
|
||||||
|
},
|
||||||
|
PAUSE: {
|
||||||
|
id: 3,
|
||||||
|
desc: `${t('project.workflow.pause')}`,
|
||||||
|
color: '#057c72',
|
||||||
|
icon: PauseCircleOutlined,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'pause'
|
||||||
|
},
|
||||||
|
READY_STOP: {
|
||||||
|
id: 4,
|
||||||
|
desc: `${t('project.workflow.ready_to_stop')}`,
|
||||||
|
color: '#FE0402',
|
||||||
|
icon: StopFilled,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'ready_stop'
|
||||||
|
},
|
||||||
|
STOP: {
|
||||||
|
id: 5,
|
||||||
|
desc: `${t('project.workflow.stop')}`,
|
||||||
|
color: '#e90101',
|
||||||
|
icon: StopOutlined,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'stop'
|
||||||
|
},
|
||||||
|
FAILURE: {
|
||||||
|
id: 6,
|
||||||
|
desc: `${t('project.workflow.failed')}`,
|
||||||
|
color: '#000000',
|
||||||
|
icon: CloseCircleOutlined,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'failed'
|
||||||
|
},
|
||||||
|
SUCCESS: {
|
||||||
|
id: 7,
|
||||||
|
desc: `${t('project.workflow.success')}`,
|
||||||
|
color: '#95DF96',
|
||||||
|
icon: CheckCircleOutlined,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'success'
|
||||||
|
},
|
||||||
|
DELAY_EXECUTION: {
|
||||||
|
id: 12,
|
||||||
|
desc: `${t('project.workflow.delay_execution')}`,
|
||||||
|
color: '#5102ce',
|
||||||
|
icon: PauseCircleFilled,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'delay_execution'
|
||||||
|
},
|
||||||
|
SERIAL_WAIT: {
|
||||||
|
id: 14,
|
||||||
|
desc: `${t('project.workflow.serial_wait')}`,
|
||||||
|
color: '#5102ce',
|
||||||
|
icon: Loading3QuartersOutlined,
|
||||||
|
isSpin: true,
|
||||||
|
classNames: 'serial_wait'
|
||||||
|
},
|
||||||
|
READY_BLOCK: {
|
||||||
|
id: 15,
|
||||||
|
desc: `${t('project.workflow.ready_to_block')}`,
|
||||||
|
color: '#5101be',
|
||||||
|
icon: SendOutlined,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'pending'
|
||||||
|
},
|
||||||
|
BLOCK: {
|
||||||
|
id: 16,
|
||||||
|
desc: `${t('project.workflow.block')}`,
|
||||||
|
color: '#5101be',
|
||||||
|
icon: HistoryOutlined,
|
||||||
|
isSpin: false,
|
||||||
|
classNames: 'pending'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple uuid generator, support prefix and template pattern.
|
* A simple uuid generator, support prefix and template pattern.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,20 @@ export type ITaskState =
|
||||||
| 'DISPATCH'
|
| 'DISPATCH'
|
||||||
| 'PENDING'
|
| 'PENDING'
|
||||||
|
|
||||||
|
export type IWorkflowExecutionState =
|
||||||
|
| 'SUBMITTED_SUCCESS'
|
||||||
|
| 'RUNNING_EXECUTION'
|
||||||
|
| 'READY_PAUSE'
|
||||||
|
| 'PAUSE'
|
||||||
|
| 'READY_STOP'
|
||||||
|
| 'STOP'
|
||||||
|
| 'FAILURE'
|
||||||
|
| 'SUCCESS'
|
||||||
|
| 'DELAY_EXECUTION'
|
||||||
|
| 'SERIAL_WAIT'
|
||||||
|
| 'READY_BLOCK'
|
||||||
|
| 'BLOCK'
|
||||||
|
|
||||||
export type ITaskStateConfig = {
|
export type ITaskStateConfig = {
|
||||||
[key in ITaskState]: {
|
[key in ITaskState]: {
|
||||||
id: number
|
id: number
|
||||||
|
|
@ -45,3 +59,14 @@ export type ITaskStateConfig = {
|
||||||
classNames?: string
|
classNames?: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type IWorkflowExecutionStateConfig = {
|
||||||
|
[key in IWorkflowExecutionState]: {
|
||||||
|
id: number
|
||||||
|
desc: string
|
||||||
|
color: string
|
||||||
|
icon: Component
|
||||||
|
isSpin: boolean
|
||||||
|
classNames?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,9 @@ export default {
|
||||||
workflow_relation_no_data_result_title:
|
workflow_relation_no_data_result_title:
|
||||||
'Can not find any relations of workflows.',
|
'Can not find any relations of workflows.',
|
||||||
workflow_relation_no_data_result_desc:
|
workflow_relation_no_data_result_desc:
|
||||||
'There is not any workflows. Please create a workflow, and then visit this page again.'
|
'There is not any workflows. Please create a workflow, and then visit this page again.',
|
||||||
|
ready_to_block: 'Ready to block',
|
||||||
|
block: 'Block',
|
||||||
},
|
},
|
||||||
task: {
|
task: {
|
||||||
cancel_full_screen: 'Cancel full screen',
|
cancel_full_screen: 'Cancel full screen',
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,9 @@ export default {
|
||||||
project_tips: '请选择项目',
|
project_tips: '请选择项目',
|
||||||
workflow_relation_no_data_result_title: '工作流关系不存在',
|
workflow_relation_no_data_result_title: '工作流关系不存在',
|
||||||
workflow_relation_no_data_result_desc:
|
workflow_relation_no_data_result_desc:
|
||||||
'目前没有任何工作流,请先创建工作流,再访问该页面'
|
'目前没有任何工作流,请先创建工作流,再访问该页面',
|
||||||
|
ready_to_block: '准备锁定',
|
||||||
|
block: '锁定',
|
||||||
},
|
},
|
||||||
task: {
|
task: {
|
||||||
cancel_full_screen: '取消全屏',
|
cancel_full_screen: '取消全屏',
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import { NInput, NButton, NDatePicker, NSelect, NIcon, NSpace } from 'naive-ui'
|
||||||
import { defineComponent, getCurrentInstance, ref } from 'vue'
|
import { defineComponent, getCurrentInstance, ref } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
import { stateType } from '@/common/common'
|
import { workflowExecutionStateType } from '@/common/common'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ProcessInstanceCondition',
|
name: 'ProcessInstanceCondition',
|
||||||
|
|
@ -88,7 +88,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const options = stateType(t)
|
const options = workflowExecutionStateType(t)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NSpace justify='end'>
|
<NSpace justify='end'>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue