From 0a251e40e30e7c8a96d71b3b9b6c459d4dfa4b22 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 08 七月 2026 23:04:45 +0800
Subject: [PATCH] 暂存
---
src/views/reportAnalysis/productionAnalysis/components/center-top.vue | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/views/reportAnalysis/productionAnalysis/components/center-top.vue b/src/views/reportAnalysis/productionAnalysis/components/center-top.vue
index ad9e41a..7a3deef 100644
--- a/src/views/reportAnalysis/productionAnalysis/components/center-top.vue
+++ b/src/views/reportAnalysis/productionAnalysis/components/center-top.vue
@@ -6,6 +6,8 @@
v-for="item in statItems"
:key="item.name"
class="stat-card"
+ :class="{ clickable: !!getStatRoute(item.name) }"
+ @click="handleStatClick(item.name)"
>
<img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
<div class="card-content">
@@ -24,10 +26,22 @@
</template>
<script setup>
-import { ref, onMounted } from 'vue'
+import { ref, onMounted, inject, watch } from 'vue'
+import { useRouter } from 'vue-router'
import { orderCount } from '@/api/viewIndex.js'
+import { getProductionRoute } from '../productionNavigation.js'
+const router = useRouter()
const statItems = ref([])
+
+const getStatRoute = (name) => getProductionRoute(name)
+
+const handleStatClick = (name) => {
+ const path = getStatRoute(name)
+ if (path) {
+ router.push(path)
+ }
+}
const formatPercent = (val) => {
const num = Number(val) || 0
@@ -52,6 +66,13 @@
})
}
+const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
+if (dataDashboardRefreshTick) {
+ watch(dataDashboardRefreshTick, () => {
+ fetchData()
+ })
+}
+
onMounted(() => {
fetchData()
})
@@ -72,6 +93,14 @@
background-position: center;
background-repeat: no-repeat;
height: 142px;
+}
+
+.stat-card.clickable {
+ cursor: pointer;
+}
+
+.stat-card.clickable:hover .card-label {
+ color: #43e8fc;
}
.card-icon {
@@ -97,7 +126,7 @@
.card-label {
font-weight: 400;
- font-size: 19px;
+ font-size: 16px;
color: rgba(208, 231, 255, 0.7);
}
--
Gitblit v1.9.3