From e79fd9a43864f88522cd545e7c4ae971a89a0109 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 07 三月 2024 14:41:34 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/services/route.js | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/zy-asrs-flow/src/services/route.js b/zy-asrs-flow/src/services/route.js
index 4ba1bb7..0b5a631 100644
--- a/zy-asrs-flow/src/services/route.js
+++ b/zy-asrs-flow/src/services/route.js
@@ -62,9 +62,15 @@
break;
}
}
+
+ 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) {
@@ -77,8 +83,8 @@
path: menu.path,
element: <Component />,
}
- parent.children.push(newRoute);
parent.routes.push(newRoute);
+ parent.children.push(newRoute);
} else {
// parent
const newRoute = {
@@ -88,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]);
@@ -98,6 +105,15 @@
}
}
+function addMapMenu(remoteMenu) {
+ remoteMenu.unshift({
+ name: "鍦板浘鐩戞帶",
+ path: "/map",
+ component: "/map",
+ icon: createIcon('HeatMapOutlined')
+ })
+}
+
function addHomeMenu(remoteMenu) {
remoteMenu.unshift({
name: "棣栭〉",
--
Gitblit v1.9.1