From 7a9984f392a24575d58a11d0df3ffbae895b6aa7 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 26 Feb 2025 18:09:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B7=B2=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=8A=A8=E4=BD=9C=E6=95=B0=E8=AE=A1=E7=AE=97=E5=92=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A5=E4=BD=9C=E6=B5=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/WorkflowTaskCard.vue | 83 +++++++++++++---------- src/views/workflow/WorkflowListView.vue | 10 ++- 2 files changed, 55 insertions(+), 38 deletions(-) diff --git a/src/components/cards/WorkflowTaskCard.vue b/src/components/cards/WorkflowTaskCard.vue index 534208ef..876bf32d 100644 --- a/src/components/cards/WorkflowTaskCard.vue +++ b/src/components/cards/WorkflowTaskCard.vue @@ -33,6 +33,11 @@ function handleEdit(item: Workflow) { editDialog.value = true } +// 计算已完成的动作数 +function resolveDoneActions(item: Workflow) { + return item.current_action?.split(',').length || 0 +} + // 编辑完成 function editDone() { editDialog.value = false @@ -117,8 +122,8 @@ const resolveStatusVariant = (status: string | undefined) => { if (status === 'S') return { color: 'success', text: '成功' } else if (status === 'R') return { color: 'primary', text: '运行中' } else if (status === 'F') return { color: 'error', text: '失败' } - else if (status === 'P') return { color: 'warning', text: '暂停' } - else return { color: 'secondary', text: '等待' } + else if (status === 'P') return { color: 'secondary', text: '暂停' } + else return { color: 'info', text: '等待' } } // 计算当前动作占比 @@ -129,39 +134,35 @@ const resolveProgress = (item: Workflow) => {