From eca77cbce809165ea09fed36b12152c3acaa3db0 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期日, 21 六月 2026 17:15:21 +0800
Subject: [PATCH] feat: 添加进销存数据分析路由跳转

---
 src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue b/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue
index 055fb66..80657c4 100644
--- a/src/views/reportAnalysis/PSIDataAnalysis/components/center-top.vue
+++ b/src/views/reportAnalysis/PSIDataAnalysis/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">
@@ -25,9 +27,21 @@
 
 <script setup>
 import { ref, onMounted, inject, watch } from 'vue'
+import { useRouter } from 'vue-router'
 import { salesPurchaseStorageProductCount } from '@/api/viewIndex.js'
+import { getPsiRoute } from '../psiNavigation.js'
 
+const router = useRouter()
 const statItems = ref([])
+
+const getStatRoute = (name) => getPsiRoute(name)
+
+const handleStatClick = (name) => {
+  const path = getStatRoute(name)
+  if (path) {
+    router.push(path)
+  }
+}
 
 const formatPercent = (val) => {
   const num = Number(val) || 0
@@ -81,6 +95,14 @@
   height: 142px;
 }
 
+.stat-card.clickable {
+  cursor: pointer;
+}
+
+.stat-card.clickable:hover .card-label {
+  color: #43e8fc;
+}
+
 .card-icon {
   width: 100px;
   height: 100px;

--
Gitblit v1.9.3