From 0dd842c178324e7aac7329418d2eb8606dbce64b Mon Sep 17 00:00:00 2001 From: dhb52 Date: Fri, 8 Nov 2024 20:30:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(1.2.0-beta3):=20=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=89=B9=E6=AC=A1=E7=95=8C=E9=9D=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BB=BB=E5=8A=A1=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/job-task-list-table.vue | 13 +++++++++++++ src/typings/api.d.ts | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/common/job-task-list-table.vue b/src/components/common/job-task-list-table.vue index a52753b..1a66ea6 100644 --- a/src/components/common/job-task-list-table.vue +++ b/src/components/common/job-task-list-table.vue @@ -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; + } } ] }); diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 8c5c14e..29f6ec7 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -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 = {