From 4275b4dc4a17b225978f6ed36f082ea288577f49 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Wed, 12 Feb 2020 15:14:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menus/dialog/routeSelection.vue | 34 ++++++++++++++----- .../chengdu_03/menus/dialog/routeDetail.vue | 9 +++-- .../chengdu_03/menus/dialog/routeGuide.vue | 9 +++-- .../menus/dialog/routeHandControl.vue | 9 +++-- .../menus/dialog/routeSelection.vue | 9 +++-- .../theme/chengdu_03/menus/menuSection.vue | 28 +++++++-------- .../ningbo_01/menus/dialog/routeSelection.vue | 20 ++++++++--- src/scripts/cmdPlugin/CommandEnum.js | 4 ++- src/store/modules/map.js | 11 +++++- src/utils/loaddata.js | 2 ++ 10 files changed, 98 insertions(+), 37 deletions(-) diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue index 03273c3b8..09f08dc83 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue @@ -66,6 +66,8 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { mouseCancelState } from '../utils/menuItemStatus'; // import ConfirmControl from './childDialog/confirmControl'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; +import { deepAssign } from '@/utils/index'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; export default { name: 'RouteSelection', @@ -184,19 +186,30 @@ export default { this.row = row; if (row) { // 恢复进路区段的切除状态 + this.row.canSetting = true; this.restoreBeforeDevices(); - + const containSectionList = []; if (row.canSetting) { // 设置选中区段为切除状态 - if (row.containSectionList && row.containSectionList.length) { + if (row.routeSectionList && row.routeSectionList.length) { // 设置新选的进路区段为切除状态 - row.containSectionList.forEach(elem => { - elem.cutOff = true; + row.routeSectionList.forEach(elem => { + const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem)); + if (section.logicSectionCodeList && section.logicSectionCodeList.length){ + section.logicSectionCodeList.forEach(item => { + const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item)); + sec.cutOff = true; + containSectionList.push(sec); + }); + } else { + section.cutOff = true; + containSectionList.push(section); + } }); } - this.$store.dispatch('training/updateMapState', [...row.containSectionList]); - this.beforeSectionList = row.containSectionList || []; + this.$store.dispatch('training/updateMapState', [...containSectionList]); + this.beforeSectionList = containSectionList || []; // 设置选中指令 const operate = { @@ -216,9 +229,12 @@ export default { commit() { if (this.row && this.row.canSetting) { const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.arrangementRoute.menu.operation + over: true, + operation: OperationEvent.Signal.arrangementRoute.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, + param: { + routeCode: this.row.code + } }; this.loading = true; diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/routeDetail.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/routeDetail.vue index 75244bc37..26c6d411a 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/routeDetail.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/routeDetail.vue @@ -102,7 +102,8 @@ export default { }, computed: { ...mapGetters('map', [ - 'signalList' + 'signalList', + 'mapConfig' ]), show() { return this.dialogShow && !this.$store.state.menuOperation.break; @@ -155,7 +156,11 @@ export default { return true; } }); - return ''; + if ((signalDirection && this.mapConfig.upDirection === 'right') || (!signalDirection && this.mapConfig.upDirection === 'left')) { + return '上行'; + } else { + return '下行'; + } }, doClose() { this.loading = false; diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/routeGuide.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/routeGuide.vue index 87f6a8e10..ae5842e96 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/routeGuide.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/routeGuide.vue @@ -136,7 +136,8 @@ export default { return disabled; }, ...mapGetters('map', [ - 'signalList' + 'signalList', + 'mapConfig' ]) }, mounted() { @@ -172,7 +173,11 @@ export default { return true; } }); - return ''; + if ((signalDirection && this.mapConfig.upDirection === 'right') || (!signalDirection && this.mapConfig.upDirection === 'left')) { + return '上行'; + } else { + return '下行'; + } }, doShow(operate, selected, tempData) { this.selected = selected; diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/routeHandControl.vue index 4e6f78823..88c67d578 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/routeHandControl.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/routeHandControl.vue @@ -98,7 +98,8 @@ export default { }, computed: { ...mapGetters('map', [ - 'signalList' + 'signalList', + 'mapConfig' ]), show() { return this.dialogShow && !this.$store.state.menuOperation.break; @@ -186,7 +187,11 @@ export default { return true; } }); - return ''; + if ((signalDirection && this.mapConfig.upDirection === 'right') || (!signalDirection && this.mapConfig.upDirection === 'left')) { + return '上行'; + } else { + return '下行'; + } }, doClose() { this.loading = false; diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/routeSelection.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/routeSelection.vue index 5c941ca90..e1c5eda56 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/routeSelection.vue @@ -144,7 +144,8 @@ export default { }, ...mapGetters('map', [ 'signalList', - 'sectionList' + 'sectionList', + 'mapConfig' ]) }, mounted() { @@ -180,7 +181,11 @@ export default { return true; } }); - return ''; + if ((signalDirection && this.mapConfig.upDirection === 'right') || (!signalDirection && this.mapConfig.upDirection === 'left')) { + return '上行'; + } else { + return '下行'; + } }, doShow(operate, selected, tempData) { this.selected = selected; diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSection.vue b/src/jmapNew/theme/chengdu_03/menus/menuSection.vue index d317de275..ae5eda0b5 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSection.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSection.vue @@ -42,31 +42,31 @@ export default { menu: [], menuNormal: { Local: [ - // { - // label: '区故解', - // handler: this.fault, - // disabledCallback: MenuDisabledState.Section.fault, - // auth: { station: true, center: false } - // } + { + label: '区故解', + handler: this.fault, + cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, + auth: { station: true, center: false } + } ], Center: [ { label: '区故解', handler: this.fault, - auth: { station: true, center: false }, + auth: { station: false, center: true }, cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK }, - { - label: '设置临时限速', - handler: this.setSpeed, - auth: { station: false, center: true }, - cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED - }, + // { + // label: '设置临时限速', + // handler: this.setSpeed, + // auth: { station: false, center: true }, + // cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED + // }, { label: '属性', handler: this.detail, auth: { station: false, center: true }, - cmdType:'' + cmdType: CMD.Section.CMD_SECTION_DETAILS } ] }, diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue index 1fa5ea64c..006b95f13 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue @@ -37,6 +37,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import { deepAssign } from '@/utils/index'; export default { name: 'RouteSelection', @@ -154,19 +155,30 @@ export default { this.row = row; if (row) { // 恢复进路区段的切除状态 + this.row.canSetting = true; this.restoreBeforeDevices(); - + const containSectionList = []; if (!row.setting) { // 设置选中区段为切除状态 if (row.routeSectionList && row.routeSectionList.length) { // 设置新选的进路区段为切除状态 row.routeSectionList.forEach(elem => { - elem.cutOff = true; + const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem)); + if (section.logicSectionCodeList && section.logicSectionCodeList.length){ + section.logicSectionCodeList.forEach(item => { + const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item)); + sec.cutOff = true; + containSectionList.push(sec); + }); + } else { + section.cutOff = true; + containSectionList.push(section); + } }); } - this.$store.dispatch('training/updateMapState', [...row.routeSectionList]); - this.beforeSectionList = row.routeSectionList || []; + this.$store.dispatch('training/updateMapState', [...containSectionList]); + this.beforeSectionList = containSectionList || []; // 设置选中指令 const operate = { diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index d5bc064bf..d7e577cd7 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -113,7 +113,9 @@ export default { /** 取消临时限速 */ CMD_SECTION_CANCEL_LIMIT_SPEED:{value:'Section_Cancel_Limit_Speed', label: '取消临时限速'}, /** 确认计轴有效 */ - CMD_SECTION_COMFIRMATION_AXLE:{value:'Section_Comfirmation_Axle', label: '确认计轴有效'} + CMD_SECTION_COMFIRMATION_AXLE:{value:'Section_Comfirmation_Axle', label: '确认计轴有效'}, + /** 详情 */ + CMD_SECTION_DETAILS: {value: 'Section_Details', label: '属性'} }, // 站台 diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 8dd7447c2..daf221424 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -182,6 +182,7 @@ const map = { routeData: {}, // 进路数据 routeList: [], // 进路list stepData: [], // 缓存数据 + mapConfig: [], // 地图所属线路配置 recoverStepData: [], // 缓存恢复数据 seclectDeviceList: [], // 包围框选中元素列表 map: null, // 地图数据 @@ -201,6 +202,9 @@ const map = { mapList: (state) => { return state.mapList; }, + mapConfig: (state) => { + return state.mapConfig; + }, routeList: (state) => { return state.routeList; }, @@ -467,6 +471,9 @@ const map = { state.mapDevice = {}; } }, + setMapConfig: (state, config) => { + state.mapConfig = config; + }, setSeclectDeviceList: (state, list) => { state.seclectDeviceList = list; }, @@ -590,7 +597,9 @@ const map = { setMapData: ({ commit }, map) => { // 设置地图数据 commit('setMapData', map); }, - + setMapConfig: ({ commit }, config) => { // 设置地图所属线路 + commit('setMapConfig', config); + }, setRouteData: ({ commit }, routeData) => { // 设置进路数据 commit('setRouteData', routeData); }, diff --git a/src/utils/loaddata.js b/src/utils/loaddata.js index 667352b7e..f599bab78 100644 --- a/src/utils/loaddata.js +++ b/src/utils/loaddata.js @@ -46,6 +46,8 @@ export function loadNewMapDataByGroup(group) { }); const routeData = resp.data.logicDataNew.routeList; // 设置进路数据 store.dispatch('map/setRouteData', routeData); + const mapConfig = resp.data.configVO; + store.dispatch('map/setMapConfig', mapConfig); }).catch(error => { reject(error); });