| | |
| | | const routes = [ |
| | | { |
| | | path: "/", |
| | | redirect: "/projectList/list", |
| | | redirect: "/login", |
| | | }, |
| | | { |
| | | path: "/login", |
| | |
| | | path: "list", |
| | | name: "ProjectList", |
| | | meta: { |
| | | title: "项目组管理", |
| | | title: "菌种库项目组管理", |
| | | }, |
| | | component: () => import("../views/projectList"), |
| | | }, |
| | |
| | | path: "addProject", |
| | | name: "AddProject", |
| | | meta: { |
| | | title: "新增项目组", |
| | | title: "新增菌种库项目组", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | |
| | | path: 'add-pedigree', |
| | | name: 'AddPedigree', |
| | | meta: { |
| | | title: "新增菌种传代生产谱系图", |
| | | title: "新增母代菌种传代生产谱系图", |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/pedigree-chart/add"), |
| | | }, |
| | | { |
| | | path: 'add-pedigree', |
| | | name: 'AddPedigree', |
| | | path: 'add-progenitor', |
| | | name: 'AddProgenitor', |
| | | meta: { |
| | | title: "新增菌种传代生产谱系图", |
| | | title: "新增祖代菌种传代生产谱系图", |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/pedigree-chart/add"), |
| | | } |
| | | component: () => import("../views/pedigree-chart/addProgenitor"), |
| | | }, |
| | | // { |
| | | // path: "strain-flow-chart", |
| | | // name: "StrainFlowChart", |
| | | // meta: { |
| | | // title: "菌种传代产生流程图", |
| | | // keepAlive: true, |
| | | // }, |
| | | // component: () => import("../views/strain-library/strain-flow-chart"), |
| | | // }, |
| | | { |
| | | path: 'breeding-record', |
| | | name: 'BreedingRecord', |
| | | meta: { |
| | | title: "菌种选育保藏记录", |
| | | }, |
| | | component: () => import("../views/strain-library/breeding-record"), |
| | | }, |
| | | { |
| | | path: 'add-breeding-record', |
| | | name: 'AddBreedingRecord', |
| | | meta: { |
| | | title: "新增菌种选育保藏记录", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/strain-library/breeding-record/add"), |
| | | }, |
| | | { |
| | | path: 'validation', |
| | | meta: { |
| | | title: "菌种验证数据资料", |
| | | }, |
| | | component: Parent, |
| | | children: [ |
| | | { |
| | | path: 'primitive-cell', |
| | | name: 'PrimitiveCell', |
| | | meta: { |
| | | title: '原始细胞库资料', |
| | | }, |
| | | component: () => import("../views/strain-library/validation/primitive-cell/index.vue") |
| | | }, |
| | | { |
| | | path: 'add-primitive-cell', |
| | | name: 'AddPrimitiveCell', |
| | | meta: { |
| | | title: '新增原始细胞库资料', |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/strain-library/validation/primitive-cell/add.vue") |
| | | }, |
| | | { |
| | | path: 'confirm-detail', |
| | | name: 'ConfirmDetail', |
| | | meta: { |
| | | title: '确认原始细胞库资料', |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/strain-library/validation/primitive-cell/confirm-detail.vue") |
| | | }, |
| | | { |
| | | path: 'chief-cell', |
| | | name: 'ChiefCell', |
| | | meta: { |
| | | title: '主细胞库资料' |
| | | }, |
| | | component: () => import("../views/strain-library/validation/chief-cell") |
| | | } |
| | | ] |
| | | }, |
| | | ] |
| | | }, { |
| | | path: "/strainReportLibrary", |
| | |
| | | document.title = to.meta.title || '实验室流程'; |
| | | |
| | | // 登录验证 |
| | | // 排除登录页的校验 |
| | | // if (to.path === "/login") { |
| | | // sessionStorage.removeItem('userInfo') |
| | | // next() |
| | | // } else if (!sessionStorage.getItem('userInfo')) { |
| | | // next('/login') |
| | | // } else { |
| | | // // 判断是否拥有要跳转菜单权限 |
| | | // let menus = store.state.menus |
| | | // if (to.meta.hasOwnProperty('privilege') && !menus.includes(to.meta.privilege)) { |
| | | // return |
| | | // if (sessionStorage.getItem('token')) { |
| | | // next('/projectList'); // 已登录状态访问登录页时重定向到系统首页 |
| | | // return; |
| | | // } |
| | | // next(); |
| | | // return; |
| | | // } |
| | | |
| | | // // 登录状态校验 |
| | | // const isAuthenticated = sessionStorage.getItem('token'); |
| | | // if (!isAuthenticated) { |
| | | // next('/login'); // 未登录用户重定向到登录页 |
| | | // return; |
| | | // } |
| | | |
| | | // 判断是否拥有要跳转菜单权限 |
| | | let menus = store.state.menus |
| | | if (to.meta.hasOwnProperty('privilege') && !menus.includes(to.meta.privilege)) { |
| | | return |
| | | } |
| | | |
| | | // 设置标签列表 |
| | | if (!to.meta.hide || !to.meta.oneself) { |
| | |
| | | const tagInfo = { |
| | | path: to.path, |
| | | name: to.name, |
| | | meta: to.meta |
| | | meta: to.meta, |
| | | query: to.query, |
| | | } |
| | | tagList.push(tagInfo) |
| | | sessionStorage.setItem('tagList', JSON.stringify(tagList)) |
| | |
| | | } |
| | | |
| | | next() |
| | | // } |
| | | }); |
| | | |
| | | export default router; |