#
Junjie
2024-06-16 83c548d3dba59aaed9b52b5d413c6912a87d2efc
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: "个人设置",