From ac4341ea6b66ae02427d39d35f41d42d78b2eb2e Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 14 二月 2025 10:08:32 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/services/route.js | 43 +++++++++++++++++++++++++++++++++----------
1 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/zy-asrs-flow/src/services/route.js b/zy-asrs-flow/src/services/route.js
index 34cbd68..1221444 100644
--- a/zy-asrs-flow/src/services/route.js
+++ b/zy-asrs-flow/src/services/route.js
@@ -62,8 +62,14 @@
break;
}
}
+
+ const rootMenu = { routes: [], children: [] }
+ addHomeMenu(remoteMenu);
addUserSettingMenu(remoteMenu);
- patchRouteItems(proLayout, remoteMenu);
+ patchRouteItems(rootMenu, remoteMenu);
+
+ proLayout.children = proLayout.children.concat(rootMenu.routes);
+ proLayout.routes = proLayout.routes.concat(rootMenu.routes);
}
function patchRouteItems(parent, children) {
@@ -76,8 +82,8 @@
path: menu.path,
element: <Component />,
}
- parent.children.push(newRoute);
parent.routes.push(newRoute);
+ parent.children.push(newRoute);
} else {
// parent
const newRoute = {
@@ -87,6 +93,7 @@
children: [],
}
parent.routes.push(newRoute);
+ parent.children.push(newRoute);
if (menu.routes && menu.routes.length > 0) {
for (const route of menu.routes) {
patchRouteItems(newRoute, [route]);
@@ -97,17 +104,33 @@
}
}
+function addHomeMenu(remoteMenu) {
+ remoteMenu.unshift({
+ name: "棣栭〉",
+ path: "/home",
+ component: "/home",
+ icon: createIcon('HomeOutlined')
+ })
+}
+
function addUserSettingMenu(remoteMenu) {
- const settingRoute = {
- name: "涓汉璁剧疆",
- path: "/account/setting",
- component: "/account/setting"
- }
+ // const settingRoute = {
+ // name: "涓汉璁剧疆",
+ // path: "/account/setting",
+ // component: "/account/setting"
+ // }
+ // remoteMenu.push({
+ // name: "涓汉涓績",
+ // path: "/account",
+ // component: null,
+ // routes: [settingRoute],
+ // icon: createIcon('UserOutlined')
+ // })
+
remoteMenu.push({
name: "涓汉涓績",
- path: "/account",
- component: null,
- routes: [settingRoute],
+ path: "/account/setting",
+ component: "/account/setting",
icon: createIcon('UserOutlined')
})
}
\ No newline at end of file
--
Gitblit v1.9.1