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) {