From bbd9ef7b994f6d8be9392429a538be50e0d977ed Mon Sep 17 00:00:00 2001 From: chenjiale Date: Mon, 1 Dec 2025 20:59:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=A0=B7=E5=BC=8F=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=92=8C=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=AE=97=E6=B3=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/model/list/ModelCard.vue | 67 ++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/src/views/model/list/ModelCard.vue b/src/views/model/list/ModelCard.vue index 93d0b3d..610079b 100644 --- a/src/views/model/list/ModelCard.vue +++ b/src/views/model/list/ModelCard.vue @@ -39,16 +39,6 @@ const colors = ['#8dc63f', '#dbb09e'] const statusStr = ['未下装', '已下装'] const statusIcons = ['material-symbols:lock-open', 'material-symbols:lock'] -function colorToBg(hex: string, alpha = 0.5) { - const raw = (hex || '').replace('#', '') - if (raw.length !== 6) - return 'rgba(0,0,0,0.5)' - const r = Number.parseInt(raw.slice(0, 2), 16) - const g = Number.parseInt(raw.slice(2, 4), 16) - const b = Number.parseInt(raw.slice(4, 6), 16) - return `rgba(${r}, ${g}, ${b}, ${alpha})` -} - function buildQuery(value: any): ModelQueryParams { return { unitId: value?.unit, @@ -84,7 +74,7 @@ async function loadModelList(value: any) { headStyle: {}, bodyStyle: {}, statusColor: colors[statusIndex], - cardBg: colorToBg(colors[statusIndex]), + algorithm: modelCard.algorithm, } cardList.push(card) } @@ -116,7 +106,7 @@ async function confirmDelete(id: number | string) { :loading="loading" :hoverable="true" class="model-card" - :style="{ backgroundColor: item.cardBg }" + :style="{ borderLeft: `6px solid ${item.statusColor}` }" @click="changeModel(item.id, item.version)" >
@@ -140,8 +130,12 @@ async function confirmDelete(id: number | string) {