From 3268de7494d5281186bb692635540e38db251e13 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 12 十月 2026 11:53:01 +0800
Subject: [PATCH] feat(dashboard): 添加权限控制和能耗分析功能

---
 src/views/dashboard/analytics/modules/production-trend.vue |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/views/dashboard/analytics/modules/production-trend.vue b/src/views/dashboard/analytics/modules/production-trend.vue
index e6ad064..45bc2bb 100644
--- a/src/views/dashboard/analytics/modules/production-trend.vue
+++ b/src/views/dashboard/analytics/modules/production-trend.vue
@@ -2,18 +2,22 @@
 import type { MesHomeApi } from '#/api/mes/home';
 import type { EchartsUIType } from '@vben/plugins/echarts';
 
-import { onMounted, ref, watch } from 'vue';
+import { onMounted, ref } from 'vue';
 
 import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 import { getProductionTrend } from '#/api/mes/home';
 
+import { useHomeAccess } from '../use-home-access';
+
 defineOptions({ name: 'DashboardProductionTrend' });
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);
+const { canViewHome } = useHomeAccess();
 
 async function loadTrend() {
+  if (!canViewHome.value) return;
   const data = await getProductionTrend(7);
   const dates = data.map((d: MesHomeApi.ProductionTrend) => d.date.slice(5));
   const quantities = data.map((d: MesHomeApi.ProductionTrend) => d.quantity);

--
Gitblit v1.9.3