From 1c829f9177eab675b22be4d20ef2761ed1bbb423 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 15 九月 2026 16:15:48 +0800
Subject: [PATCH] refactor(layout): 调整布局样式并优化轮播卡片组件
---
src/views/reportAnalysis/qualityAnalysis/components/center-top.vue | 80 ++++++++++++++++++++++++++++++----------
1 files changed, 60 insertions(+), 20 deletions(-)
diff --git a/src/views/reportAnalysis/qualityAnalysis/components/center-top.vue b/src/views/reportAnalysis/qualityAnalysis/components/center-top.vue
index 8e46770..e110871 100644
--- a/src/views/reportAnalysis/qualityAnalysis/components/center-top.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/components/center-top.vue
@@ -2,8 +2,25 @@
<div>
<!-- 椤堕儴缁熻鍗$墖 -->
<div class="stats-cards">
- <div v-for="item in statItems" :key="item.name" class="stat-card">
- <img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
+ <div v-for="(item, index) in statItems" :key="item.name" class="stat-card">
+ <div class="card-icon" :style="{ color: ICON_COLORS[index % ICON_COLORS.length] }">
+ <!-- 妫�楠屽崟 -->
+ <svg v-if="index % 3 === 0" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
+ <rect x="5" y="4" width="14" height="17" rx="2" />
+ <path d="M9 2.5h6v3H9z" />
+ <path d="M9 13l2 2 4-4" />
+ </svg>
+ <!-- 寰呭畬鎴愶細鏃堕挓 -->
+ <svg v-else-if="index % 3 === 1" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
+ <circle cx="12" cy="12" r="9" />
+ <path d="M12 7v5l3.5 2" />
+ </svg>
+ <!-- 宸插畬鎴愶細瀵瑰嬀鍦嗙幆 -->
+ <svg v-else width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
+ <circle cx="12" cy="12" r="9" />
+ <path d="M8.5 12.5l2.5 2.5 5-5.5" />
+ </svg>
+ </div>
<div class="card-content">
<span class="card-label">{{ item.name }}</span>
<span class="card-value">{{ item.value }}</span>
@@ -22,8 +39,12 @@
<script setup>
import { ref, onMounted } from 'vue'
import { qualityInspectionCount } from '@/api/viewIndex.js'
+import { BI } from '../theme.js'
const statItems = ref([])
+
+// 鍗$墖鍥炬爣鐐圭紑鑹诧紙妫�楠�/寰呭畬鎴�/宸插畬鎴愶級
+const ICON_COLORS = [BI.accentBright, BI.series[3], BI.up]
const formatPercent = (val) => {
const num = Number(val) || 0
@@ -77,38 +98,56 @@
flex: 1;
display: flex;
align-items: center;
- background-image: url('@/assets/BI/border@2x.png');
- background-size: 100% 100%;
- background-position: center;
- background-repeat: no-repeat;
+ background: var(--bi-panel-bg);
+ border: 1px solid var(--bi-panel-border);
+ border-radius: 8px;
+ position: relative;
+ overflow: hidden;
height: 142px;
}
+/* 椤堕儴鍝佺墝钃濅寒绾匡紝鏇夸唬鍥剧墖鎻忚竟 */
+.stat-card::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 2px;
+ background: linear-gradient(90deg, var(--bi-accent) 0%, transparent 70%);
+}
+
.card-icon {
- width: 100px;
- height: 100px;
- margin: 20px 20px 0 10px;
+ width: 52px;
+ height: 52px;
+ margin: 0 16px 0 20px;
+ border-radius: 8px;
+ background: rgba(74, 108, 240, 0.12);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
}
.card-content {
display: flex;
flex-direction: column;
- gap: 10px;
+ gap: 8px;
+ min-width: 0;
}
.card-value {
- font-weight: 500;
- font-size: 40px;
- background: linear-gradient(360deg, #008bfd 0%, #ffffff 100%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- background-clip: text;
+ font-weight: 600;
+ font-size: 36px;
+ color: var(--bi-text-strong);
+ font-variant-numeric: tabular-nums;
+ line-height: 1.1;
}
.card-label {
font-weight: 400;
font-size: 16px;
- color: rgba(208, 231, 255, 0.7);
+ color: var(--bi-text);
}
.card-compare {
@@ -116,7 +155,7 @@
align-items: center;
gap: 6px;
font-size: 15px;
- color: #d0e7ff;
+ color: var(--bi-text);
white-space: nowrap;
flex-wrap: nowrap;
}
@@ -128,6 +167,7 @@
.compare-value {
font-weight: 600;
+ font-variant-numeric: tabular-nums;
}
.compare-icon {
@@ -139,11 +179,11 @@
.compare-up .compare-value,
.compare-up .compare-icon {
- color: #00c853;
+ color: var(--bi-up);
}
.compare-down .compare-value,
.compare-down .compare-icon {
- color: #ff5252;
+ color: var(--bi-down);
}
</style>
--
Gitblit v1.9.3