From c0599a0fd0153156986b8d509f77754d39728c21 Mon Sep 17 00:00:00 2001
From: 97 <1240438805@qq.com>
Date: Fri, 25 Apr 2025 23:22:35 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E3=80=91=E4=BF=AE=E6=94=B9=E9=9D=A2=E5=8C=85=E5=B1=91=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E8=87=B3=E9=A1=B6=E9=83=A8=EF=BC=8C=E7=BB=9F=E4=B8=80?=
=?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91=E7=BB=84=E4=BB=B6=E8=87=B3layout?=
=?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0tags=E9=A1=B5=E7=AD=BE=E7=AE=80?=
=?UTF-8?q?=E5=8D=95=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/components/TopCrumb/index.vue | 46 ++++++++++
frontend/src/components/TopTags/index.vue | 96 ++++++++++++++++++++
frontend/src/layouts/basicLayout.vue | 42 +++++----
frontend/src/views/common/docs/index.vue | 2 -
frontend/src/views/common/redoc/index.vue | 2 -
frontend/src/views/dashboard/analysis.vue | 2 -
frontend/src/views/dashboard/workplace.vue | 2 -
frontend/src/views/monitor/cache/index.vue | 3 -
frontend/src/views/monitor/online/index.vue | 3 -
frontend/src/views/system/config/index.vue | 3 -
frontend/src/views/system/dept/index.vue | 3 -
frontend/src/views/system/dict/data.vue | 3 -
frontend/src/views/system/dict/index.vue | 3 -
frontend/src/views/system/job/index.vue | 3 -
frontend/src/views/system/log/index.vue | 3 -
frontend/src/views/system/menu/index.vue | 3 -
frontend/src/views/system/notice/index.vue | 3 -
frontend/src/views/system/position/index.vue | 3 -
frontend/src/views/system/role/index.vue | 3 -
frontend/src/views/system/user/index.vue | 3 -
20 files changed, 166 insertions(+), 65 deletions(-)
create mode 100644 frontend/src/components/TopCrumb/index.vue
create mode 100644 frontend/src/components/TopTags/index.vue
diff --git a/frontend/src/components/TopCrumb/index.vue b/frontend/src/components/TopCrumb/index.vue
new file mode 100644
index 00000000..16546384
--- /dev/null
+++ b/frontend/src/components/TopCrumb/index.vue
@@ -0,0 +1,46 @@
+
+
+
+ {{ route.breadcrumbName }}
+ {{ route.breadcrumbName }}
+
+
+
+
+
+
+
diff --git a/frontend/src/components/TopTags/index.vue b/frontend/src/components/TopTags/index.vue
new file mode 100644
index 00000000..86074d04
--- /dev/null
+++ b/frontend/src/components/TopTags/index.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/layouts/basicLayout.vue b/frontend/src/layouts/basicLayout.vue
index ab904c85..4107b236 100644
--- a/frontend/src/layouts/basicLayout.vue
+++ b/frontend/src/layouts/basicLayout.vue
@@ -41,6 +41,7 @@
+
@@ -126,7 +127,7 @@
-
+
@@ -167,6 +168,10 @@ import { useUserStore } from "@/store/index";
import { logout } from '@/api/system/auth';
import { useConfigStore, useNoticeStore } from "@/store/index";
+import topTags from '@/components/TopTags/index.vue';
+import topCrumb from '@/components/TopCrumb/index.vue';
+
+
const userStore = useUserStore();
// 路由相关
@@ -215,6 +220,22 @@ const handleLogout = async () => {
}
};
+ // 设置展开的菜单
+ const findParentPath = (menus: any[], targetPath: string, parentPath: string[] = []): string[] => {
+ for (const menu of menus) {
+ if (menu.key === targetPath) {
+ return parentPath;
+ }
+ if (menu.children?.length) {
+ const result = findParentPath(menu.children, targetPath, [...parentPath, menu.key]);
+ if (result.length) {
+ return result;
+ }
+ }
+ }
+ return [];
+ };
+
// 处理菜单点击
const handleMenuClick: MenuProps['onClick'] = (menuInfo) => {
menuState.openKeys = menuInfo.keyPath.slice(0, -1) as string[];
@@ -228,7 +249,8 @@ watch(() => route.path, (newPath) => {
menuState.openKeys = [];
menuState.selectedKeys = [];
} else {
- menuState.selectedKeys = [newPath];
+ menuState.openKeys = findParentPath(menuState.menus, newPath);
+ menuState.selectedKeys = [newPath];
}
});
@@ -267,22 +289,6 @@ const initMenu = () => {
const currentPath = route.path;
menuState.selectedKeys = [currentPath];
- // 设置展开的菜单
- const findParentPath = (menus: any[], targetPath: string, parentPath: string[] = []): string[] => {
- for (const menu of menus) {
- if (menu.key === targetPath) {
- return parentPath;
- }
- if (menu.children?.length) {
- const result = findParentPath(menu.children, targetPath, [...parentPath, menu.key]);
- if (result.length) {
- return result;
- }
- }
- }
- return [];
- };
-
menuState.openKeys = findParentPath(menuState.menus, currentPath);
};
diff --git a/frontend/src/views/common/docs/index.vue b/frontend/src/views/common/docs/index.vue
index c9f8dcd4..2da6beda 100644
--- a/frontend/src/views/common/docs/index.vue
+++ b/frontend/src/views/common/docs/index.vue
@@ -1,5 +1,4 @@
-
@@ -11,7 +10,6 @@