From b7ffa7395cddfeb10f88d70a81567371f62021c3 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期日, 25 十月 2026 16:30:17 +0800
Subject: [PATCH] feat(router): 排除AI模块页面并添加访问权限控制

---
 src/views/dashboard/analytics/modules/kpi-cards.vue |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/views/dashboard/analytics/modules/kpi-cards.vue b/src/views/dashboard/analytics/modules/kpi-cards.vue
index 761db56..cb5eaf9 100644
--- a/src/views/dashboard/analytics/modules/kpi-cards.vue
+++ b/src/views/dashboard/analytics/modules/kpi-cards.vue
@@ -4,6 +4,7 @@
 import { computed, ref } from 'vue';
 
 import { CountTo } from '@vben/common-ui';
+import { useAccess } from '@vben/access';
 import { IconifyIcon } from '@vben/icons';
 
 import { Col, Row } from 'ant-design-vue';
@@ -13,6 +14,14 @@
 const props = defineProps<{
   summary: MesHomeApi.Summary;
 }>();
+const { hasAccessByCodes } = useAccess();
+
+const canViewWorkOrder = computed(() => hasAccessByCodes(['mes:pro-work-order:query']));
+const canViewFeedback = computed(() => hasAccessByCodes(['mes:pro-feedback:query']));
+const canViewQuality = computed(() => hasAccessByCodes([
+  'mes:qc-iqc:query', 'mes:qc-ipqc:query', 'mes:qc-oqc:query', 'mes:qc-rqc:query',
+]));
+const canViewEquipment = computed(() => hasAccessByCodes(['mes:dv-machinery:query']));
 
 const emit = defineEmits<{
   navigate: [name: string];
@@ -59,7 +68,7 @@
 <template>
   <Row :gutter="16">
     <!-- 鐢熶骇璁㈠崟 -->
-    <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+    <Col v-if="canViewWorkOrder" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
       <div
         class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
         :style="tiltStyle('order')"
@@ -90,7 +99,7 @@
     </Col>
 
     <!-- 浠婃棩浜ч噺 -->
-    <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+    <Col v-if="canViewFeedback" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
       <div
         class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
         :style="tiltStyle('output')"
@@ -121,7 +130,7 @@
     </Col>
 
     <!-- 璐ㄩ噺鍚堟牸鐜� -->
-    <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+    <Col v-if="canViewQuality" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
       <div
         class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
         :style="tiltStyle('quality')"
@@ -154,7 +163,7 @@
     </Col>
 
     <!-- 璁惧杩愯鐜� -->
-    <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+    <Col v-if="canViewEquipment" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
       <div
         class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
         :style="tiltStyle('equip')"

--
Gitblit v1.9.3