#
luxiaotao1123
2024-03-18 c352df43ea5eea9a84e89867eb3b03ba3b2dbb83
zy-asrs-flow/src/services/route.js
@@ -63,12 +63,13 @@
        }
    }
    const rootMenu = { routes: [] }
    const rootMenu = { routes: [], children: [] }
    addMapMenu(remoteMenu)
    addHomeMenu(remoteMenu);
    addUserSettingMenu(remoteMenu);
    patchRouteItems(rootMenu, remoteMenu);
    proLayout.children = proLayout.children.concat(rootMenu.routes);
    proLayout.children = proLayout.children.concat(rootMenu.children);
    proLayout.routes = proLayout.routes.concat(rootMenu.routes);
}
@@ -83,6 +84,7 @@
                element: <Component />,
            }
            parent.routes.push(newRoute);
            parent.children.push(newRoute);
        } else {
            // parent
            const newRoute = {
@@ -92,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]);
@@ -102,6 +105,15 @@
    }
}
function addMapMenu(remoteMenu) {
    remoteMenu.unshift({
        name: "地图监控",
        path: "/map",
        component: "/map",
        icon: createIcon('HeatMapOutlined')
    })
}
function addHomeMenu(remoteMenu) {
    remoteMenu.unshift({
        name: "首页",