From b0c589cd2a5a0e76fa0bbc9e3019dfc105de238c Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 23 Oct 2019 14:57:45 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=9D=83=E9=99=90=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20=E8=AE=BE=E8=AE=A1=E5=B9=B3=E5=8F=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=B7=B3=E8=BD=AC=E5=AE=9E=E8=AE=AD=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 13 ++++++++++++- src/views/orderauthor/author/draft/edit.vue | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 3e412df3a..3cea96f4a 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -69,6 +69,11 @@ +
+ + 城市轨道交通实训平台 + +
@@ -149,7 +154,13 @@ export default { return true; } return false; - } + }, + goToTraining(){ + let routeData = this.$router.resolve({ + path: "/", + }); + window.open(routeData.href, '_blank'); + } } }; diff --git a/src/views/orderauthor/author/draft/edit.vue b/src/views/orderauthor/author/draft/edit.vue index 9d0d4d970..efb93e0d7 100644 --- a/src/views/orderauthor/author/draft/edit.vue +++ b/src/views/orderauthor/author/draft/edit.vue @@ -11,7 +11,7 @@ size="mini" @submit.native.prevent > - + From 3119f4f3086b721ed693b842e28e47fe2fa9b0fe Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 15:01:25 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=BE=E8=AE=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en/lesson.js | 3 +- src/i18n/langs/zh/lesson.js | 3 +- src/utils/baseUrl.js | 4 +- src/views/approval/lesson/index.vue | 401 ++++++++++++++-------------- src/views/approval/script/index.vue | 333 ++++++++++++----------- src/views/lesson/details.vue | 38 +-- src/views/lesson/home.vue | 21 +- 7 files changed, 401 insertions(+), 402 deletions(-) diff --git a/src/i18n/langs/en/lesson.js b/src/i18n/langs/en/lesson.js index a45bc1097..3a0b71073 100644 --- a/src/i18n/langs/en/lesson.js +++ b/src/i18n/langs/en/lesson.js @@ -118,5 +118,6 @@ export default { rejected: 'Rejected', review: 'Review', explanation: 'Explanation', - courseDetails: 'Course details' + courseDetails: 'Course details', + courseTree: 'Course tree:' }; diff --git a/src/i18n/langs/zh/lesson.js b/src/i18n/langs/zh/lesson.js index 478f007b1..72ede12fb 100644 --- a/src/i18n/langs/zh/lesson.js +++ b/src/i18n/langs/zh/lesson.js @@ -117,6 +117,7 @@ export default { rejected: '已驳回', review: '查看', explanation: '驳回说明', - courseDetails: '课程详情' + courseDetails: '课程详情', + courseTree: '课程树:' }; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 871e8ec9c..f997f31f4 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,8 +3,8 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; - // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 + // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 } else { diff --git a/src/views/approval/lesson/index.vue b/src/views/approval/lesson/index.vue index 3739350cd..86ededc01 100644 --- a/src/views/approval/lesson/index.vue +++ b/src/views/approval/lesson/index.vue @@ -1,214 +1,207 @@ diff --git a/src/views/approval/script/index.vue b/src/views/approval/script/index.vue index b4920e46c..84a3dd5dc 100644 --- a/src/views/approval/script/index.vue +++ b/src/views/approval/script/index.vue @@ -1,173 +1,172 @@ \ No newline at end of file + }, + created() { + }, + mounted() { + this.loadInitData(); + }, + beforeDestroy() { + + }, + methods: { + reloadTable() { + if (this.queryList && this.queryList.reload) { + this.queryList.reload(); + } + }, + goDetail() { + this.$router.push({path: ``}); + }, + async loadInitData() { + try { + // 获取地图 + this.mapList = []; + const res = await listPublishMap(); + this.allMapList=res.data; + res.data.forEach(elem => { + this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name }); + this.mapList.push({ value: elem.id, label: elem.name }); + }); + } catch (error) { + console.error(error, '获取发布地图'); + } + }, + queryFunction(params) { + return reviewScriptList(params); + }, + applyPassed(index, row) { + this.handleConfirmPass(row); + }, + applyReject(index, row) { + this.$refs.applyReject.doShow(row); + }, + scriptPreview(index, row) { + const mapInfo=this.allMapList.find(elem=>{ return elem.id==row.mapId; }); + scriptRecordNotify(row.id).then(resp => { + const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, skinCode: mapInfo.skinCode, try: 0}; + this.$router.push({ path: `${UrlConfig.design.display}/demon`, query }); + launchFullscreen(); + }).catch(error => { + this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`); + }); + }, + handleConfirmReject(data) { + rejectScript(data.id, data).then(resp => { + this.reloadTable(); + this.$message.success(this.$t('approval.rejectScriptSuccess')); + }).catch(error => { + this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`); + }); + } + } +}; + diff --git a/src/views/lesson/details.vue b/src/views/lesson/details.vue index e14bf2f77..2c381e182 100644 --- a/src/views/lesson/details.vue +++ b/src/views/lesson/details.vue @@ -5,22 +5,25 @@
- - - +
+

