From d5979e6bf30754671a70f8cdd36edb807007751c Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 27 Feb 2025 20:39:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=8A=B6=E6=80=81=E5=92=8C=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/WorkflowTaskCard.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/cards/WorkflowTaskCard.vue b/src/components/cards/WorkflowTaskCard.vue index 5aa62c00..cf7b87f7 100644 --- a/src/components/cards/WorkflowTaskCard.vue +++ b/src/components/cards/WorkflowTaskCard.vue @@ -120,6 +120,7 @@ async function handleRun(item: Workflow) { emit('refresh') } else { $toast.error(`任务执行失败:${result.message}`) + emit('refresh') } } catch (error) { console.error(error) @@ -138,13 +139,13 @@ const resolveStatusVariant = (status: string | undefined) => { // 计算当前动作占比 const resolveProgress = (item: Workflow) => { - const current_action_index = item.actions?.findIndex(action => action.id === item.current_action) ?? 0 - return item.actions?.length ? Math.round((current_action_index / item.actions.length) * 100) : 0 + const current_action_length = item.current_action?.split(',').length || 0 + return item.actions?.length ? Math.round((current_action_length / (item.actions.length || 1)) * 100) : 0 }