feat(1.5.0-beta1): 修复工作流列表显示问题

This commit is contained in:
opensnail 2025-04-26 18:32:20 +08:00
parent 4935995b4f
commit 004d6543ee

View File

@ -11,7 +11,7 @@ import { $t } from '@/locales';
import { useAppStore } from '@/store/modules/app'; import { useAppStore } from '@/store/modules/app';
import { useTable, useTableOperate } from '@/hooks/common/table'; import { useTable, useTableOperate } from '@/hooks/common/table';
import { operationReasonRecord, taskBatchStatusRecord } from '@/constants/business'; import { operationReasonRecord, taskBatchStatusRecord } from '@/constants/business';
import { monthRangeISO8601 } from '@/utils/common'; import { monthRangeISO8601, tagColor } from '@/utils/common';
import WorkflowBatchSearch from './modules/workflow-batch-search.vue'; import WorkflowBatchSearch from './modules/workflow-batch-search.vue';
const router = useRouter(); const router = useRouter();
@ -63,25 +63,25 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
{ {
key: 'workflowName', key: 'workflowName',
title: $t('page.workflowBatch.workflowName'), title: $t('page.workflowBatch.workflowName'),
align: 'left', align: 'center',
minWidth: 120 minWidth: 120
}, },
{ {
key: 'groupName', key: 'groupName',
title: $t('page.workflowBatch.groupName'), title: $t('page.workflowBatch.groupName'),
align: 'left', align: 'center',
minWidth: 120 minWidth: 120
}, },
{ {
key: 'executionAt', key: 'executionAt',
title: $t('page.workflowBatch.executionAt'), title: $t('page.workflowBatch.executionAt'),
align: 'left', align: 'center',
minWidth: 120 minWidth: 120
}, },
{ {
key: 'taskBatchStatus', key: 'taskBatchStatus',
title: $t('page.workflowBatch.taskBatchStatus'), title: $t('page.workflowBatch.taskBatchStatus'),
align: 'left', align: 'center',
minWidth: 120, minWidth: 120,
render: row => { render: row => {
if (!row.taskBatchStatus) { if (!row.taskBatchStatus) {
@ -90,11 +90,11 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
const tagMap: Record<number, NaiveUI.ThemeColor> = { const tagMap: Record<number, NaiveUI.ThemeColor> = {
1: 'info', 1: 'info',
2: 'success', 2: 'info',
3: 'success', 3: 'info',
4: 'error', 4: 'error',
5: 'warning', 5: 'error',
6: 'warning' 6: 'error'
}; };
const label = $t(taskBatchStatusRecord[row.taskBatchStatus!]); const label = $t(taskBatchStatusRecord[row.taskBatchStatus!]);
@ -104,21 +104,21 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
{ {
key: 'operationReason', key: 'operationReason',
title: $t('page.workflowBatch.operationReason'), title: $t('page.workflowBatch.operationReason'),
align: 'left', align: 'center',
minWidth: 120, minWidth: 120,
render: row => { render: row => {
if (!row.operationReason) { if (row.operationReason === null) {
return null; return null;
} }
const label = $t(operationReasonRecord[row.operationReason!]); const label = $t(operationReasonRecord[row.operationReason!]);
return <NTag type="warning">{label}</NTag>; return <NTag type={tagColor(row.operationReason!)}>{label}</NTag>;
} }
}, },
{ {
key: 'createDt', key: 'createDt',
title: $t('page.workflowBatch.createDt'), title: $t('page.workflowBatch.createDt'),
align: 'left', align: 'center',
minWidth: 120 minWidth: 120
}, },
{ {