|
|
|
@ -21,7 +21,7 @@ import { useI18n } from 'vue-i18n'
|
|
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
|
import ButtonLink from '@/components/button-link' |
|
|
|
|
import { RowKey } from 'naive-ui/lib/data-table/src/interface' |
|
|
|
|
import {NEllipsis, NIcon, NSpin, NTooltip} from 'naive-ui' |
|
|
|
|
import { NEllipsis, NIcon, NSpin, NTooltip } from 'naive-ui' |
|
|
|
|
import { |
|
|
|
|
queryProcessInstanceListPaging, |
|
|
|
|
deleteProcessInstanceById, |
|
|
|
@ -31,7 +31,8 @@ import { execute } from '@/service/modules/executors'
|
|
|
|
|
import TableAction from './components/table-action' |
|
|
|
|
import { |
|
|
|
|
renderTableTime, |
|
|
|
|
runningType, workflowExecutionState |
|
|
|
|
runningType, |
|
|
|
|
workflowExecutionState |
|
|
|
|
} from '@/common/common' |
|
|
|
|
import { |
|
|
|
|
COLUMN_WIDTH_CONFIG, |
|
|
|
@ -42,8 +43,8 @@ import type { Router } from 'vue-router'
|
|
|
|
|
import type { IWorkflowInstance } from '@/service/modules/process-instances/types' |
|
|
|
|
import type { ICountDownParam } from './types' |
|
|
|
|
import type { ExecuteReq } from '@/service/modules/executors/types' |
|
|
|
|
import {renderEnvironmentalDistinctionCell} from "@/utils/environmental-distinction"; |
|
|
|
|
import { IWorkflowExecutionState } from "@/common/types"; |
|
|
|
|
import { renderEnvironmentalDistinctionCell } from '@/utils/environmental-distinction' |
|
|
|
|
import { IWorkflowExecutionState } from '@/common/types' |
|
|
|
|
|
|
|
|
|
export function useTable() { |
|
|
|
|
const { t } = useI18n() |
|
|
|
@ -64,6 +65,9 @@ export function useTable() {
|
|
|
|
|
startDate: ref(), |
|
|
|
|
endDate: ref(), |
|
|
|
|
projectCode: ref(Number(router.currentRoute.value.params.projectCode)), |
|
|
|
|
processDefineCode: router.currentRoute.value.query.processDefineCode |
|
|
|
|
? ref(Number(router.currentRoute.value.query.processDefineCode)) |
|
|
|
|
: ref(), |
|
|
|
|
loadingRef: ref(false) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -104,13 +108,13 @@ export function useTable() {
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
default: () => |
|
|
|
|
h( |
|
|
|
|
NEllipsis, |
|
|
|
|
{ |
|
|
|
|
style: 'max-width: 580px;line-height: 1.5' |
|
|
|
|
}, |
|
|
|
|
() => row.name |
|
|
|
|
) |
|
|
|
|
h( |
|
|
|
|
NEllipsis, |
|
|
|
|
{ |
|
|
|
|
style: 'max-width: 580px;line-height: 1.5' |
|
|
|
|
}, |
|
|
|
|
() => row.name |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
}, |
|
|
|
@ -119,7 +123,8 @@ export function useTable() {
|
|
|
|
|
key: 'state', |
|
|
|
|
...COLUMN_WIDTH_CONFIG['state'], |
|
|
|
|
className: 'workflow-status', |
|
|
|
|
render: (_row: IWorkflowInstance) => renderWorkflowStateCell(_row.state, t) |
|
|
|
|
render: (_row: IWorkflowInstance) => |
|
|
|
|
renderWorkflowStateCell(_row.state, t) |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: t('project.workflow.operating_environment'), |
|
|
|
@ -262,7 +267,8 @@ export function useTable() {
|
|
|
|
|
host: variables.host, |
|
|
|
|
stateType: variables.stateType, |
|
|
|
|
startDate: variables.startDate, |
|
|
|
|
endDate: variables.endDate |
|
|
|
|
endDate: variables.endDate, |
|
|
|
|
processDefineCode: variables.processDefineCode |
|
|
|
|
} |
|
|
|
|
queryProcessInstanceListPaging({ ...params }, variables.projectCode).then( |
|
|
|
|
(res: any) => { |
|
|
|
@ -362,22 +368,25 @@ export function useTable() {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export function renderWorkflowStateCell(state: IWorkflowExecutionState, t: Function) { |
|
|
|
|
export function renderWorkflowStateCell( |
|
|
|
|
state: IWorkflowExecutionState, |
|
|
|
|
t: Function |
|
|
|
|
) { |
|
|
|
|
if (!state) return '' |
|
|
|
|
|
|
|
|
|
const stateOption = workflowExecutionState(t)[state] |
|
|
|
|
|
|
|
|
|
const Icon = h( |
|
|
|
|
NIcon, |
|
|
|
|
{ |
|
|
|
|
color: stateOption.color, |
|
|
|
|
class: stateOption.classNames, |
|
|
|
|
style: { |
|
|
|
|
display: 'flex' |
|
|
|
|
}, |
|
|
|
|
size: 20 |
|
|
|
|
NIcon, |
|
|
|
|
{ |
|
|
|
|
color: stateOption.color, |
|
|
|
|
class: stateOption.classNames, |
|
|
|
|
style: { |
|
|
|
|
display: 'flex' |
|
|
|
|
}, |
|
|
|
|
() => h(stateOption.icon) |
|
|
|
|
size: 20 |
|
|
|
|
}, |
|
|
|
|
() => h(stateOption.icon) |
|
|
|
|
) |
|
|
|
|
return h(NTooltip, null, { |
|
|
|
|
trigger: () => { |
|
|
|
|