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 |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/zy-asrs-flow/src/services/route.js b/zy-asrs-flow/src/services/route.js
index 40f194d..0b5a631 100644
--- a/zy-asrs-flow/src/services/route.js
+++ b/zy-asrs-flow/src/services/route.js
@@ -63,13 +63,13 @@
         }
     }
 
-    const rootMenu = { routes: [] }
+    const rootMenu = { routes: [], children: [] }
+    addMapMenu(remoteMenu)
     addHomeMenu(remoteMenu);
     addUserSettingMenu(remoteMenu);
     patchRouteItems(rootMenu, remoteMenu);
-    console.log(rootMenu);
 
-    proLayout.children = proLayout.children.concat(rootMenu.routes);
+    proLayout.children = proLayout.children.concat(rootMenu.children);
     proLayout.routes = proLayout.routes.concat(rootMenu.routes);
 }
 
@@ -84,6 +84,7 @@
                 element: <Component />,
             }
             parent.routes.push(newRoute);
+            parent.children.push(newRoute);
         } else {
             // parent
             const newRoute = {
@@ -93,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]);
@@ -103,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