| | |
| | | import Vue from "vue"; |
| | | import VueRouter from "vue-router"; |
| | | import Layouts from "../layouts"; |
| | | import Parent from "../layouts/components/AppContent" |
| | | import Parent from "../layouts/components/AppContent"; |
| | | import store from "../store"; |
| | | |
| | | Vue.use(VueRouter); |
| | | const originalPush = VueRouter.prototype.push |
| | | const originalPush = VueRouter.prototype.push; |
| | | VueRouter.prototype.push = function push(location) { |
| | | return originalPush.call(this, location).catch(err => err) |
| | | } |
| | | return originalPush.call(this, location).catch((err) => err); |
| | | }; |
| | | |
| | | /** |
| | | * path: "/login", ------页面地址 |
| | |
| | | */ |
| | | |
| | | const routes = [ |
| | | { |
| | | path: "/", |
| | | redirect: "/projectList/list", |
| | | { |
| | | path: "/", |
| | | redirect: "/login", |
| | | }, |
| | | { |
| | | path: "/login", |
| | | meta: { |
| | | title: "登录", |
| | | oneself: true, |
| | | hide: true, |
| | | }, |
| | | { |
| | | path: "/login", |
| | | component: () => import("../views/login"), |
| | | }, |
| | | { |
| | | path: "/middleground", |
| | | meta: { |
| | | title: "中台", |
| | | middleground: true, |
| | | privilege:'middleground' |
| | | // hide: true, |
| | | }, |
| | | component: () => import("../views/middleground"), |
| | | }, |
| | | { |
| | | path: "/projectList", |
| | | meta: { |
| | | title: "项目组管理", |
| | | privilege:'projectList' |
| | | }, |
| | | component: Layouts, |
| | | children: [ |
| | | { |
| | | path: "list", |
| | | name: "ProjectList", |
| | | meta: { |
| | | title: "登录", |
| | | oneself: true, |
| | | hide: true, |
| | | title: "菌种库项目组管理", |
| | | privilege:'projectList_list', |
| | | }, |
| | | component: () => import("../views/login"), |
| | | }, |
| | | { |
| | | path: "/projectList", |
| | | component: () => import("../views/projectList"), |
| | | }, |
| | | { |
| | | path: "addProject", |
| | | name: "AddProject", |
| | | meta: { |
| | | title: "项目组管理", |
| | | title: "新增菌种库项目组", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: Layouts, |
| | | children: [ |
| | | { |
| | | path: "list", |
| | | name: "ProjectList", |
| | | meta: { |
| | | title: "项目组管理", |
| | | }, |
| | | component: () => import("../views/projectList"), |
| | | }, |
| | | { |
| | | path: "addProject", |
| | | name: "AddProject", |
| | | meta: { |
| | | title: "新增项目组", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/projectList/addProject"), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: "/system", |
| | | component: () => import("../views/projectList/addProject"), |
| | | }, |
| | | { |
| | | path: "editProject", |
| | | name: "EditProject", |
| | | meta: { |
| | | title: "系统管理", |
| | | title: "编辑菌种库项目组", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: Layouts, |
| | | children: [ |
| | | { |
| | | path: "user", |
| | | name: "User", |
| | | meta: { |
| | | title: "人员管理", |
| | | }, |
| | | component: () => import("../views/system/user"), |
| | | }, |
| | | { |
| | | path: "role", |
| | | name: "Role", |
| | | meta: { |
| | | title: "角色管理", |
| | | }, |
| | | component: () => import("../views/system/role"), |
| | | }, |
| | | { |
| | | path: "add-role", |
| | | name: "AddRole", |
| | | meta: { |
| | | title: "新增角色", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/system/role/add"), |
| | | }, |
| | | { |
| | | path: "edit-role", |
| | | name: "EditRole", |
| | | meta: { |
| | | title: "编辑角色", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/system/role/edit"), |
| | | }, |
| | | { |
| | | path: "detail-role", |
| | | name: "DetailRole", |
| | | meta: { |
| | | title: "角色详情", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/system/role/detail"), |
| | | }, |
| | | { |
| | | path: "operation-log", |
| | | meta: { |
| | | title: "操作日志", |
| | | }, |
| | | component: () => import("../views/system/operation-log"), |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | path: "/strain", |
| | | component: Layouts, |
| | | component: () => import("../views/projectList/editProject"), |
| | | }, |
| | | { |
| | | path: "detailProject", |
| | | name: "DetailProject", |
| | | meta: { |
| | | title: "菌种库", |
| | | title: "菌种库项目组详情", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/projectList/detailProject"), |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: "/system", |
| | | meta: { |
| | | title: "系统管理", |
| | | privilege:'system' |
| | | }, |
| | | component: Layouts, |
| | | children: [ |
| | | { |
| | | path: "user", |
| | | name: "User", |
| | | meta: { |
| | | title: "人员管理", |
| | | privilege:'system_user' |
| | | }, |
| | | component: () => import("../views/system/user"), |
| | | }, |
| | | { |
| | | path: "role", |
| | | name: "Role", |
| | | meta: { |
| | | title: "角色管理", |
| | | privilege:'system_role' |
| | | }, |
| | | component: () => import("../views/system/role"), |
| | | }, |
| | | { |
| | | path: "add-role", |
| | | name: "AddRole", |
| | | meta: { |
| | | title: "新增角色", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/system/role/add"), |
| | | }, |
| | | { |
| | | path: "edit-role", |
| | | name: "EditRole", |
| | | meta: { |
| | | title: "编辑角色", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/system/role/edit"), |
| | | }, |
| | | { |
| | | path: "detail-role", |
| | | name: "DetailRole", |
| | | meta: { |
| | | title: "角色详情", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/system/role/detail"), |
| | | }, |
| | | { |
| | | path: "operation-log", |
| | | meta: { |
| | | title: "操作日志", |
| | | privilege:'system_operation-log' |
| | | }, |
| | | component: () => import("../views/system/operation-log"), |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: "/strain", |
| | | component: Layouts, |
| | | meta: { |
| | | title: "菌种库", |
| | | privilege:'strain' |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "/strain-library", |
| | | component: Parent, |
| | | meta: { |
| | | title: "菌种库管理", |
| | | privilege:'strain_library' |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "/strain-library", |
| | | component: Parent, |
| | | meta: { |
| | | title: "菌种库管理", |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "strain-library-manage", |
| | | name: "StrainLibraryManage", |
| | | meta: { |
| | | title: "原始细胞库", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/strain-library/strain-library-manage"), |
| | | }, |
| | | { |
| | | path: "strain-library-manage/add", |
| | | name: "StrainLibraryManageAdd", |
| | | meta: { |
| | | title: "新增原始细胞库", |
| | | keepAlive: true, |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/strain-library/strain-library-manage/add.vue"), |
| | | }, |
| | | { |
| | | path: "strain-library-manage/record", |
| | | name: "StrainRecord", |
| | | meta: { |
| | | title: "出入库记录", |
| | | keepAlive: true, |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/strain-library/strain-library-manage/record.vue"), |
| | | }, |
| | | { |
| | | path: "main-cell-library", |
| | | name: "MainCellLibrary", |
| | | meta: { |
| | | title: "主细胞库", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/strain-library/main-cell-library"), |
| | | }, |
| | | { |
| | | path: "main-cell-library/add", |
| | | name: "MainCellLibraryAdd", |
| | | meta: { |
| | | title: "新增主细胞", |
| | | keepAlive: true, |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/strain-library/main-cell-library/add.vue"), |
| | | }, |
| | | { |
| | | path: "production-cell-library", |
| | | name: "ProductionCellLibrary", |
| | | meta: { |
| | | title: "生产细胞库", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/strain-library/production-cell-library"), |
| | | }, |
| | | { |
| | | path: "production-cell-library/add", |
| | | name: "ProductionCellLibraryAdd", |
| | | meta: { |
| | | title: "新增生产细胞", |
| | | keepAlive: true, |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/strain-library/production-cell-library/add.vue"), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: 'pedigree-vhart', |
| | | name: 'PedigreeChart', |
| | | { |
| | | path: "strain-library-manage", |
| | | name: "StrainLibraryManage", |
| | | meta: { |
| | | title: "菌种传代生产谱系图", |
| | | title: "原始细胞库(原种登记)", |
| | | privilege:'strain_library_strain_library_manage' |
| | | }, |
| | | component: () => import("../views/pedigree-chart"), |
| | | }, |
| | | { |
| | | path: 'add-pedigree', |
| | | name: 'AddPedigree', |
| | | component: () => |
| | | import("../views/strain-library/strain-library-manage"), |
| | | }, |
| | | { |
| | | path: "strain-library-manage/add", |
| | | name: "StrainLibraryManageAdd", |
| | | meta: { |
| | | title: "新增菌种传代生产谱系图", |
| | | title: "新增原始细胞库", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "StrainLibraryManageAdd", |
| | | }, |
| | | component: () => import("../views/pedigree-chart/add"), |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | { |
| | | path: "/dataManagement", |
| | | component: Layouts, |
| | | meta: { |
| | | title: "实验室数据管理", |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "approvalPlan", |
| | | meta: { |
| | | title: "项目课题方案审批", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/approvalPlan/list.vue"), |
| | | component: () => |
| | | import("../views/strain-library/strain-library-manage/add.vue"), |
| | | }, |
| | | { |
| | | path: "strain-library-manage/detail", |
| | | name: "StrainLibraryManageEdit", |
| | | meta: { |
| | | title: "编辑原始细胞库", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "StrainLibraryManageAdd", |
| | | }, |
| | | { |
| | | path: "addPlan", |
| | | name: "addPlan", |
| | | meta: { |
| | | title: "新增项目课题方案", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/approvalPlan/addPlan"), |
| | | component: () => |
| | | import("../views/strain-library/strain-library-manage/add.vue"), |
| | | }, |
| | | { |
| | | path: "strain-library-manage/record", |
| | | name: "StrainRecord", |
| | | meta: { |
| | | title: "出入库记录", |
| | | hide: true, |
| | | }, |
| | | { |
| | | path: "dispatching", |
| | | meta: { |
| | | title: "实验调度管理", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/dispatching/list.vue"), |
| | | component: () => |
| | | import( |
| | | "../views/strain-library/strain-library-manage/record.vue" |
| | | ), |
| | | }, |
| | | { |
| | | path: "main-cell-library", |
| | | name: "MainCellLibrary", |
| | | meta: { |
| | | title: "主细胞库(祖传母)", |
| | | privilege:'strain_library_main_cell_library' |
| | | }, |
| | | { |
| | | path: "addDispatch", |
| | | meta: { |
| | | title: "新增实验调度", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/dispatching/addDispatch"), |
| | | component: () => |
| | | import("../views/strain-library/main-cell-library"), |
| | | }, |
| | | { |
| | | path: "main-cell-library/add", |
| | | name: "MainCellLibraryAdd", |
| | | meta: { |
| | | title: "新增主细胞", |
| | | hide: true, |
| | | keepAlive: true, |
| | | formMode: "add", |
| | | componentName: "MainCellLibraryAdd" |
| | | }, |
| | | { |
| | | path: "confirmation-sheet", |
| | | name: "ConfirmationSheet", |
| | | meta: { |
| | | title: "检验方法确认单", |
| | | }, |
| | | component: () => import("../views/dataManagement/confirmation-sheet"), |
| | | component: () => |
| | | import("../views/strain-library/main-cell-library/add.vue"), |
| | | }, |
| | | { |
| | | path: "main-cell-library/edit", |
| | | name: "MainCellLibraryEdit", |
| | | meta: { |
| | | title: "编辑主细胞", |
| | | hide: true, |
| | | keepAlive: true, |
| | | formMode: "edit", |
| | | componentName: "MainCellLibraryAdd" |
| | | }, |
| | | { |
| | | path: "confirmation-sheet/add", |
| | | name: "AddConfirmationSheet", |
| | | meta: { |
| | | title: "检验方法确认单", |
| | | }, |
| | | component: () => import("../views/dataManagement/confirmation-sheet/components/add.vue"), |
| | | component: () => |
| | | import("../views/strain-library/main-cell-library/add.vue"), |
| | | }, |
| | | { |
| | | path: "production-cell-library", |
| | | name: "ProductionCellLibrary", |
| | | meta: { |
| | | title: "子细胞库(母传子)", |
| | | privilege:'strain_library_production_cell_library' |
| | | }, |
| | | { |
| | | path: "/sampleManage", |
| | | meta: { |
| | | title: "样品管理", |
| | | // keepAlive: true, |
| | | }, |
| | | component: Parent, |
| | | children: [ |
| | | { |
| | | path: "manage", |
| | | meta: { |
| | | title: "样品管理", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleManage/list.vue"), |
| | | }, |
| | | { |
| | | path: "addSample", |
| | | name: "addPaddSamplelan", |
| | | meta: { |
| | | title: "新增样品", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleManage/addSample"), |
| | | }, { |
| | | path: "record", |
| | | meta: { |
| | | title: "取样操作记录列表", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleRecordList/list.vue"), |
| | | }, |
| | | { |
| | | path: "changeRecord", |
| | | name: "changeRecord", |
| | | meta: { |
| | | title: "填写取样操作记录", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleRecordList/changeRecord"), |
| | | }, { |
| | | path: "submissionList", |
| | | meta: { |
| | | title: "送样单列表", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleSubmissionList/list.vue"), |
| | | }, |
| | | { |
| | | path: "submission", |
| | | name: "submission", |
| | | meta: { |
| | | title: "送样单详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/sampleSubmissionList/submission"), |
| | | }, |
| | | ] |
| | | |
| | | component: () => |
| | | import("../views/strain-library/production-cell-library"), |
| | | }, |
| | | { |
| | | path: "production-cell-library/add", |
| | | name: "ProductionCellLibraryAdd", |
| | | meta: { |
| | | title: "新增生产细胞", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "ProductionCellLibraryAdd" |
| | | }, |
| | | { |
| | | path: "deliveryRecord", |
| | | meta: { |
| | | title: "取样送样记录", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/SampleDeliveryRecord/list.vue"), |
| | | component: () => |
| | | import("../views/strain-library/production-cell-library/add.vue"), |
| | | }, |
| | | { |
| | | path: "production-cell-grandson", |
| | | name: "ProductionCellGrandson", |
| | | meta: { |
| | | title: "孙细胞库(子传孙)", |
| | | privilege:'strain_library_production_cell_library' |
| | | }, |
| | | { |
| | | path: "delivery", |
| | | name: "delivery", |
| | | meta: { |
| | | title: "送样详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/SampleDeliveryRecord/deliveryRecord"), |
| | | component: () => |
| | | import("../views/strain-library/production-cell-grandson"), |
| | | }, |
| | | { |
| | | path: "production-cell-grandson/add", |
| | | name: "ProductionCellGrandsonAdd", |
| | | meta: { |
| | | title: "新增生产细胞", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "ProductionCellGrandsonAdd" |
| | | }, |
| | | { |
| | | path: "originalRecordTest", |
| | | meta: { |
| | | title: "原始检验记录", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/originalRecordTest/list.vue"), |
| | | component: () => |
| | | import("../views/strain-library/production-cell-grandson/add.vue"), |
| | | }, |
| | | { |
| | | path: "production-cell-grandson/edit", |
| | | name: "ProductionCellGrandsonEdit", |
| | | meta: { |
| | | title: "编辑生产细胞", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "ProductionCellGrandsonAdd" |
| | | }, |
| | | { |
| | | path: "originalRecordTest/detail", |
| | | name: "OriginalRecordTestDetail", |
| | | meta: { |
| | | title: "原始检验记录详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/originalRecordTest/detail.vue"), |
| | | component: () => |
| | | import("../views/strain-library/production-cell-grandson/add.vue"), |
| | | }, |
| | | { |
| | | path: "production-cell-library/edit", |
| | | name: "ProductionCellLibraryEdit", |
| | | meta: { |
| | | title: "编辑生产细胞", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "ProductionCellLibraryAdd" |
| | | }, |
| | | { |
| | | path: "inspectionReport", |
| | | meta: { |
| | | title: "检验报告管理", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/inspectionReport/list.vue"), |
| | | }, |
| | | { |
| | | path: "inspectionReport/detail", |
| | | name: "inspectionReportDetail", |
| | | meta: { |
| | | title: "检验报告详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/inspectionReport/detail.vue"), |
| | | }, |
| | | { |
| | | path: "testResultReport", |
| | | meta: { |
| | | title: "实验结果汇报", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/testResultReport/list.vue"), |
| | | }, |
| | | { |
| | | path: "testResultReport/detail", |
| | | name: "testResultReportDetail", |
| | | meta: { |
| | | title: "实验结果详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/dataManagement/testResultReport/detail.vue"), |
| | | }, |
| | | component: () => |
| | | import("../views/strain-library/production-cell-library/add.vue"), |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: "/reportLibrary", |
| | | component: Layouts, |
| | | }, |
| | | { |
| | | path: "pedigree-vhart", |
| | | name: "PedigreeChart", |
| | | meta: { |
| | | title: "专业报告库审批", |
| | | title: "菌种传代生产谱系图", |
| | | privilege:'strain_pedigree_vhart' |
| | | }, |
| | | component: () => import("../views/pedigree-chart"), |
| | | }, |
| | | { |
| | | path: "detail-pedigree", |
| | | name: "DetailPedigree", |
| | | meta: { |
| | | title: "母代菌种传代生产谱系图详情", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/pedigree-chart/add"), |
| | | }, |
| | | { |
| | | path: "add-pedigree", |
| | | name: "AddPedigree", |
| | | meta: { |
| | | title: "新增母代菌种传代生产谱系图", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/pedigree-chart/add"), |
| | | }, |
| | | { |
| | | path: "add-progenitor", |
| | | name: "AddProgenitor", |
| | | meta: { |
| | | title: "新增祖代菌种传代生产谱系图", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/pedigree-chart/addProgenitor"), |
| | | }, |
| | | { |
| | | path: "detail-progenitor", |
| | | name: "DetailProgenitor", |
| | | meta: { |
| | | title: "祖代菌种传代生产谱系图详情", |
| | | hide: true, |
| | | }, |
| | | 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: "菌种选育保藏记录", |
| | | privilege:'strain_breeding_record' |
| | | }, |
| | | component: () => import("../views/strain-library/breeding-record"), |
| | | }, |
| | | { |
| | | path: "add-breeding-record", |
| | | name: "AddBreedingRecord", |
| | | meta: { |
| | | title: "新增菌种选育保藏记录", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "BreedingRecordAdd" |
| | | }, |
| | | component: () => import("../views/strain-library/breeding-record/add"), |
| | | }, |
| | | { |
| | | path: "edit-breeding-record", |
| | | name: "EditBreedingRecord", |
| | | meta: { |
| | | title: "编辑菌种选育保藏记录", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "BreedingRecordAdd" |
| | | }, |
| | | component: () => import("../views/strain-library/breeding-record/add"), |
| | | }, |
| | | { |
| | | path: "detail-breeding-record", |
| | | name: "DetailBreedingRecord", |
| | | meta: { |
| | | title: "菌种选育保藏记录详情", |
| | | hide: true, |
| | | }, |
| | | component: () => import("../views/strain-library/breeding-record/add"), |
| | | }, |
| | | { |
| | | path: "validation", |
| | | meta: { |
| | | title: "菌种验证数据资料", |
| | | privilege:'strain_validation' |
| | | }, |
| | | component: Parent, |
| | | children: [ |
| | | { |
| | | path: "feasibilityStudy", |
| | | meta: { |
| | | title: "可研报告库", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/reportLibrary/feasibilityStudy/index.vue"), |
| | | { |
| | | path: "primitive-cell", |
| | | name: "PrimitiveCell", |
| | | meta: { |
| | | title: "祖代菌种库验证资料", |
| | | privilege:'strain_validation_primitive_cell' |
| | | }, |
| | | { |
| | | path: "add", |
| | | meta: { |
| | | title: "新增可行报告", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/reportLibrary/feasibilityStudy/add.vue"), |
| | | component: () => |
| | | import( |
| | | "../views/strain-library/validation/primitive-cell/index.vue" |
| | | ), |
| | | }, |
| | | { |
| | | path: "add-primitive-cell", |
| | | name: "AddPrimitiveCell", |
| | | meta: { |
| | | title: "新增祖代菌种库验证资料", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "PrimitiveCellAdd" |
| | | }, |
| | | { |
| | | path: "feasibilityReport", |
| | | meta: { |
| | | title: "可行报告库", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/reportLibrary/feasibilityReport/index.vue"), |
| | | component: () => |
| | | import( |
| | | "../views/strain-library/validation/primitive-cell/add.vue" |
| | | ), |
| | | }, |
| | | { |
| | | path: "edit-primitive-cell", |
| | | name: "EditPrimitiveCell", |
| | | meta: { |
| | | title: "编辑祖代菌种库验证资料", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "PrimitiveCellAdd" |
| | | }, |
| | | { |
| | | path: "processDevelopment", |
| | | meta: { |
| | | title: "工艺开发工具", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/reportLibrary/processDevelopment/index.vue"), |
| | | component: () => |
| | | import( |
| | | "../views/strain-library/validation/primitive-cell/add.vue" |
| | | ), |
| | | }, |
| | | { |
| | | path: "confirm-detail", |
| | | name: "ConfirmDetail", |
| | | meta: { |
| | | title: "确认祖代菌种库验证资料", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | { |
| | | path: "verificationRelease", |
| | | meta: { |
| | | title: "验证与发布", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/reportLibrary/verificationRelease/index.vue"), |
| | | component: () => |
| | | import( |
| | | "../views/strain-library/validation/primitive-cell/confirm-detail.vue" |
| | | ), |
| | | }, |
| | | { |
| | | path: "chief-cell", |
| | | name: "ChiefCell", |
| | | meta: { |
| | | title: "母代菌种库验证资料", |
| | | privilege:'strain_validation_chief_cell' |
| | | }, |
| | | { |
| | | path: "projectProposalLibrary", |
| | | meta: { |
| | | title: "立项报告库", |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/reportLibrary/projectProposalLibrary/index.vue"), |
| | | component: () => |
| | | import("../views/strain-library/validation/chief-cell"), |
| | | }, |
| | | { |
| | | path: "add-chief-cell", |
| | | name: "AddChiefCell", |
| | | meta: { |
| | | title: "新增母代菌种库验证资料", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "ChiefCellAdd" |
| | | }, |
| | | component: () => |
| | | import("../views/strain-library/validation/chief-cell/add.vue"), |
| | | }, |
| | | { |
| | | path: "edit-chief-cell", |
| | | name: "EditChiefCell", |
| | | meta: { |
| | | title: "编辑母代菌种库验证资料", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "ChiefCellAdd" |
| | | }, |
| | | component: () => |
| | | import("../views/strain-library/validation/chief-cell/add.vue"), |
| | | }, |
| | | { |
| | | path: "confirm-detail-chief", |
| | | name: "ConfirmDetailChief", |
| | | meta: { |
| | | title: "确认母代菌种库验证资料", |
| | | hide: true, |
| | | }, |
| | | component: () => |
| | | import( |
| | | "../views/strain-library/validation/chief-cell/confirm-detail.vue" |
| | | ), |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: "/strainReportLibrary", |
| | | component: Layouts, |
| | | meta: { |
| | | title: "菌种报告库", |
| | | privilege:'strainReportLibrary' |
| | | }, |
| | | { |
| | | path: "/deliveryAssessment", |
| | | component: Layouts, |
| | | children: [ |
| | | { |
| | | path: "reportLibraryOne", |
| | | meta: { |
| | | title: "工作交付评定", |
| | | title: "报告库一", |
| | | keepAlive: true, |
| | | privilege:'strainReportLibrary_reportLibraryOne' |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "projectTeamIntegral", |
| | | meta: { |
| | | title: "项目组总积分", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/projectTeamIntegral"), |
| | | }, |
| | | { |
| | | path: "projectTeamIntegral-detail", |
| | | meta: { |
| | | title: "积分详情", |
| | | hide: true |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/projectTeamIntegral/detail.vue"), |
| | | }, |
| | | { |
| | | // 超级管理员 |
| | | path: "taskList", |
| | | meta: { |
| | | title: "课题列表", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/taskList"), |
| | | }, |
| | | { |
| | | // 工艺工程师 审批人 实验员 超级管理员 |
| | | path: "restsTask", |
| | | meta: { |
| | | title: "实验员其他任务", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/restsTask"), |
| | | }, |
| | | { |
| | | // 超级管理员 工艺工程师 |
| | | path: "clinicalTrial", |
| | | meta: { |
| | | title: "临床试验积分列表", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/clinicalTrial"), |
| | | }, |
| | | { |
| | | // 化验师 审批人 |
| | | path: "testingAndEvaluation", |
| | | meta: { |
| | | title: "检测项评定列表", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/testingAndEvaluation"), |
| | | }, |
| | | { |
| | | // 化验师 实验员 |
| | | path: "experimentResults", |
| | | meta: { |
| | | title: "实验结果评定", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/experimentResults"), |
| | | }, |
| | | { |
| | | // 化验师 工艺工程师 审批人 |
| | | path: "assayTaskList", |
| | | meta: { |
| | | title: "课题评定列表", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/assayTaskList"), |
| | | }, |
| | | { |
| | | // 工艺工程师 |
| | | path: "processEngineerEvaluate", |
| | | meta: { |
| | | title: "工艺工程师工作评定详情", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/processEngineerEvaluate"), |
| | | }, |
| | | { |
| | | // 工艺工程师 |
| | | path: "testerWorkerEvaluate", |
| | | meta: { |
| | | title: "实验员工作评定", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/testerWorkerEvaluate"), |
| | | }, |
| | | { |
| | | // 工艺工程师 |
| | | path: "addTesterWorkerEvaluate", |
| | | name: 'AddTesterWorkerEvaluate', |
| | | meta: { |
| | | title: "新增实验员工作评定", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/testerWorkerEvaluate/add"), |
| | | }, |
| | | { |
| | | // 工艺工程师 |
| | | path: "chemistEvaluate", |
| | | meta: { |
| | | title: "化验师工作评定", |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/chemistEvaluate"), |
| | | }, |
| | | { |
| | | // 工艺工程师 |
| | | path: "addchemistEvaluate", |
| | | name: 'AddchemistEvaluate', |
| | | meta: { |
| | | title: "新增化验师工作评定", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/chemistEvaluate/add"), |
| | | }, |
| | | ] |
| | | } |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOne/index.vue"), |
| | | }, |
| | | { |
| | | path: "add", |
| | | meta: { |
| | | title: "新增报告", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "ReportLibraryOneAdd" |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOne/add.vue"), |
| | | }, |
| | | { |
| | | path: "detail", |
| | | meta: { |
| | | title: "报告详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | componentName: "ReportLibraryOneAdd" |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOne/add.vue"), |
| | | }, |
| | | { |
| | | path: "reportLibraryTwo", |
| | | meta: { |
| | | title: "报告库二", |
| | | keepAlive: true, |
| | | privilege:'strainReportLibrary_reportLibraryTwo' |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneTWO/index.vue"), |
| | | }, |
| | | { |
| | | path: "detailTwo", |
| | | meta: { |
| | | title: "报告详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneTWO/add.vue"), |
| | | }, |
| | | { |
| | | path: "addTwo", |
| | | meta: { |
| | | title: "新增报告", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneTWO/add.vue"), |
| | | }, |
| | | { |
| | | path: "reportLibraryThree", |
| | | meta: { |
| | | title: "报告库三", |
| | | keepAlive: true, |
| | | privilege:'strainReportLibrary_reportLibraryThree' |
| | | }, |
| | | component: () => |
| | | import( |
| | | "../views/strainReportLibrary/reportLibraryOneThree/index.vue" |
| | | ), |
| | | }, |
| | | { |
| | | path: "detailThree", |
| | | meta: { |
| | | title: "报告详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneThree/add.vue"), |
| | | }, |
| | | { |
| | | path: "addThree", |
| | | meta: { |
| | | title: "新增报告", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneThree/add.vue"), |
| | | }, |
| | | { |
| | | path: "reportLibraryFour", |
| | | meta: { |
| | | title: "报告库四", |
| | | keepAlive: true, |
| | | privilege:'strainReportLibrary_reportLibraryFour' |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneFour/index.vue"), |
| | | }, |
| | | { |
| | | path: "detailFour", |
| | | meta: { |
| | | title: "报告详情", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneFour/add.vue"), |
| | | }, |
| | | { |
| | | path: "addFour", |
| | | meta: { |
| | | title: "新增报告", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneFour/add.vue"), |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: "/strainOperationAssessment", |
| | | component: Layouts, |
| | | meta: { |
| | | title: "菌种库操作评定", |
| | | privilege:'strainOperationAssessment' |
| | | }, |
| | | children: [ |
| | | // { |
| | | // path: "list", |
| | | // meta: { |
| | | // title: "评定列表", |
| | | // privilege:'strainOperationAssessment_list' |
| | | // }, |
| | | // component: () => |
| | | // import("../views/strainOperationAssessment/index.vue"), |
| | | // }, |
| | | ], |
| | | }, |
| | | { |
| | | path: "/deliveryAssessment", |
| | | component: Layouts, |
| | | meta: { |
| | | title: "菌种工作评定", |
| | | privilege:'deliveryAssessment' |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "projectTeamIntegral", |
| | | meta: { |
| | | title: "菌种项目组评定表", |
| | | privilege:'deliveryAssessment_projectTeamIntegral' |
| | | }, |
| | | component: () => |
| | | import("../views/deliveryAssessment/projectTeamIntegral"), |
| | | }, |
| | | { |
| | | path: "projectTeamIntegral-detail", |
| | | meta: { |
| | | title: "评定详情", |
| | | hide: true, |
| | | }, |
| | | component: () => |
| | | import("../views/deliveryAssessment/projectTeamIntegral/detail.vue"), |
| | | }, |
| | | { |
| | | path: "list", |
| | | meta: { |
| | | title: "菌种库操作评定列表", |
| | | privilege:'strainOperationAssessment' |
| | | }, |
| | | component: () => |
| | | import("../views/strainOperationAssessment/index.vue"), |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | const router = new VueRouter({ |
| | | mode: "hash", |
| | | base: process.env.BASE_URL, |
| | | routes, |
| | | mode: "hash", |
| | | base: process.env.BASE_URL, |
| | | routes, |
| | | }); |
| | | |
| | | let tagCacheSequence = 0; |
| | | const createTagCacheKey = (fullPath) => `${fullPath}::${Date.now()}-${tagCacheSequence++}`; |
| | | const getTagFullPath = (tag) => tag.fullPath || router.resolve({ |
| | | path: tag.path, |
| | | query: tag.query || {}, |
| | | }).route.fullPath; |
| | | const getViewIdentity = (path, query = {}) => { |
| | | const businessQuery = { ...query }; |
| | | delete businessQuery._view; |
| | | return router.resolve({ path, query: businessQuery }).route.fullPath; |
| | | }; |
| | | |
| | | // 前置路由拦截器 |
| | | router.beforeEach((to, from, next) => { |
| | | // 设置当前页签名称 |
| | | document.title = to.meta.title || '实验室流程'; |
| | | // 设置当前页签名称 |
| | | 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 (to.path === "/login") { |
| | | if (sessionStorage.getItem("token")) { |
| | | next("/projectList"); // 已登录状态访问登录页时重定向到系统首页 |
| | | return; |
| | | } |
| | | next(); |
| | | return; |
| | | } |
| | | |
| | | // 设置标签列表 |
| | | if (!to.meta.hide || !to.meta.oneself) { |
| | | let tagList = JSON.parse(sessionStorage.getItem('tagList') || '[]') |
| | | // 判断是否存在 |
| | | let isExist = tagList.some(item => item.path === to.path) |
| | | if (!isExist) { |
| | | // 只保存必要的信息 |
| | | const tagInfo = { |
| | | path: to.path, |
| | | name: to.name, |
| | | meta: to.meta |
| | | } |
| | | tagList.push(tagInfo) |
| | | sessionStorage.setItem('tagList', JSON.stringify(tagList)) |
| | | store.commit('SET_TAGLIST', tagList) |
| | | } |
| | | // 登录状态校验 |
| | | 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; |
| | | // } |
| | | |
| | | let flatMenus = store.state.flatMenus |
| | | if (!flatMenus || flatMenus.length === 0) { |
| | | // 刷新后从sessionStorage恢复 |
| | | const menus = JSON.parse(sessionStorage.getItem('menus') || '[]') |
| | | const flat = JSON.parse(sessionStorage.getItem('flatMenus') || '[]') |
| | | store.commit('SET_MENUS', menus) |
| | | store.commit('SET_FLAT_MENUS', flat) |
| | | flatMenus = flat |
| | | } |
| | | if (to.meta && to.meta.privilege) { |
| | | if (!flatMenus.includes(to.meta.privilege)) { |
| | | next('/403') // 无权限跳转403 |
| | | return |
| | | } |
| | | } |
| | | |
| | | // Hidden business pages are independent tab instances. An existing tab keeps |
| | | // its _view; entering from a list again creates a clean component instance. |
| | | const isIndependentView = Boolean(to.meta.hide && !to.meta.oneself); |
| | | if (isIndependentView && !to.query._view) { |
| | | const viewIdentity = getViewIdentity(to.path, to.query); |
| | | const tagList = JSON.parse(sessionStorage.getItem("tagList") || "[]"); |
| | | const staleTags = tagList.filter((tag) => |
| | | getViewIdentity(tag.path, tag.query) === viewIdentity |
| | | ); |
| | | |
| | | if (staleTags.length) { |
| | | const staleKeys = staleTags.map((tag) => tag.cacheKey || getTagFullPath(tag)); |
| | | const remainingTags = tagList.filter((tag) => |
| | | getViewIdentity(tag.path, tag.query) !== viewIdentity |
| | | ); |
| | | store.commit("SET_TAGLIST", remainingTags); |
| | | store.commit("PRUNE_VIEW_CACHE", staleKeys); |
| | | } |
| | | |
| | | // 判断是否需要缓存 |
| | | if (to.meta.keepAlive) { |
| | | let keepAliveList = JSON.parse(sessionStorage.getItem('keepAliveList') || '[]') |
| | | // 判断是否已经缓存 |
| | | let isExist = keepAliveList.includes(to.name) |
| | | if (!isExist) { |
| | | keepAliveList.push(to.name) |
| | | sessionStorage.setItem('keepAliveList', JSON.stringify(keepAliveList)) |
| | | store.commit('SET_KEEPALIVELIST', keepAliveList) |
| | | } |
| | | } |
| | | next({ |
| | | path: to.path, |
| | | query: { ...to.query, _view: `${Date.now()}-${tagCacheSequence++}` }, |
| | | replace: true, |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | next() |
| | | // } |
| | | // 设置标签列表 |
| | | if (!to.meta.hide || !to.meta.oneself) { |
| | | let tagList = JSON.parse(sessionStorage.getItem("tagList") || "[]"); |
| | | // 判断是否存在 |
| | | let isExist = tagList.some((item) => getTagFullPath(item) === to.fullPath); |
| | | if (!isExist) { |
| | | // 只保存必要的信息 |
| | | const tagInfo = { |
| | | path: to.path, |
| | | fullPath: to.fullPath, |
| | | name: to.name, |
| | | meta: to.meta, |
| | | query: to.query, |
| | | cacheKey: createTagCacheKey(to.fullPath), |
| | | }; |
| | | tagList.push(tagInfo); |
| | | sessionStorage.setItem("tagList", JSON.stringify(tagList)); |
| | | store.commit("SET_TAGLIST", tagList); |
| | | } |
| | | } |
| | | |
| | | // 判断是否需要缓存 |
| | | if (to.meta.keepAlive) { |
| | | let keepAliveList = JSON.parse( |
| | | sessionStorage.getItem("keepAliveList") || "[]" |
| | | ); |
| | | |
| | | const cacheName = to.meta.componentName || to.name; // 优先用组件真实name |
| | | |
| | | // 判断是否已经缓存 |
| | | let isExist = keepAliveList.includes(cacheName); |
| | | if (!isExist) { |
| | | keepAliveList.push(cacheName); |
| | | sessionStorage.setItem("keepAliveList", JSON.stringify(keepAliveList)); |
| | | store.commit("SET_KEEPALIVELIST", keepAliveList); |
| | | } |
| | | } |
| | | |
| | | next(); |
| | | }); |
| | | |
| | | export default router; |