From caddfd7efaabf86eb2348ae33d9b7a2281a2b167 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 16 十月 2026 21:04:56 +0800
Subject: [PATCH] fix(user): 导入失败明细改用弹窗展示,用户页字段统一叫「用户账号」
---
src/views/dashboard/analytics/index.vue | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/src/views/dashboard/analytics/index.vue b/src/views/dashboard/analytics/index.vue
index 3714991..9745151 100644
--- a/src/views/dashboard/analytics/index.vue
+++ b/src/views/dashboard/analytics/index.vue
@@ -4,9 +4,11 @@
import { Page } from '@vben/common-ui';
-import { Card, Col, Row } from 'ant-design-vue';
+import { Col, Row } from 'ant-design-vue';
import { getHomeSummary } from '#/api/mes/home';
+
+import { useHomeAccess } from '#/utils/use-home-access';
import { defaultSummary } from './data';
import AiInsights from './modules/ai-insights.vue';
@@ -15,11 +17,35 @@
import KpiCards from './modules/kpi-cards.vue';
import ProductionTrend from './modules/production-trend.vue';
import QuickActions from './modules/quick-actions.vue';
+import WarehouseHrCards from './modules/warehouse-hr-cards.vue';
defineOptions({ name: 'DashboardAnalytics' });
const router = useRouter();
const summary = ref(defaultSummary);
+const { canNavigate, canSeeMenu, canViewHome } = useHomeAccess();
+
+// 棣栭〉妯″潡璺熼殢渚ц竟鏍忚彍鍗曪細鑿滃崟娌″紑鐨勬ā鍧楁暣鍧椾笉灞曠ず
+/** MES 鐢熶骇 KPI锛氫换鎰忎竴寮犲崱鐨勮彍鍗曞紑鐫�灏辨覆鏌撴暣琛� */
+const showKpi = computed(
+ () =>
+ canViewHome.value &&
+ ['MesProWorkOrder', 'MesProFeedback', 'MesQcIqc', 'MesDvMachinery'].some(
+ (name) => canSeeMenu(name),
+ ),
+);
+/** AI 鏅鸿兘鍒嗘瀽锛欰I 妯″潡鐨勮彍鍗曞紑鐫�鎵嶆覆鏌� */
+const showAiInsights = computed(
+ () => canViewHome.value && canSeeMenu('AiChat'),
+);
+/** 鐢熶骇瓒嬪娍锛氭暟鎹潵鑷敓浜ф姤宸� */
+const showTrend = computed(
+ () => canViewHome.value && canSeeMenu('MesProFeedback'),
+);
+/** 宸ュ崟鐘舵�佸垎甯冿細鏁版嵁鏉ヨ嚜鐢熶骇璁㈠崟 */
+const showWorkOrderStatus = computed(
+ () => canViewHome.value && canSeeMenu('MesProWorkOrder'),
+);
const greeting = computed(() => {
const hour = new Date().getHours();
@@ -38,10 +64,12 @@
});
function handleNavigate(name: string) {
+ if (!canNavigate(name)) return;
router.push({ name });
}
async function loadSummary() {
+ if (!canViewHome.value) return;
summary.value = await getHomeSummary();
}
@@ -72,20 +100,32 @@
</div>
<!-- MES 鐢熶骇 KPI -->
- <KpiCards :summary="summary" @navigate="handleNavigate" />
+ <KpiCards v-if="showKpi" :summary="summary" @navigate="handleNavigate" />
<!-- ERP/WMS/BPM 缁忚惀 KPI -->
<BizCards @navigate="handleNavigate" />
+ <!-- 浠撳偍鐗╂祦 / 浜哄姏璧勬簮涓氬姟姒傝锛堣彍鍗曟病寮�鐨勬暣缁勪笉灞曠ず锛� -->
+ <WarehouseHrCards @navigate="handleNavigate" />
+
<!-- AI 鏅鸿兘鍒嗘瀽 -->
<AiInsights
+ v-if="showAiInsights"
:active-order-count="summary.workOrderActiveCount"
@navigate="handleNavigate"
/>
<!-- 鐢熶骇瓒嬪娍 + 棰勮闈㈡澘 -->
- <Row :gutter="16" class="mb-4">
- <Col :lg="14" :md="24" :sm="24" :xl="14" :xs="24" class="mb-4">
+ <Row v-if="showTrend || showWorkOrderStatus" :gutter="16" class="mb-4">
+ <Col
+ v-if="showTrend"
+ :lg="showWorkOrderStatus ? 14 : 24"
+ :md="24"
+ :sm="24"
+ :xl="showWorkOrderStatus ? 14 : 24"
+ :xs="24"
+ class="mb-4"
+ >
<div class="glass-card rounded-2xl p-5">
<h3 class="mb-4 text-base font-semibold text-gray-800 dark:text-gray-100">
鐢熶骇瓒嬪娍锛堣繎7澶╋級
@@ -93,9 +133,16 @@
<ProductionTrend />
</div>
</Col>
- <Col :lg="10" :md="24" :sm="24" :xl="10" :xs="24" class="mb-4">
+ <Col
+ v-if="showWorkOrderStatus"
+ :lg="showTrend ? 10 : 24"
+ :md="24"
+ :sm="24"
+ :xl="showTrend ? 10 : 24"
+ :xs="24"
+ class="mb-4"
+ >
<AlertPanel
- :andon-active-count="summary.andonActiveCount"
:repair-active-count="summary.repairActiveCount"
@navigate="handleNavigate"
/>
--
Gitblit v1.9.3