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/quick-actions.vue | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/views/dashboard/analytics/modules/quick-actions.vue b/src/views/dashboard/analytics/modules/quick-actions.vue
index 9a825b5..d7cc976 100644
--- a/src/views/dashboard/analytics/modules/quick-actions.vue
+++ b/src/views/dashboard/analytics/modules/quick-actions.vue
@@ -1,5 +1,9 @@
<script lang="ts" setup>
+import { computed } from 'vue';
+
import { IconifyIcon } from '@vben/icons';
+
+import { useHomeAccess } from '../use-home-access';
defineOptions({ name: 'DashboardQuickActions' });
@@ -25,14 +29,17 @@
{ title: '宸ヨ壓璺嚎', icon: 'lucide:route', route: 'MesPdRouting', gradient: 'from-teal-500 to-emerald-500', shadow: 'shadow-teal-500/15' },
{ title: '鏁版嵁鎶ヨ〃', icon: 'lucide:bar-chart-big', route: 'MesHomeIndex', gradient: 'from-pink-500 to-rose-500', shadow: 'shadow-pink-500/15' },
];
+
+const { canNavigate } = useHomeAccess();
+const accessibleActions = computed(() => actions.filter((action) => canNavigate(action.route)));
</script>
<template>
- <div class="glass-card rounded-2xl p-5">
+ <div v-if="accessibleActions.length" class="glass-card rounded-2xl p-5">
<h3 class="mb-4 text-sm font-semibold text-gray-800 dark:text-gray-100">蹇嵎鎿嶄綔</h3>
<div class="grid grid-cols-4 gap-3 sm:grid-cols-8">
<div
- v-for="action in actions"
+ v-for="action in accessibleActions"
:key="action.route"
class="group flex cursor-pointer flex-col items-center gap-2 rounded-xl p-3 transition-all duration-300 hover:-translate-y-1"
@click="emit('navigate', action.route)"
--
Gitblit v1.9.3