From 83c548d3dba59aaed9b52b5d413c6912a87d2efc Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期日, 16 六月 2024 15:50:14 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/services/route.js | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/zy-asrs-flow/src/services/route.js b/zy-asrs-flow/src/services/route.js
index 9fc02f7..0b5a631 100644
--- a/zy-asrs-flow/src/services/route.js
+++ b/zy-asrs-flow/src/services/route.js
@@ -62,10 +62,15 @@
break;
}
}
- addMapMenu(remoteMenu);
+
+ const rootMenu = { routes: [], children: [] }
+ addMapMenu(remoteMenu)
addHomeMenu(remoteMenu);
addUserSettingMenu(remoteMenu);
- patchRouteItems(proLayout, remoteMenu);
+ patchRouteItems(rootMenu, remoteMenu);
+
+ proLayout.children = proLayout.children.concat(rootMenu.children);
+ proLayout.routes = proLayout.routes.concat(rootMenu.routes);
}
function patchRouteItems(parent, children) {
@@ -78,8 +83,8 @@
path: menu.path,
element: <Component />,
}
- parent.children.push(newRoute);
parent.routes.push(newRoute);
+ parent.children.push(newRoute);
} else {
// parent
const newRoute = {
@@ -89,6 +94,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]);
@@ -99,15 +105,6 @@
}
}
-function addHomeMenu(remoteMenu) {
- remoteMenu.unshift({
- name: "棣栭〉",
- path: "/home",
- component: "/home",
- icon: createIcon('HomeOutlined')
- })
-}
-
function addMapMenu(remoteMenu) {
remoteMenu.unshift({
name: "鍦板浘鐩戞帶",
@@ -117,6 +114,15 @@
})
}
+function addHomeMenu(remoteMenu) {
+ remoteMenu.unshift({
+ name: "棣栭〉",
+ path: "/home",
+ component: "/home",
+ icon: createIcon('HomeOutlined')
+ })
+}
+
function addUserSettingMenu(remoteMenu) {
// const settingRoute = {
// name: "涓汉璁剧疆",
--
Gitblit v1.9.1