{{ this.$t('lesson.courseTree') }}

+ + + +
@@ -136,7 +139,8 @@ export default { position: relative; left: 10px; width: 400px; - padding-right: 10px; + padding-right: 20px; + padding-top: 20px; } .right_box{ } diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index 0baad0058..18274454d 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -2,9 +2,9 @@
+ {{ $t('lesson.trainingRule') }} {{ $t('lesson.trainingManage') }} {{ $t('lesson.taskManage') }} - {{ $t('lesson.trainingRule') }} {{ $t('lesson.createNewCoursesFromRelease') }} {{ $t('lesson.newConstruction') }}
@@ -78,6 +78,14 @@ export default { title: this.$t('global.operate'), width: '400', buttons: [ + { + name: this.$t('lesson.courseDetails'), + handleClick: this.goDetail, + type: 'primary', + showControl: (row) => { + return row.status !=='1'; + } + }, { name: this.$t('lesson.contentSorting'), handleClick: this.treeSort, @@ -125,14 +133,6 @@ export default { showControl: (row) => { return row.status ==='1'; } - }, - { - name: this.$t('lesson.courseDetails'), - handleClick: this.goDetail, - type: 'primary', - showControl: (row) => { - return row.status !=='1'; - } } ] } @@ -210,7 +210,7 @@ export default { this.$refs.queryListPage.refresh(true); }, lessonCreate() { - this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode} }); + this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode, mapId: this.$route.params.mapId, cityCode: this.$route.query.cityCode} }); }, lessonCreateByPublish() { this.$nextTick(() => { @@ -227,6 +227,7 @@ export default { this.$message.success(this.$t('tip.successfullyDelete')); this.loading = true; this.refresh(); + this.loading = false; }).catch(() => { this.$messageBox(this.$t('tip.failDelete')); }); From 0b23a7f9a041604126f9ccddf005512bddf7d965 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 23 Oct 2019 16:09:44 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=98=B5=E7=A7=B0=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Entry.vue | 3 ++- src/layout/components/Logout.vue | 6 ++++-- src/layout/components/Navbar.vue | 27 +++++++++++++++++++-------- src/views/approval/runPlan/index.vue | 6 +++--- src/views/approval/script/index.vue | 4 +--- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index 7f6ffa29d..6defc9701 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -1,5 +1,6 @@ - -
- - 城市轨道交通实训平台 - +
+ + +
+ + 城市轨道交通实训平台 + +
+
- @@ -168,6 +171,12 @@ export default { From c83e882f6adf746acdebd61746e72a81cba7e6be Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 17:20:32 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en/error.js | 8 +++++++- src/i18n/langs/en/trainRoom.js | 7 ++++++- src/i18n/langs/zh/error.js | 8 +++++++- src/i18n/langs/zh/trainRoom.js | 7 ++++++- src/views/trainRoom/index.vue | 27 +++++++++++---------------- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/i18n/langs/en/error.js b/src/i18n/langs/en/error.js index a991c67b1..e75e4c0cc 100644 --- a/src/i18n/langs/en/error.js +++ b/src/i18n/langs/en/error.js @@ -94,5 +94,11 @@ export default { getTrainListFailed: 'Failed to get train list', getDraftCourseDataFailed: 'Failed to get draft course data!', failedToGetCourseData: 'Failed to get course data!', - failedToGetSystemData: 'Failed to get system data!' + failedToGetSystemData: 'Failed to get system data!', + inquiryPLCDeviceFailed: 'Inquiry PLC device failed!', + getScreenDoorsListFailed: 'Get the list of screen doors failed!', + theDeviceTypeAlreadyExists: 'The device type already exists!', + connectToRealDeviceFailed: 'Connect to real device failed!', + getRealDeviceListFailed: 'Get real device list failed!', + deleteRealDeviceFailed: 'Delete real device failed!' }; diff --git a/src/i18n/langs/en/trainRoom.js b/src/i18n/langs/en/trainRoom.js index 94a379547..a230a2095 100644 --- a/src/i18n/langs/en/trainRoom.js +++ b/src/i18n/langs/en/trainRoom.js @@ -27,5 +27,10 @@ export default { recording: 'recording...', sendText: 'Send text', left: 'left', - right: 'right' + right: 'right', + realDevice: 'Real device', + plcGatewayOnline: '[PLC gateway online]', + plcGatewayOffline: '[PLC gateway offline]', + uplinkPlatform: 'Uplink platform', + downlinkPlatform: 'Downlink platform' }; diff --git a/src/i18n/langs/zh/error.js b/src/i18n/langs/zh/error.js index cd065c76d..4e1d1387c 100644 --- a/src/i18n/langs/zh/error.js +++ b/src/i18n/langs/zh/error.js @@ -94,5 +94,11 @@ export default { getTrainListFailed: '获取列车列表失败', getDraftCourseDataFailed: '获取草稿课程数据失败!', failedToGetCourseData: '获取课程数据失败!', - failedToGetSystemData: '获取系统数据失败!' + failedToGetSystemData: '获取系统数据失败!', + inquiryPLCDeviceFailed: '查询PLC设备失败!', + getScreenDoorsListFailed: '获取屏蔽门列表失败!', + theDeviceTypeAlreadyExists: '已存在该设备类型!', + connectToRealDeviceFailed: '关联真实设备失败!', + getRealDeviceListFailed: '获取真实设备列表失败!', + deleteRealDeviceFailed: '删除真实设备失败!' }; diff --git a/src/i18n/langs/zh/trainRoom.js b/src/i18n/langs/zh/trainRoom.js index 04c70d8b2..481f9ebf0 100644 --- a/src/i18n/langs/zh/trainRoom.js +++ b/src/i18n/langs/zh/trainRoom.js @@ -27,5 +27,10 @@ export default { recording: '录音中...', sendText: '发送文字', left: '左', - right: '右' + right: '右', + realDevice: '真实设备', + plcGatewayOnline: '[PLC网关在线]', + plcGatewayOffline: '[PLC网关离线]', + uplinkPlatform: '上行站台', + downlinkPlatform: '下行站台' }; diff --git a/src/views/trainRoom/index.vue b/src/views/trainRoom/index.vue index af9db16d8..3bddb02a6 100644 --- a/src/views/trainRoom/index.vue +++ b/src/views/trainRoom/index.vue @@ -174,7 +174,7 @@
-

真实设备-{{ hasPlc?'[PLC网关在线]':'[PLC网关离线]' }}

+

{{ $t('trainRoom.realDevice') }}-{{ hasPlc?$t('trainRoom.plcGatewayOnline'):$t('trainRoom.plcGatewayOffline') }}

  • {{ realDeviceType[nor.deviceType] }} @@ -905,7 +905,7 @@ export default { this.hasPlc = false; } }).catch(() => { - this.$messageBox('查询PLC设备失败!'); + this.$messageBox(this.$t('error.inquiryPLCDeviceFailed')); }); }, handleDoorList(mapId, stationList) { @@ -914,14 +914,14 @@ export default { stationList.forEach(item => { res.data.forEach(it =>{ if (item.code === it.stationCode) { - const direction = parseInt(it.doorLocationType)%2 ===0? '上行站台':'下行站台'; + const direction = parseInt(it.doorLocationType)%2 ===0? this.$t('trainRoom.uplinkPlatform'):this.$t('trainRoom.downlinkPlatform'); doorList.push({code: it.code, name: item.name+direction}); } }); }); this.doorList = doorList; }).catch(() => { - this.$messageBox('获取屏蔽门列表失败!'); + this.$messageBox(this.$t('error.getScreenDoorsListFailed')); }); }, addingDevice() { @@ -933,33 +933,28 @@ export default { } }); if (typeSame) { - this.$message.info('已存在该设备类型!'); + this.$message.info(this.$t('error.theDeviceTypeAlreadyExists')); return; } setRealDevice(this.$route.query.group, roomDeviceVo); }, handleChangeDevice(nor, doorList, stationStandList) { - setRealDevice(this.$route.query.group, nor); - // doorList.forEach(item => { - // item.disabled = false; - // stationStandList.forEach(nor => { - // if (item.code == nor.deviceCode) { - // item.disabled = true; - // } - // }); - // }); + setRealDevice(this.$route.query.group, nor).then(resp => { + }).catch(() => { + this.$messageBox(this.$t('error.connectToRealDeviceFailed')); + }); }, getDevicesList() { getRealDevices(this.$route.query.group).then( resp => { this.stationStandList = resp.data; }).catch(() => { - this.$messageBox('获取真实设备列表失败!'); + this.$messageBox(this.$t('error.getRealDeviceListFailed')); }); }, handleDelDevice(nor) { delRealDevice(nor.id, this.$route.query.group).then( resp => { }).catch(() => { - this.$messageBox('删除真实设备失败!'); + this.$messageBox(this.$t('error.deleteRealDeviceFailed')); }); } } From f483a1c11552dd292068d283610f3594fc92762a Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 23 Oct 2019 17:41:24 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en/approval.js | 3 ++- src/i18n/langs/en/map.js | 2 +- src/i18n/langs/zh/approval.js | 4 ++-- src/views/approval/lesson/index.vue | 8 +++++++- src/views/approval/runPlan/index.vue | 21 ++++++++++++--------- src/views/approval/script/index.vue | 6 ++++++ src/views/designPlatform/demonList.vue | 3 ++- src/views/designPlatform/userDemonList.vue | 3 ++- 8 files changed, 34 insertions(+), 16 deletions(-) diff --git a/src/i18n/langs/en/approval.js b/src/i18n/langs/en/approval.js index 0625695be..682cb4c02 100644 --- a/src/i18n/langs/en/approval.js +++ b/src/i18n/langs/en/approval.js @@ -32,5 +32,6 @@ export default { instructions: 'Instructions', chapterTrainingName: 'Chapter/training name', revokeScriptSuccess: 'Revoke script success', - revokeScriptFailed: 'Revoke script failed' + revokeScriptFailed: 'Revoke script failed', + skin: 'Skin' }; diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index a2ea05ea2..fe71b970d 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -4,7 +4,7 @@ export default { pleaseSelect: 'please choose', pleaseEnter: 'please input', sketchMap: 'Draft map list', - newConstruction: 'create', + newConstruction: 'Create', importMap: 'Import the map', createNewMap: 'A new map', normalCreate: 'The normal to create', diff --git a/src/i18n/langs/zh/approval.js b/src/i18n/langs/zh/approval.js index db8c4db95..59e2c3755 100644 --- a/src/i18n/langs/zh/approval.js +++ b/src/i18n/langs/zh/approval.js @@ -32,6 +32,6 @@ export default { instructions: '说明', chapterTrainingName: '章节/课程名称', revokeScriptSuccess: '撤回成功', - revokeScriptFailed: '撤回失败' - + revokeScriptFailed: '撤回失败', + skin: '皮肤' }; diff --git a/src/views/approval/lesson/index.vue b/src/views/approval/lesson/index.vue index 86ededc01..add4b3089 100644 --- a/src/views/approval/lesson/index.vue +++ b/src/views/approval/lesson/index.vue @@ -89,7 +89,7 @@ export default { { type: 'button', title: this.$t('global.operate'), - width: '250', + width: '400', buttons: [ { name: this.$t('approval.lookOver'), @@ -205,3 +205,9 @@ export default { } }; + diff --git a/src/views/approval/runPlan/index.vue b/src/views/approval/runPlan/index.vue index ec4c44090..74406c6f2 100644 --- a/src/views/approval/runPlan/index.vue +++ b/src/views/approval/runPlan/index.vue @@ -10,7 +10,9 @@ + diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index 098e8b2c1..1fc5738de 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -20,7 +20,8 @@  {{ tnode.label }} + > +  {{ tnode.label }} diff --git a/src/views/designPlatform/userDemonList.vue b/src/views/designPlatform/userDemonList.vue index 0a44a0655..841703216 100644 --- a/src/views/designPlatform/userDemonList.vue +++ b/src/views/designPlatform/userDemonList.vue @@ -17,7 +17,8 @@  {{ tnode.label }} + > +  {{ tnode.label }} From 787580f964406046e14693e314750eddda57a52a Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 17:41:50 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 10 +++++++++- src/views/trainRoom/index.vue | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 9b32b0b26..5199ad88b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -153,6 +153,14 @@ export const userPlan = '015'; // 计划系统 export const userDesign='016'; // 设计系统 const isDev = process.env.NODE_ENV === 'development'; +const design = getSessionStorage('design'); +let redirectPath = ''; +if (design === 'true') { + redirectPath = '/design/home'; +} else { + redirectPath = '/trainingPlatform'; +} + export const UrlConfig = { display: '/display', scriptDisplay: '/scriptDisplay', @@ -315,7 +323,7 @@ export const constantRoutes = [ }, { path: '/', - redirect: '/trainingPlatform', + redirect: redirectPath, hidden: true }, { diff --git a/src/views/trainRoom/index.vue b/src/views/trainRoom/index.vue index 3bddb02a6..6b33f5c9b 100644 --- a/src/views/trainRoom/index.vue +++ b/src/views/trainRoom/index.vue @@ -727,7 +727,11 @@ export default { this.loading = true; await putJointTrainingExit(this.$route.query.group); this.loading = false; - this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}}); + if (this.$route.query.subSystem) { + this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}}); + } else { + this.$router.go(-1); + } } catch (error) { this.messageInfo( this.$t('error.operationFailure'), 'error'); } From 62de921294e5ba699c16c7670eb05b62f38f13f7 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 23 Oct 2019 19:00:35 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Logout.vue | 16 ++++++++-------- src/layout/components/Navbar.vue | 33 ++++++-------------------------- src/permission.js | 13 ++++++++++--- src/router/index.js | 24 +++++++++++------------ src/store/getters.js | 1 + 5 files changed, 37 insertions(+), 50 deletions(-) diff --git a/src/layout/components/Logout.vue b/src/layout/components/Logout.vue index 79b08b345..c212eefcc 100644 --- a/src/layout/components/Logout.vue +++ b/src/layout/components/Logout.vue @@ -34,13 +34,13 @@ export default { data() { return { }; - }, - mounted(){ - }, + }, computed: { username() { return this.$store.state.user.nickname; - }, + } + }, + mounted() { }, methods: { language() { @@ -50,10 +50,10 @@ export default { this.$store.dispatch('LogOut').then(() => { location.reload(); // 为了重新实例化vue-router对象 避免bug }); - }, - selfPermission(){ - this.$router.push({ path: `${UrlConfig.permission.prefix}/manage`}); - } + }, + selfPermission() { + this.$router.push({ path: `${UrlConfig.permission.prefix}/manage`}); + } } }; diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 6dd8b02eb..54949c87f 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -70,8 +70,7 @@
    - -
    +
    城市轨道交通实训平台 @@ -157,13 +156,13 @@ export default { return true; } return false; - }, - goToTraining(){ - let routeData = this.$router.resolve({ - path: "/", + }, + goToTraining() { + const routeData = this.$router.resolve({ + path: '/' }); window.open(routeData.href, '_blank'); - } + } } }; @@ -202,26 +201,6 @@ export default { display: inline-block; position: relative; margin-right:10px; - // position: absolute; - // right: 35px; - - .avatar-wrapper { - cursor: pointer; - position: relative; - - .user-avatar { - width: 40px; - height: 40px; - border-radius: 10px; - } - - .el-icon-caret-bottom { - position: absolute; - right: -20px; - top: 25px; - font-size: 12px; - } - } } } diff --git a/src/permission.js b/src/permission.js index f26e99c7d..f26236303 100644 --- a/src/permission.js +++ b/src/permission.js @@ -5,9 +5,9 @@ import NProgress from 'nprogress'; // Progress 进度条 import 'nprogress/nprogress.css';// Progress 进度条样式 import { admin, userDesign} from './router'; import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权 -// getPlanToken import { LoginParams } from '@/utils/login'; import { getSessionStorage } from '@/utils/auth'; +import localStore from 'storejs'; function hasPermission(roles, permissionRoles) { if (roles.indexOf(admin) >= 0) return true; @@ -29,7 +29,6 @@ function getRouteInfo(to) { let getTokenInfo = () => { }; let clientId = ''; const toRoutePath = to.redirectedFrom || to.path; - if (/^\/dp/.test(toRoutePath) || /^\/display\/dp/.test(toRoutePath)) { loginPath = loginScreenPage; getTokenInfo = getScreenToken; @@ -88,7 +87,15 @@ function handleRoute(to, from, next, routeInfo) { } else { // 除没有动态改变权限的需求可直接next() 删下方权限判断 if (hasPermission(store.getters.roles, to.meta.roles)) { - next(); + if (to.path==='/404' && to.redirectedFrom==='/') { + if (getSessionStorage('design') === 'true') { + next('/design/home'); + } else { + next(localStore.get('trainingPlatformRoute'+store.getters.id) ||'/trainingPlatform'); + } + } else { + next(); + } } else { next({ path: '/401', replace: true, query: { noGoBack: true } }); } diff --git a/src/router/index.js b/src/router/index.js index 5199ad88b..1898707c2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -153,13 +153,13 @@ export const userPlan = '015'; // 计划系统 export const userDesign='016'; // 设计系统 const isDev = process.env.NODE_ENV === 'development'; -const design = getSessionStorage('design'); -let redirectPath = ''; -if (design === 'true') { - redirectPath = '/design/home'; -} else { - redirectPath = '/trainingPlatform'; -} +// const design = getSessionStorage('design'); +// let redirectPath = ''; +// if (design === 'true') { +// redirectPath = '/design/home'; +// } else { +// redirectPath = '/trainingPlatform'; +// } export const UrlConfig = { display: '/display', @@ -321,11 +321,11 @@ export const constantRoutes = [ component: Jlmap3dedit, hidden: true }, - { - path: '/', - redirect: redirectPath, - hidden: true - }, + // { + // path: '/', + // redirect: redirectPath, + // hidden: true + // }, { path: '/401', component: Error401, diff --git a/src/store/getters.js b/src/store/getters.js index 843d1289b..a1071dd74 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -11,6 +11,7 @@ const getters = { roles: state => state.user.roles, canvasWidth: state => state.config.width, canvasHeight: state => state.config.height, + id: state => state.user.id, permission_routes: state => state.permission.routes }; export default getters; From a1761fd2fcfe5858b346b2e78b03bdfabf9e9f0c Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 23 Oct 2019 19:15:02 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E6=B7=BB=E5=8A=A0copyRight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 5 ++++- src/views/designPlatform/home.vue | 2 +- src/views/designPlatform/index.vue | 2 +- src/views/jlmap/index.vue | 3 ++- src/views/planMonitor/detail.vue | 2 +- src/views/scriptManage/home.vue | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/layout/index.vue b/src/layout/index.vue index edf1684bd..d1669aa3d 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -3,6 +3,9 @@
    + + Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号 +
    @@ -37,7 +40,7 @@ export default { return this.$store.state.app.width; }, height() { - return this.$store.state.app.height - 60; + return this.$store.state.app.height - 60-30; } }, created() { diff --git a/src/views/designPlatform/home.vue b/src/views/designPlatform/home.vue index 76c1054a8..d4c5d5fd9 100644 --- a/src/views/designPlatform/home.vue +++ b/src/views/designPlatform/home.vue @@ -44,7 +44,7 @@ }, computed: { height() { - return this.$store.state.app.height - 50; + return this.$store.state.app.height - 50-30; } } }; diff --git a/src/views/designPlatform/index.vue b/src/views/designPlatform/index.vue index 2c903257f..b3e427ad1 100644 --- a/src/views/designPlatform/index.vue +++ b/src/views/designPlatform/index.vue @@ -40,7 +40,7 @@ export default { 'lessonbar' ]), height() { - return this.$store.state.app.height - 50; + return this.$store.state.app.height - 50-30; }, width() { return this.$store.state.app.width; diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue index 3ba5e7984..3ad9b9580 100644 --- a/src/views/jlmap/index.vue +++ b/src/views/jlmap/index.vue @@ -281,7 +281,8 @@ export default { } .zoom-view { - position: fixed; + // position: fixed; + position: absolute; height: 28px; } diff --git a/src/views/planMonitor/detail.vue b/src/views/planMonitor/detail.vue index 3b148e9b8..d6e5dc512 100644 --- a/src/views/planMonitor/detail.vue +++ b/src/views/planMonitor/detail.vue @@ -75,7 +75,7 @@ export default { }, computed: { height() { - return this.$store.state.app.height - 50; + return this.$store.state.app.height - 50-30; }, skinCode() { return this.$route.query.skinCode || '02'; diff --git a/src/views/scriptManage/home.vue b/src/views/scriptManage/home.vue index 661db766e..9d778d905 100644 --- a/src/views/scriptManage/home.vue +++ b/src/views/scriptManage/home.vue @@ -116,7 +116,7 @@ export default { }, computed: { height() { - return this.$store.state.app.height - 50; + return this.$store.state.app.height - 50-30; } }, watch: {