From f13419e6ed413bc2e7640a9d3988c541cd2a2a6f Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 23 六月 2026 09:21:42 +0800
Subject: [PATCH] chore: 绿美节能打包配置文件
---
src/views/reportAnalysis/productionAnalysis/components/center-top.vue | 39 ++++++++++++++++++++++++++++++++++-----
1 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/src/views/reportAnalysis/productionAnalysis/components/center-top.vue b/src/views/reportAnalysis/productionAnalysis/components/center-top.vue
index 0937b32..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 { salesPurchaseStorageProductCount } from '@/api/viewIndex.js'
+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
@@ -37,7 +51,7 @@
const compareClass = (val) => (val >= 0 ? 'compare-up' : 'compare-down')
const fetchData = () => {
- salesPurchaseStorageProductCount()
+ orderCount()
.then((res) => {
if (res.code === 200 && Array.isArray(res.data)) {
statItems.value = res.data.map((item) => ({
@@ -48,8 +62,15 @@
}
})
.catch((err) => {
- console.error('鑾峰彇閿�鍞�/閲囪喘/鍌ㄥ瓨浜у搧鏁板け璐�:', err)
+ console.error('鑾峰彇璁㈠崟鏁伴噺缁熻澶辫触:', err)
})
+}
+
+const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
+if (dataDashboardRefreshTick) {
+ watch(dataDashboardRefreshTick, () => {
+ fetchData()
+ })
}
onMounted(() => {
@@ -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