diff --git a/src/permission.js b/src/permission.js index 1721b613a..e38230d20 100644 --- a/src/permission.js +++ b/src/permission.js @@ -1,13 +1,12 @@ import Vue from 'vue'; import store from '@/store/index_APP_TARGET'; import router from './router/index_APP_TARGET'; -import {PermissionParam} from '@/scripts/ProjectConfig'; +import {loginInfo} from '@/scripts/ProjectConfig'; import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; // import { admin } from './router/index_APP_TARGET'; import { getToken, removeToken, getSessionStorage } from '@/utils/auth'; import localStore from 'storejs'; -import { loginInfo } from '@/scripts/ProjectConfig'; // function hasPermission(roles, permissionRoles) { // if (roles.indexOf(admin) >= 0) return true; @@ -22,9 +21,9 @@ const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向 // function isDesignPage(toRoutePath) { // return designPageRegex.some(item => item.test(toRoutePath) ); // } -for (const val in PermissionParam) { - if (PermissionParam[val].whitePage && !whiteList.includes(PermissionParam[val].whitePage)) { - whiteList.push(PermissionParam[val].whitePage); +for (const val in loginInfo) { + if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) { + whiteList.push(loginInfo[val].loginPath); } } // const loginPage = whiteList[0]; @@ -38,15 +37,7 @@ function getRouteInfo(to) { if (whiteList.includes(toRoutePath)) { // 登陆页面清空 token removeToken(); } - - // if (isDesignPage(toRoutePath)) { - // const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; - // loginPath = whitePage || loginDesignPage; - // } else { - // const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; - // loginPath = whitePage || loginPage; - // } - loginPath = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : whiteList[0]; + loginPath = loginInfo[current_session] ? loginInfo[current_session].loginPath : whiteList[0]; if (to.query.projectDevice && to.query.type) { loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`; } diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index 21cd914ef..313b7de17 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -15,28 +15,32 @@ import Link_Crsc from '@/assets/icon/link_crsc.png'; // title:页面title; loginPath:退出登录跳转路径; loginParam:登录接口参数project;loginTitle:登录页左上角title;logoWidth:登录页左上角logo宽度; // homeTitle:导航栏title(没有采用title); browserTitle:浏览器窗口title;bottomColumn:底部栏描述;bottomIcon:底部栏Icon;linkIcon:浏览器窗口icon(没有采用ProjectIcon) +// titleDistance 项目title距离密码框距离 export const loginInfo = { xty: { title: '西安铁路职业技术学院城市轨道交通实训平台', - loginPath:'/login?pro=xty', + loginPath:'/login?project=xty', loginParam: 'XTY', titleDistance: '-150px', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '013' }, login: { title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Practical Training Platform' : '城市轨道交通实训平台', loginPath: '/login', loginParam: 'DEFAULT', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '011' }, design: { title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Design Platform' : '城市轨道交通设计平台', loginPath: '/design/login', loginParam: 'DEFAULT', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '011' }, designxty: { title: '西安铁路职业技术学院城市轨道交通设计平台', @@ -44,7 +48,8 @@ export const loginInfo = { loginParam: 'XTY', titleDistance: '-150px', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '013' }, gzb: { title: '贵州装备制造职业学院城市轨道交通实训平台', @@ -52,7 +57,8 @@ export const loginInfo = { loginParam: 'GZB', titleDistance: '-150px', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '014' }, designgzb: { title: '贵州装备制造职业学院城市轨道交通设计平台', @@ -60,7 +66,8 @@ export const loginInfo = { titleDistance: '-150px', loginParam: 'GZB', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '014' }, heb: { title: '城市轨道交通综合行车模拟仿真系统V1.0', @@ -71,7 +78,8 @@ export const loginInfo = { bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273', loginParam: 'HEB', navigationLogoWidth: '120px', - navigationMarginLeft: '140px' + navigationMarginLeft: '140px', + systemType: '019' }, designheb: { title: '城市轨道交通设计平台V1.0', @@ -82,7 +90,8 @@ export const loginInfo = { bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273', loginParam: 'HEB', navigationLogoWidth: '120px', - navigationMarginLeft: '140px' + navigationMarginLeft: '140px', + systemType: '019' }, xadt: { title: '城市轨道交通实训平台', @@ -93,7 +102,8 @@ export const loginInfo = { loginPath:'/login?project=xadt', loginParam: 'XADT', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '012' }, designxadt: { title: '城市轨道交通设计平台', @@ -104,7 +114,8 @@ export const loginInfo = { loginPath:'/design/login?project=xadt', loginParam: 'XADT', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '012' }, jsxt:{ title: '城市轨道交通竞赛平台', @@ -112,7 +123,8 @@ export const loginInfo = { loginParam: 'DEFAULT', titleDistance: '-150px', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '015' }, refereeJsxt:{ title: '城市轨道交通裁判平台', @@ -120,7 +132,8 @@ export const loginInfo = { loginParam: 'DEFAULT', titleDistance: '-150px', navigationLogoWidth: '40px', - navigationMarginLeft: '60px' + navigationMarginLeft: '60px', + systemType: '015' }, jyd: { title: '城市轨道交通实训平台', @@ -132,7 +145,8 @@ export const loginInfo = { bottomColumn: '', bottomIcon: Bottom_Jyd, linkIcon: Link_Jyd, - loginParam: 'DEFAULT' + loginParam: 'DEFAULT', + systemType: '011' }, designjyd: { title: '城市轨道交通设计平台', @@ -144,7 +158,8 @@ export const loginInfo = { bottomColumn: '', bottomIcon: Bottom_Jyd, linkIcon: Link_Jyd, - loginParam: 'DEFAULT' + loginParam: 'DEFAULT', + systemType: '011' }, tky: { title: '城市轨道交通实训平台', @@ -154,7 +169,8 @@ export const loginInfo = { bottomIcon: FaviconTky, loginParam: 'DEFAULT', navigationLogoWidth: '75px', - navigationMarginLeft: '90px' + navigationMarginLeft: '90px', + systemType: '011' }, designtky: { title: '城市轨道交通设计平台', @@ -164,7 +180,8 @@ export const loginInfo = { bottomColumn: '', loginParam: 'DEFAULT', navigationLogoWidth: '75px', - navigationMarginLeft: '90px' + navigationMarginLeft: '90px', + systemType: '011' }, bxkc: { title: '城市轨道交通实训平台', @@ -176,7 +193,8 @@ export const loginInfo = { linkIcon: Link_Bxkc, loginParam: 'DEFAULT', navigationLogoWidth: '160px', - navigationMarginLeft: '175px' + navigationMarginLeft: '175px', + systemType: '011' }, designbxkc: { title: '城市轨道交通设计平台', @@ -188,7 +206,8 @@ export const loginInfo = { linkIcon: Link_Bxkc, loginParam: 'DEFAULT', navigationLogoWidth: '160px', - navigationMarginLeft: '175px' + navigationMarginLeft: '175px', + systemType: '011' }, crsc: { title: '城市轨道交通实训平台', @@ -201,7 +220,8 @@ export const loginInfo = { titleIcon: Link_Crsc, loginParam: 'DEFAULT', navigationLogoWidth: '100px', - navigationMarginLeft: '125px' + navigationMarginLeft: '125px', + systemType: '011' }, designcrsc: { title: '城市轨道交通设计平台', @@ -214,7 +234,8 @@ export const loginInfo = { titleIcon: Link_Crsc, loginParam: 'DEFAULT', navigationLogoWidth: '100px', - navigationMarginLeft: '125px' + navigationMarginLeft: '125px', + systemType: '011' } }; @@ -249,15 +270,7 @@ export const ProjectCode = { heb: 'HEB', designheb: 'HEB', xadt: 'XADT', - designxadt: 'XADT', - jyd: 'JYD', - designjyd: 'JYD', - tky: 'TKY', - designtky: 'TKY', - bxkc: 'BXKC', - designbxkc: 'BXKC', - crsc: 'CRSC', - designcrsc: 'CRSC' + designxadt: 'XADT' }; export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc']; // 底部栏仅展示公司信息不展示备案号 export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb']; // 实训设计平台通过项目code获取地图列表的项目 diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 59362abc9..3337fb11c 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,5 +1,5 @@ import { publicAsyncRoute, asyncRouter, constantRoutes, user, projectTrain, projectXian, projectXty, projectGzzb, projectJsxt, projectJyd, projectTky, projectHeb, superAdmin, admin, userTrainingPlatform, JSXT, projectRoute } from '@/router/index_APP_TARGET'; -import { PermissionParam } from '@/scripts/ProjectConfig'; +import { loginInfo } from '@/scripts/ProjectConfig'; import { getSessionStorage } from '@/utils/auth'; /** @@ -119,7 +119,7 @@ const permission = { if (roles.includes(admin) && !roles.includes(user)) { // 只拥有管理员 不拥有普通用户权限 则增加用户权限 roles.push(user); } - const routeList = resetAsyncRouter(PermissionParam[getSessionStorage('project') || 'login']); + const routeList = resetAsyncRouter(loginInfo[getSessionStorage('project') || 'login']); const accessedRouters = filterAsyncRouter(routeList, roles); accessedRouters.forEach(route => { diff --git a/src/views/lesson/lessoncategory/edit/chapter/list.vue b/src/views/lesson/lessoncategory/edit/chapter/list.vue index 4e03be9f6..1726a4553 100644 --- a/src/views/lesson/lessoncategory/edit/chapter/list.vue +++ b/src/views/lesson/lessoncategory/edit/chapter/list.vue @@ -175,7 +175,6 @@ export default { }, async loadInitData() { this.trainingTypeList = []; - this.mapIdList = []; getPublishMapListOnline().then(response => { this.mapIdList = response.data; @@ -194,7 +193,8 @@ export default { Station: [], ControlConvertMenu: [], TrainWindow: [], - LimitControl: [] + LimitControl: [], + Driver: [] }; if (res && res.code === 200) { res.data.forEach(item => { @@ -217,12 +217,6 @@ export default { } } else { this.trainingOperateTypeMap = {}; - // this.$Dictionary.trainingType().then(list => { - // this.trainingTypeList = list; - // list.forEach(elem => { - // this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name }); - // }); - // }); this.$Dictionary.stationControl().then(list => { this.trainingOperateTypeMap['01'] = []; // 控制权实训 list.forEach(item => { @@ -293,9 +287,6 @@ export default { if (form && form.type) { form.operateType = ''; this.queryForm.queryObject.operateType.config.data = this.trainingOperateTypeMap[form.type]; - // this.trainingOperateTypeMap[form.type].forEach(elem => { - // this.queryForm.queryObject.operateType.config.data = ; - // }); } }, addObj(index, row) { diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue index de0dd1a72..450fb2f92 100644 --- a/src/views/lesson/trainingmanage/index.vue +++ b/src/views/lesson/trainingmanage/index.vue @@ -212,7 +212,8 @@ export default { Station: [], ControlConvertMenu: [], LimitControl: [], - TrainWindow: [] + TrainWindow: [], + Driver: [] }; if (res && res.code === 200) { res.data.forEach(item => { diff --git a/src/views/newMap/displayNew/demon/runPlanView.vue b/src/views/newMap/displayNew/demon/runPlanView.vue index f90875443..77a913d5f 100644 --- a/src/views/newMap/displayNew/demon/runPlanView.vue +++ b/src/views/newMap/displayNew/demon/runPlanView.vue @@ -1,5 +1,5 @@