feat(1.2.0-beta3): 任务执行批次界面增加任务结束时间

This commit is contained in:
dhb52 2024-11-08 20:30:50 +08:00
parent fabd74eee4
commit 0dd842c178
2 changed files with 17 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import { NButton, NCode, NTag } from 'naive-ui';
import hljs from 'highlight.js/lib/core';
import json from 'highlight.js/lib/languages/json';
import { ref, render } from 'vue';
import dayjs from 'dayjs';
import { taskStatusRecord, taskStatusRecordOptions } from '@/constants/business';
import { $t } from '@/locales';
import { isNotNull, parseArgsJson, translateOptions } from '@/utils/common';
@ -251,6 +252,18 @@ const { columns, searchParams, columnChecks, data, getData, loading, mobilePagin
title: $t('page.jobBatch.jobTask.createDt'),
align: 'left',
minWidth: 130
},
{
key: 'duration',
title: $t('page.jobBatch.duration'),
align: 'center',
width: 120,
render: row => {
if (row.taskStatus === 3) {
return Math.round(dayjs(row.updateDt).diff(dayjs(row.createDt)) / 1000);
}
return null;
}
}
]
});

View File

@ -125,7 +125,7 @@ declare namespace Api {
interface LoginToken {
id: string;
mode: string;
role: String;
role: string;
token: string;
refreshToken: string;
createDt: string;
@ -934,7 +934,7 @@ declare namespace Api {
>;
type ExportWorkflow = Common.CommonRecord<{
workflowIds: String[];
workflowIds: string[];
}> &
WorkflowSearchParams;
@ -1072,6 +1072,8 @@ declare namespace Api {
children: JobTaskTree[];
/** 是否存在下级 */
isLeaf: boolean;
/** 执行时长(virtual) */
duration?: number;
}>;
type JobTaskTree = {