From 1e584e9bc5079b2e067159f75041fe0eb882083d Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Tue, 20 May 2025 23:14:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- .../Sidebar/components/SidebarMixTopMenu.vue | 12 ++++++++-- src/layout/index.vue | 6 ++--- src/plugins/permission.ts | 5 ++-- src/store/modules/permission.store.ts | 24 +++++++++---------- src/types/websocket.ts | 15 ------------ 6 files changed, 29 insertions(+), 35 deletions(-) delete mode 100644 src/types/websocket.ts diff --git a/package.json b/package.json index a57448a3..4925a998 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue3-element-admin", "description": "Vue3 + Vite + TypeScript + Element-Plus 的后台管理模板,vue-element-admin 的 Vue3 版本", - "version": "2.28.4", + "version": "2.29.0", "private": true, "type": "module", "scripts": { diff --git a/src/layout/components/Sidebar/components/SidebarMixTopMenu.vue b/src/layout/components/Sidebar/components/SidebarMixTopMenu.vue index 7f0f4154..2fd657d1 100644 --- a/src/layout/components/Sidebar/components/SidebarMixTopMenu.vue +++ b/src/layout/components/Sidebar/components/SidebarMixTopMenu.vue @@ -78,10 +78,18 @@ appStore.activeTopMenu(activeTopMenuPath); */ const handleMenuSelect = (routePath: string) => { appStore.activeTopMenu(routePath); // 设置激活的顶部菜单 - permissionStore.setMixedLayoutLeftRoutes(routePath); // 更新左侧菜单 - navigateToFirstLeftMenu(permissionStore.mixedLayoutLeftRoutes); // 跳转到左侧第一个菜单 + activateFirstLevelMenu(routePath); // 激活一级菜单并设置左侧二级菜单 }; +/** + * 激活一级菜单并设置左侧二级菜单 + * @param routePath 点击的菜单路径 + */ +function activateFirstLevelMenu(routePath: string) { + permissionStore.updateSideMenu(routePath); // 更新左侧菜单 + navigateToFirstLeftMenu(permissionStore.sideMenuRoutes); // 跳转到左侧第一个菜单 +} + /** * 跳转到左侧第一个可访问的菜单 * @param menus 左侧菜单列表 diff --git a/src/layout/index.vue b/src/layout/index.vue index 4ac10c6f..9227afc8 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -11,7 +11,7 @@