From f884518df3c548e38e3c19073e3bddec15882c44 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 23 Jul 2025 11:52:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8D=A1=E7=89=87=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/WorkflowTaskCard.vue | 46 +++++++++++++++++------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/src/components/cards/WorkflowTaskCard.vue b/src/components/cards/WorkflowTaskCard.vue index d4fd8d5e..56278c68 100644 --- a/src/components/cards/WorkflowTaskCard.vue +++ b/src/components/cards/WorkflowTaskCard.vue @@ -165,11 +165,36 @@ async function handleReset(item: Workflow) { // 计算状态颜色 const resolveStatusVariant = (status: string | undefined) => { - if (status === 'S') return { color: 'success', text: t('workflow.task.status.success') } - else if (status === 'R') return { color: 'primary', text: t('workflow.task.status.running') } - else if (status === 'F') return { color: 'error', text: t('workflow.task.status.failed') } - else if (status === 'P') return { color: 'warning', text: t('workflow.task.status.paused') } - else return { color: 'info', text: t('workflow.task.status.waiting') } + if (status === 'S') + return { + color: 'success', + bgColor: 'linear-gradient(to bottom right, rgba(76, 175, 80, 0.9), rgba(76, 175, 80, 0.7))', + text: t('workflow.task.status.success'), + } + else if (status === 'R') + return { + color: 'primary', + bgColor: 'linear-gradient(to bottom right, rgba(33, 150, 243, 0.9), rgba(33, 150, 243, 0.7))', + text: t('workflow.task.status.running'), + } + else if (status === 'F') + return { + color: 'error', + bgColor: 'linear-gradient(to bottom right, rgba(244, 67, 54, 0.9), rgba(244, 67, 54, 0.7))', + text: t('workflow.task.status.failed'), + } + else if (status === 'P') + return { + color: 'warning', + bgColor: 'linear-gradient(to bottom right, rgba(255, 152, 0, 0.9), rgba(255, 152, 0, 0.7))', + text: t('workflow.task.status.paused'), + } + else + return { + color: 'info', + bgColor: 'linear-gradient(to bottom right, rgba(33, 150, 243, 0.9), rgba(33, 150, 243, 0.7))', + text: t('workflow.task.status.waiting'), + } } // 计算当前动作占比 @@ -190,11 +215,9 @@ const resolveProgress = (item: Workflow) => { :class="{ 'transition transform-cpu duration-300 -translate-y-1': hover.isHovering }" > - {{ workflow?.name }} + {{ workflow?.name }} - {{ workflow?.description }}