#
luxiaotao1123
2024-02-29 c7aa9cc76f90cf4c7510c59e1eff90f762cf400d
zy-asrs-flow/src/services/route.js
@@ -62,8 +62,14 @@
            break;
        }
    }
    const rootMenu = { routes: [] }
    addHomeMenu(remoteMenu);
    addUserSettingMenu(remoteMenu);
    patchRouteItems(proLayout, remoteMenu);
    patchRouteItems(rootMenu, remoteMenu);
    proLayout.children = proLayout.children.concat(rootMenu.routes);
    proLayout.routes = proLayout.routes.concat(rootMenu.routes);
}
function patchRouteItems(parent, children) {
@@ -76,7 +82,6 @@
                path: menu.path,
                element: <Component />,
            }
            parent.children.push(newRoute);
            parent.routes.push(newRoute);
        } else {
            // parent
@@ -97,6 +102,15 @@
    }
}
function addHomeMenu(remoteMenu) {
    remoteMenu.unshift({
        name: "首页",
        path: "/home",
        component: "/home",
        icon: createIcon('HomeOutlined')
    })
}
function addUserSettingMenu(remoteMenu) {
    // const settingRoute = {
    //     name: "个人设置",