| | |
| | | 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"> |
| | |
| | | |
| | | <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 |
| | |
| | | height: 142px; |
| | | } |
| | | |
| | | .stat-card.clickable { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .stat-card.clickable:hover .card-label { |
| | | color: #43e8fc; |
| | | } |
| | | |
| | | .card-icon { |
| | | width: 100px; |
| | | height: 100px; |