Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory
| | |
| | | meta: { |
| | | title: "中台", |
| | | middleground: true, |
| | | privilege:'middleground' |
| | | // hide: true, |
| | | }, |
| | | component: () => import("../views/middleground"), |
| | |
| | | path: "/projectList", |
| | | meta: { |
| | | title: "项目组管理", |
| | | privilege:'projectList' |
| | | }, |
| | | component: Layouts, |
| | | children: [ |
| | |
| | | name: "ProjectList", |
| | | meta: { |
| | | title: "菌种库项目组管理", |
| | | privilege:'projectList_list' |
| | | }, |
| | | component: () => import("../views/projectList"), |
| | | }, |
| | |
| | | path: "/system", |
| | | meta: { |
| | | title: "系统管理", |
| | | privilege:'system' |
| | | }, |
| | | component: Layouts, |
| | | children: [ |
| | |
| | | name: "User", |
| | | meta: { |
| | | title: "人员管理", |
| | | privilege:'system_user' |
| | | }, |
| | | component: () => import("../views/system/user"), |
| | | }, |
| | |
| | | name: "Role", |
| | | meta: { |
| | | title: "角色管理", |
| | | privilege:'system_role' |
| | | }, |
| | | component: () => import("../views/system/role"), |
| | | }, |
| | |
| | | path: "operation-log", |
| | | meta: { |
| | | title: "操作日志", |
| | | privilege:'system_operation-log' |
| | | }, |
| | | component: () => import("../views/system/operation-log"), |
| | | }, |
| | |
| | | component: Layouts, |
| | | meta: { |
| | | title: "菌种库", |
| | | privilege:'strain' |
| | | }, |
| | | children: [ |
| | | { |
| | |
| | | component: Parent, |
| | | meta: { |
| | | title: "菌种库管理", |
| | | privilege:'strain_library' |
| | | }, |
| | | children: [ |
| | | { |
| | |
| | | name: "StrainLibraryManage", |
| | | meta: { |
| | | title: "原始细胞库", |
| | | privilege:'strain_library_strain_library_manage' |
| | | }, |
| | | component: () => |
| | | import("../views/strain-library/strain-library-manage"), |
| | |
| | | name: "MainCellLibrary", |
| | | meta: { |
| | | title: "主细胞库", |
| | | privilege:'strain_library_main_cell_library' |
| | | }, |
| | | component: () => |
| | | import("../views/strain-library/main-cell-library"), |
| | |
| | | name: "ProductionCellLibrary", |
| | | meta: { |
| | | title: "生产细胞库", |
| | | privilege:'strain_library_production_cell_library' |
| | | }, |
| | | component: () => |
| | | import("../views/strain-library/production-cell-library"), |
| | |
| | | name: "PedigreeChart", |
| | | meta: { |
| | | title: "菌种传代生产谱系图", |
| | | privilege:'strain_pedigree_vhart' |
| | | }, |
| | | component: () => import("../views/pedigree-chart"), |
| | | }, |
| | |
| | | name: "BreedingRecord", |
| | | meta: { |
| | | title: "菌种选育保藏记录", |
| | | privilege:'strain_breeding_record' |
| | | }, |
| | | component: () => import("../views/strain-library/breeding-record"), |
| | | }, |
| | |
| | | path: "validation", |
| | | meta: { |
| | | title: "菌种验证数据资料", |
| | | privilege:'strain_validation' |
| | | }, |
| | | component: Parent, |
| | | children: [ |
| | |
| | | name: "PrimitiveCell", |
| | | meta: { |
| | | title: "原始细胞库资料", |
| | | privilege:'strain_validation_primitive_cell' |
| | | }, |
| | | component: () => |
| | | import( |
| | |
| | | name: "ChiefCell", |
| | | meta: { |
| | | title: "主细胞库资料", |
| | | privilege:'strain_validation_chief_cell' |
| | | }, |
| | | component: () => |
| | | import("../views/strain-library/validation/chief-cell"), |
| | |
| | | component: Layouts, |
| | | meta: { |
| | | title: "菌种报告库", |
| | | privilege:'strainReportLibrary' |
| | | }, |
| | | children: [ |
| | | { |
| | |
| | | meta: { |
| | | title: "报告库一", |
| | | keepAlive: true, |
| | | privilege:'strainReportLibrary_reportLibraryOne' |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOne/index.vue"), |
| | |
| | | meta: { |
| | | title: "报告库二", |
| | | keepAlive: true, |
| | | privilege:'strainReportLibrary_reportLibraryTwo' |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneTWO/index.vue"), |
| | |
| | | meta: { |
| | | title: "报告库三", |
| | | keepAlive: true, |
| | | privilege:'strainReportLibrary_reportLibraryThree' |
| | | }, |
| | | component: () => |
| | | import( |
| | |
| | | meta: { |
| | | title: "报告库四", |
| | | keepAlive: true, |
| | | privilege:'strainReportLibrary_reportLibraryFour' |
| | | }, |
| | | component: () => |
| | | import("../views/strainReportLibrary/reportLibraryOneFour/index.vue"), |
| | |
| | | component: Layouts, |
| | | meta: { |
| | | title: "菌种库操作评定", |
| | | privilege:'strainOperationAssessment' |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "list", |
| | | meta: { |
| | | title: "评定列表", |
| | | privilege:'strainOperationAssessment_list' |
| | | }, |
| | | component: () => |
| | | import("../views/strainOperationAssessment/index.vue"), |
| | |
| | | component: Layouts, |
| | | meta: { |
| | | title: "菌种报告评定", |
| | | privilege:'deliveryAssessment' |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "projectTeamIntegral", |
| | | meta: { |
| | | title: "菌种项目组评定表", |
| | | privilege:'deliveryAssessment_projectTeamIntegral' |
| | | }, |
| | | component: () => |
| | | import("../views/deliveryAssessment/projectTeamIntegral"), |
| | |
| | | } |
| | | |
| | | // 判断是否拥有要跳转菜单权限 |
| | | let menus = store.state.menus; |
| | | if ( |
| | | to.meta.hasOwnProperty("privilege") && |
| | | !menus.includes(to.meta.privilege) |
| | | ) { |
| | | 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 |
| | | } |
| | | } |
| | | |
| | | // 设置标签列表 |
| | |
| | | SET_MENUS(state, data) { |
| | | state.menus = data; |
| | | }, |
| | | SET_FLAT_MENUS(state, data) { |
| | | state.flatMenus = data; |
| | | }, |
| | | SET_KEEPALIVELIST(state, data) { |
| | | state.keepAliveList = data; |
| | | sessionStorage.setItem('keepAliveList', JSON.stringify(data)); |
| | |
| | | setMenus({ commit }, data) { |
| | | commit('SET_MENUS', data); |
| | | }, |
| | | setFlatMenus({ commit }, data) { |
| | | commit('SET_FLAT_MENUS', data); |
| | | }, |
| | | setKeepAliveList({ commit }, data) { |
| | | commit('SET_KEEPALIVELIST', data); |
| | | }, |
| | |
| | | this.$message.warning('请输入密码') |
| | | return |
| | | } |
| | | function flattenMenus(menus) { |
| | | let result = [] |
| | | menus.forEach(menu => { |
| | | if (menu.path) result.push(menu.path) |
| | | if (menu.children && menu.children.length) { |
| | | result = result.concat(flattenMenus(menu.children)) |
| | | } |
| | | }) |
| | | return result |
| | | } |
| | | loginReq(this.loginForm).then(res => { |
| | | sessionStorage.setItem('token', res.token) |
| | | sessionStorage.setItem('userInfo', JSON.stringify(res.userInfo.user)) |
| | | sessionStorage.setItem('menus', JSON.stringify(res.menus)) |
| | | const flatMenus = flattenMenus(res.menus) |
| | | sessionStorage.setItem('flatMenus', JSON.stringify(flatMenus)) |
| | | this.$store.commit('SET_MENUS', res.menus) |
| | | this.$store.commit('SET_FLAT_MENUS', flatMenus) |
| | | this.$router.replace('/middleground') |
| | | }) |
| | | } |