yuan
2 天以前 eca77cbce809165ea09fed36b12152c3acaa3db0
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;