#
luxiaotao1123
2024-02-29 d9b47bb0618f66795b2a3e265ff2a237055c4cf1
#
2个文件已修改
24 ■■■■ 已修改文件
zy-asrs-flow/config/routes.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/services/route.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/config/routes.ts
@@ -27,11 +27,6 @@
    ],
  },
  {
    path: '/home',
    name: 'home',
    component: './home',
  },
  {
    path: '*',
    layout: false,
    component: './404',
zy-asrs-flow/src/services/route.js
@@ -62,10 +62,15 @@
            break;
        }
    }
    addMapMenu(remoteMenu);
    const rootMenu = { routes: [] }
    addHomeMenu(remoteMenu);
    addUserSettingMenu(remoteMenu);
    patchRouteItems(proLayout, remoteMenu);
    patchRouteItems(rootMenu, remoteMenu);
    console.log(rootMenu);
    proLayout.children = proLayout.children.concat(rootMenu.routes);
    proLayout.routes = proLayout.routes.concat(rootMenu.routes);
}
function patchRouteItems(parent, children) {
@@ -78,7 +83,6 @@
                path: menu.path,
                element: <Component />,
            }
            parent.children.push(newRoute);
            parent.routes.push(newRoute);
        } else {
            // parent
@@ -105,15 +109,6 @@
        path: "/home",
        component: "/home",
        icon: createIcon('HomeOutlined')
    })
}
function addMapMenu(remoteMenu) {
    remoteMenu.unshift({
        name: "地图监控",
        path: "/map",
        component: "/map",
        icon: createIcon('HeatMapOutlined')
    })
}