From 28e15727beb977fac5dbd7844a9c3afdda249304 Mon Sep 17 00:00:00 2001 From: Xiaoyu <3306310490@qq.com> Date: Tue, 18 Feb 2025 15:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=90=84=E7=A7=8D=E5=BA=9F?= =?UTF-8?q?=E5=BC=83=E7=9A=84=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 10 +++--- src/layout/AdminLayout.vue | 58 ++++++++++++++++++------------ src/views/dashboard/index.vue | 62 ++++++++++++++++++++------------ src/views/report/about/index.vue | 37 +++++++++++++------ src/views/system/data/index.vue | 18 ++++++++-- 5 files changed, 125 insertions(+), 60 deletions(-) diff --git a/src/App.vue b/src/App.vue index b5b4128..fae0eec 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,20 +7,22 @@ import { RouterView } from "vue-router"; diff --git a/src/layout/AdminLayout.vue b/src/layout/AdminLayout.vue index 0ba0c26..6caccb7 100644 --- a/src/layout/AdminLayout.vue +++ b/src/layout/AdminLayout.vue @@ -4,6 +4,7 @@ import { useRouter, useRoute } from "vue-router"; import { ElMessageBox } from 'element-plus'; import { useUserStore } from '../stores/user'; import { useSystemLogStore } from '../stores/systemLog'; +import { markRaw } from 'vue'; import { Menu as IconMenu, Location, @@ -23,6 +24,19 @@ const activeMenu = ref(route.path); // 初始化为当前路由路径 const userStore = useUserStore(); const systemLogStore = useSystemLogStore(); +// 使用 markRaw 包装所有图标组件 +const icons = { + IconMenu: markRaw(IconMenu), + Location: markRaw(Location), + Setting: markRaw(Setting), + User: markRaw(User), + DataAnalysis: markRaw(DataAnalysis), + DataBoard: markRaw(DataBoard), + Tools: markRaw(Tools), + Document: markRaw(Document), + DataLine: markRaw(DataLine) +}; + // 监听路由变化 watch( () => route.path, @@ -77,18 +91,18 @@ const handleLogout = () => { @select="handleSelect" > - + - + 用户管理 @@ -101,7 +115,7 @@ const handleLogout = () => { 物种监测 @@ -110,7 +124,7 @@ const handleLogout = () => { 巡护任务 @@ -119,7 +133,7 @@ const handleLogout = () => { 日常报告 @@ -132,14 +146,14 @@ const handleLogout = () => {
- - + +
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 2f387d5..0cd4a48 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,7 +1,25 @@