hejianhao
2025-04-02 4a4e1253e9057dc9e01e6178ea37e5ed2a76ad7f
更新路由
2个文件已修改
38 ■■■■ 已修改文件
src/layouts/components/ElMenu/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layouts/components/ElMenu/index.vue
@@ -29,8 +29,12 @@
  },
  mounted() {
    // 获取所有定义的一级菜单和多级菜单
    // 过滤掉登录路由,只获取主布局下的路由
    this.routersList = routers.options.routes.find(route => route.path === '/').children;
    // 过滤掉登录路由和重定向路由,只获取主布局下的路由
    this.routersList = routers.options.routes.filter(route =>
      route.path !== '/login' &&
      route.path !== '/' &&
      !route.meta?.hide
    );
  },
};
</script>
src/router/index.js
@@ -25,6 +25,10 @@
const routes = [
    {
        path: "/",
        redirect: "/projectList/list",
    },
    {
        path: "/login",
        meta: {
            title: "登录",
@@ -34,15 +38,11 @@
        component: () => import("../views/login"),
    },
    {
        path: "/",
        component: Layouts,
        children: [
            {
                path: "/projectList",
                meta: {
                    title: "项目组管理",
                },
                component: Parent,
        component: Layouts,
                children: [
                    {
                        path: "list",
@@ -66,7 +66,7 @@
            },
            {
                path: "/dataManagement",
                component: Parent,
        component: Layouts,
                meta: {
                    title: "实验室数据管理",
                },
@@ -90,7 +90,7 @@
                        component: () => import("../views/dataManagement/approvalPlan/addPlan"),
                    },
                    {
                        path: "/dispatching",
                path: "dispatching",
                        meta: {
                            title: "实验调度管理",
                            keepAlive: true,
@@ -98,7 +98,7 @@
                        component: () => import("../views/dataManagement/dispatching/list.vue"),
                    },
                    {
                        path: "/confirmation-sheet",
                path: "confirmation-sheet",
                        meta: {
                            title: "校验方法确认单",
                            keepAlive: true,
@@ -109,13 +109,13 @@
            },
            {
                path: "/reportLibrary",
                component: Parent,
        component: Layouts,
                meta: {
                    title: "专业报告库审批",
                },
                children: [
                    {
                        path: "/feasibilityStudy",
                path: "feasibilityStudy",
                        meta: {
                            title: "可研报告库",
                            keepAlive: true,
@@ -123,7 +123,7 @@
                        component: () => import("../views/reportLibrary/feasibilityStudy/index.vue"),
                    },
                    {
                        path: "/feasibilityReport",
                path: "feasibilityReport",
                        meta: {
                            title: "可行报告库",
                            keepAlive: true,
@@ -131,7 +131,7 @@
                        component: () => import("../views/reportLibrary/feasibilityReport/index.vue"),
                    },
                    {
                        path: "/processDevelopment",
                path: "processDevelopment",
                        meta: {
                            title: "工艺开发工具",
                            keepAlive: true,
@@ -139,7 +139,7 @@
                        component: () => import("../views/reportLibrary/processDevelopment/index.vue"),
                    },
                    {
                        path: "/verificationRelease",
                path: "verificationRelease",
                        meta: {
                            title: "验证与发布",
                            keepAlive: true,
@@ -147,7 +147,7 @@
                        component: () => import("../views/reportLibrary/verificationRelease/index.vue"),
                    },
                    {
                        path: "/projectProposalLibrary",
                path: "projectProposalLibrary",
                        meta: {
                            title: "立项报告库",
                            keepAlive: true,
@@ -156,8 +156,6 @@
                    },
                ],
            }
        ],
    },
];
const router = new VueRouter({