diff --git a/src/components/QrCode/index.vue b/src/components/QrCode/index.vue index f0c4e0b08..91f669e57 100644 --- a/src/components/QrCode/index.vue +++ b/src/components/QrCode/index.vue @@ -3,6 +3,9 @@
+
+ {{ $t('global.roomId')+group }} +
{{ $t('global.close') }} @@ -20,7 +23,8 @@ export default { dialogVisible: false, title: '', loading: false, - url: '' + url: '', + group: '' }; }, methods: { @@ -34,6 +38,7 @@ export default { this.url = data.url; this.title = data.title; this.dialogVisible = true; + this.group = data.group; } }, doClose() { diff --git a/src/i18n/langs/en/global.js b/src/i18n/langs/en/global.js index fa6b46629..3a5c54020 100644 --- a/src/i18n/langs/en/global.js +++ b/src/i18n/langs/en/global.js @@ -205,5 +205,6 @@ export default { buyingTips: 'Function upgrade, stay tuned!', permissionAllNum:'Total permissions', set: 'Set', - joinNewRoom: 'Join new room' + joinNewRoom: 'Join new room', + roomId: 'RoomId:' }; diff --git a/src/i18n/langs/zh/global.js b/src/i18n/langs/zh/global.js index 42635d258..cef890583 100644 --- a/src/i18n/langs/zh/global.js +++ b/src/i18n/langs/zh/global.js @@ -205,5 +205,6 @@ export default { buyingTips: '功能升级中, 敬请期待!', permissionAllNum:'权限总数', set: '设 置', - joinNewRoom: '加入新房间' + joinNewRoom: '加入新房间', + roomId: '房间号:' }; diff --git a/src/jmapNew/theme/beijing_01/menus/menuSection.vue b/src/jmapNew/theme/beijing_01/menus/menuSection.vue index fe2931434..07d648269 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSection.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSection.vue @@ -189,7 +189,8 @@ export default { }, // 切除 split() { - commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code; + commitOperate(menuOperate.Section.split, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{ if (valid) { this.$refs.sectionControl.doShow(operate, this.selected); } @@ -204,7 +205,8 @@ export default { }, // 激活 active() { - commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code; + commitOperate(menuOperate.Section.active, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{ if (valid) { this.$refs.sectionControl.doShow(operate, this.selected); } @@ -226,7 +228,8 @@ export default { // }, // 设置速度 setSpeed() { - commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code; + commitOperate(menuOperate.Section.setSpeed, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{ if (valid) { this.$refs.speedLimitControl.doShow(operate, this.selected); } diff --git a/src/jmapNew/theme/factory.js b/src/jmapNew/theme/factory.js index f92e38ab0..661112890 100644 --- a/src/jmapNew/theme/factory.js +++ b/src/jmapNew/theme/factory.js @@ -2,8 +2,8 @@ class Theme { constructor(code) { this._code = '02'; this._mapMenu = { - // '01': 'chengdu_01', - '01': 'xian_02', + '01': 'chengdu_01', + // '01': 'xian_02', '02': 'fuzhou_01', '03': 'beijing_01', '04': 'chengdu_03', diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index c3b909c87..ac6aeac70 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -166,7 +166,8 @@ export default { }, // 切除 split() { - commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code; + commitOperate(menuOperate.Section.split, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{ if (valid) { this.$refs.sectionControl.doShow(operate, this.selected); } @@ -182,7 +183,8 @@ export default { }, // 区段激活 active() { - commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code; + commitOperate(menuOperate.Section.active, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{ if (valid) { this.$refs.sectionControl.doShow(operate, this.selected); } @@ -206,7 +208,8 @@ export default { }, // 设置速度 setSpeed() { - commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ + const sectionCode = this.selected.parentCode ? this.selected.parentCode : this.selected.code; + commitOperate(menuOperate.Section.setSpeed, {sectionCode:sectionCode}, 0).then(({valid, operate})=>{ if (valid) { this.$refs.speedLimitControl.doShow(operate, this.selected); } diff --git a/src/permission.js b/src/permission.js index be1e8f186..3d3c9b496 100644 --- a/src/permission.js +++ b/src/permission.js @@ -1,6 +1,7 @@ import Vue from 'vue'; import store from '@/store/index_APP_TARGET'; import router from './router/index_APP_TARGET'; +import {PermissionParam} from '@/scripts/ProjectConfig'; import NProgress from 'nprogress'; import { admin} from './router/index_APP_TARGET'; import { getToken, removeToken} from '@/utils/auth'; @@ -14,7 +15,7 @@ function hasPermission(roles, permissionRoles) { return roles.some(role => permissionRoles.indexOf(role) >= 0); } -const whiteList = ['/login', '/design/login', '/xty/login', '/designxty/login', '/gzb/login', '/designgzb/login', '/gzzbxy/relay', '/xadt/login', '/designxadt/login']; // 不重定向白名单 +const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向白名单 const designPageRegex = [/^\/design/, /^\/scriptDisplay/, /^\/publish/, /^\/orderauthor/, /^\/system/, /^\/iscs/, /^\/display\/record/, /^\/display\/manage/, /^\/apply/, /^\/plan/, /^\/display\/plan/, /^\/displayNew\/record/, /^\/displayNew\/manage/, /^\/displayNew\/plan/]; @@ -23,61 +24,35 @@ function isDesignPage(toRoutePath) { return item.test(toRoutePath); }); } - +for (const val in PermissionParam) { + whiteList.push(PermissionParam[val].whitePage); +} const loginPage = whiteList[0]; const loginDesignPage = whiteList[1]; -const loginXtyPage = whiteList[2]; -const loginDesignXtyPage = whiteList[3]; -const loginGzbPage = whiteList[4]; -const loginDesignGzbPage = whiteList[5]; -const loginXasPage = whiteList[7]; -const loginDesignXasPage = whiteList[8]; -const loginDesignPageMenu = { - design: loginDesignPage, - designxty: loginDesignXtyPage, - designgzb: loginDesignGzbPage, - designhyd: loginDesignPage, - designxadt: loginDesignXasPage -}; -const loginPageMenu = { - login: loginPage, - xty: loginXtyPage, - gzb: loginGzbPage, - hyd: loginPage, - xadt: loginXasPage -}; + // 获取路径数据 function getRouteInfo(to) { - let loginPath = '/login'; + let loginPath = ''; let clientId = ''; const toRoutePath = to.redirectedFrom || to.path; const current_session = getSessionStorage('project'); - if (/^\/designxty/.test(toRoutePath)) { - loginPath = loginDesignXtyPage; - clientId = LoginParams.Design.clientId; - } else if (/^\/designxadt/.test(toRoutePath)) { - loginPath = loginDesignXasPage; - clientId = LoginParams.Design.clientId; - } else if (/^\/designgzb/.test(toRoutePath)) { - loginPath = loginDesignGzbPage; - clientId = LoginParams.Design.clientId; - } else if (isDesignPage(toRoutePath)) { - loginPath = loginDesignPageMenu[current_session] || loginDesignPage; + for (const val in PermissionParam) { + if (PermissionParam[val].reg.test(toRoutePath)) { + loginPath = PermissionParam[val].whitePage; + clientId = PermissionParam[val].clientId; + break; + } + } + if (isDesignPage(toRoutePath)) { + const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; + loginPath = whitePage || loginDesignPage; clientId = LoginParams.Design.clientId; if (current_session && !current_session.startsWith('design')) { removeToken(); } - } else if ( /^\/xty/.test(toRoutePath)) { - loginPath = loginXtyPage; - clientId = null; - } else if ( /^\/gzb/.test(toRoutePath)) { - loginPath = loginGzbPage; - clientId = null; - } else if ( /^\/xadt/.test(toRoutePath)) { - loginPath = loginXasPage; - clientId = null; } else { - loginPath = loginPageMenu[current_session] || loginPath; + const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; + loginPath = whitePage || loginPage; clientId = null; if (current_session && current_session.startsWith('design')) { removeToken(); @@ -143,7 +118,7 @@ router.beforeEach((to, from, next) => { if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入 next(); - } else if (to.path.substr(0, 13) == whiteList[6]) { + } else if (to.path.substr(0, 13) == whiteList[2]) { next(); } else { // 否则全部重定向到登录页 diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index a3c4f0461..43ad16fd3 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -4,8 +4,9 @@ import FaviconXty from '@/assets/icon/favicon_xty.png'; import FaviconGzb from '@/assets/icon/favicon_gzb.png'; import FaviconHyd from '@/assets/icon/favicon_hyd.png'; import FaviconXadt from '@/assets/icon/favicon_xas.png'; +import { LoginParams } from '@/utils/login'; -export const loginInfo = { +export const loginInfo = { // 页面title & 退出登录跳转路径 xty: { title: '西安铁路职业技术学院城市轨道交通实训平台', loginPath: '/xty/login' @@ -73,8 +74,8 @@ export const ProjectCode = { }; export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt']; // 实训设计平台通过项目code获取地图列表的项目 export const CaseHideProjectList = ['hyd', 'designhyd']; // 案例展示隐藏的项目 -export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt'];// 需要在公共路由中生成登录页面的项目 -export const goOtherPlatformMenu = { +export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt'];// 需要在公共路由中生成登录页面的项目&登录页样式 +export const goOtherPlatformMenu = { // 导航栏快速切换平台 login: '/design/login', design: '/login', xty: '/designxty/login', @@ -86,3 +87,40 @@ export const goOtherPlatformMenu = { xadt: '/designxadt/login', designxadt: '/xadt/login' }; +export const PermissionParam = { // 路径权限处理所需参数配置(跳转白名单&路径正则匹配&clientId) + designxty: { + whitePage: '/designxty/login', + reg: /^\/designxty/, + clientId: LoginParams.Design.clientId + }, + designgzb: { + whitePage: '/designgzb/login', + reg: /^\/designgzb/, + clientId: LoginParams.Design.clientId + }, + designxadt: { + whitePage: '/designxadt/login', + reg: /^\/designxadt/, + clientId: LoginParams.Design.clientId + }, + xty: { + whitePage: '/xty/login', + reg: /^\/xty/, + clientId: null + }, + gzb: { + whitePage: '/gzb/login', + reg: /^\/gzb/, + clientId: null + }, + xadt: { + whitePage: '/xadt/login', + reg: /^\/xadt/, + clientId: null + } +}; +export const ProjectList = [ + {value:'xty', label:'西铁院'}, + {value: 'gzb', label: '贵州装备'}, + {value: 'xadt', label: '西安地铁'} +]; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 73e8c2cbc..9b16d630d 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -103,7 +103,7 @@ import { getLoginWmurl, checkLoginStatus } from '@/api/login'; import { LoginParams } from '@/utils/login'; import bgImg from '@/assets/bg1.jpg'; import { UrlConfig } from '@/scripts/ConstDic'; -import { loginInfo, ProjectIcon} from '@/scripts/ProjectConfig'; +import { loginInfo, ProjectIcon, GenerateRouteProjectList} from '@/scripts/ProjectConfig'; import { removeToken } from '@/utils/auth'; import LangStorage from '@/utils/lang'; import FloatPart from './floatPart'; @@ -167,7 +167,7 @@ export default { }, isProject() { const projectName = this.$route.path.split('/')[1]; - return projectName.endsWith('xty') || projectName.endsWith('gzb') || projectName.endsWith('hyd') || projectName.endsWith('xadt'); + return GenerateRouteProjectList.includes(projectName); }, logoImg() { const projectName = this.$route.path.split('/')[1]; diff --git a/src/views/newMap/newDesignUser/mapmanage/mapImport.vue b/src/views/newMap/newDesignUser/mapmanage/mapImport.vue index 724233465..46d998f0c 100644 --- a/src/views/newMap/newDesignUser/mapmanage/mapImport.vue +++ b/src/views/newMap/newDesignUser/mapmanage/mapImport.vue @@ -64,25 +64,26 @@ export default { // this.validateText = this.$t('rules.pleaseEnterMapName'); return false; } - // const loading = this.$loading({ - // lock: true, - // text: '正在导入中...', - // spinner: 'el-icon-loading', - // background: 'rgba(0, 0, 0, 0.7)' - // }); + const loading = this.$loading({ + lock: true, + text: '正在导入中...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); const that = this; that.loading = true; this.jsonData.name = this.editModel.name; + this.dialogShow = false; + this.validateText = ''; postBuildMapImport(this.jsonData).then(res => { - // loading.close(); + loading.close(); that.loading = false; that.$message.success('导入成功!'); - // that.loadInitData(); this.$emit('loadInitData'); // loading.close(); this.close(); }).catch(error => { - // loading.close(); + loading.close(); that.loading = false; this.close(); that.$message.error('导入失败' + error.message); diff --git a/src/views/system/systemGenerate/create.vue b/src/views/system/systemGenerate/create.vue index 21d7b898b..d469e0b3e 100644 --- a/src/views/system/systemGenerate/create.vue +++ b/src/views/system/systemGenerate/create.vue @@ -11,6 +11,7 @@