diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/allocateTime.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/allocateTime.vue index 558c8172c..5e332ad2f 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/allocateTime.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/allocateTime.vue @@ -80,10 +80,10 @@ - 确定(O) + 确定(O) - 应用(A) + 应用(A) 关闭(C) @@ -169,11 +169,14 @@ export default { this.$refs.singleTable.setCurrentRow(); this.$store.dispatch('training/emitTipFresh'); }, - commit() { + commit(isClose = false) { commitOperate(menuOperate.StationStand.setStopTime, {standCode: this.selected.code, parkingTime: this.currentTime, parkingAlwaysValid: false}, 3).then(({valid})=>{ if (valid) { - this.doClose(); + isClose && this.doClose(); } + }).catch(_ => { + isClose && this.doClose(); + this.$refs.noticeInfo.doShow(); }); }, handleCurrentChange(val) { diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/standControl.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/standControl.vue index 4dc690a32..5826038c5 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/standControl.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/standControl.vue @@ -130,6 +130,7 @@ export default { isClose && this.doClose(); } }).catch((error) => { + console.log(error); isClose && this.doClose(); this.$refs.noticeInfo.doShow(); }); diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchCommand.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchCommand.vue index c35e3ab21..5c6554d34 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchCommand.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchCommand.vue @@ -134,27 +134,27 @@ export default { this.$refs.singleTable.setCurrentRow(); this.$store.dispatch('training/emitTipFresh'); }, - commit(isClose=false) { - const cmd = { - normal: menuOperate.Switch.locate, - reverse: menuOperate.Switch.reverse - }[this.position]; + commit(isClose = false) { + const cmd = { + normal: menuOperate.Switch.locate, + reverse: menuOperate.Switch.reverse + }[this.position]; - if (cmd) { - commitOperate(cmd, {switchCode: this.selected.code}, 3).then(({valid})=>{ - if (valid) { - isClose && this.doClose(); - } - }).catch(error => { - isClose && this.doClose(); - this.$refs.noticeInfo.doShow(); - }) - } else { - this.$message.info('未知指令'); - } + if (cmd) { + commitOperate(cmd, {switchCode: this.selected.code}, 3).then(({valid})=>{ + if (valid) { + isClose && this.doClose(); + } + }).catch(_ => { + isClose && this.doClose(); + this.$refs.noticeInfo.doShow(); + }); + } else { + this.$message.info('未知指令'); + } }, handleCurrentChange(val) { - if (!val) { return; } + if (!val) { return; } commitOperate(menuOperate.Switch.turnout, {code:val.code}).then(({valid, operate})=>{ if (valid) { const switchEle = this.$store.getters['map/getDeviceByCode'](val.code); diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 5345787f7..2bb719929 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -642,13 +642,16 @@ const map = { mutations: { // 改变地图数据索引 flushMapRef: (state) => { - state.map.sectionList = [...state.map.sectionList]; - state.map.switchList = [...state.map.switchList]; - state.map.signalList = [...state.map.signalList]; - state.map.stationList = [...state.map.stationList]; - state.map.stationStandList = [...state.map.stationStandList]; - state.map.trainList = [...state.map.trainList]; - state.map.trainWindowList = [...state.map.trainWindowList]; + if (state.map) { + state.map.sectionList = [...state.map.sectionList || []]; + state.map.switchList = [...state.map.switchList || []]; + state.map.signalList = [...state.map.signalList || []]; + state.map.stationList = [...state.map.stationList || []]; + state.map.standList = [...state.map.standList || []]; + state.map.stationStandList = [...state.map.stationStandList || []]; + state.map.trainList = [...state.map.trainList || []]; + state.map.trainWindowList = [...state.map.trainWindowList || []]; + } }, // 设置地图数据 setMapData: (state, map) => {