From 146d6c2d0b8e4fc11dbacc0da3cf5f5951d80ffd Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 2 Jul 2020 13:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E9=83=BD=E4=B8=89=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=E7=AB=99=E5=8F=B0=E6=93=8D=E4=BD=9C=E4=BB=A3=E7=A0=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chengdu_03/menus/dialog/standControl.vue | 123 ++++++------------ .../chengdu_03/menus/dialog/standDetail.vue | 12 +- .../newMap/displayNew/demon/faultChoose.vue | 6 +- 3 files changed, 51 insertions(+), 90 deletions(-) diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/standControl.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/standControl.vue index 8ac2a2c68..28cd78eea 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/standControl.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/standControl.vue @@ -22,7 +22,7 @@
范围 @@ -35,6 +35,7 @@ 上行全线 @@ -42,6 +43,7 @@ 下行全线 @@ -235,6 +237,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'StandDetainTrain', @@ -249,6 +252,7 @@ export default { stationName: '', selected: null, operation: null, + isUpDirection:true, radio: '01', radio1: '1', radio2: '1', @@ -270,7 +274,8 @@ export default { }, computed: { ...mapGetters('map', [ - 'map' + 'map', + 'mapConfig' ]), show() { return this.dialogShow && !this.$store.state.menuOperation.break; @@ -381,10 +386,10 @@ export default { this.stationName = ''; this.operation = operate.operation; if (selected) { - this.standName = selected.direction == '01' ? '下行' : '上行'; + this.getDirection(selected); } if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { - this.standName = selected.direction == '01' ? '下行' : '上行'; + this.getDirection(selected); const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); if (station) { this.stationName = station.name; @@ -403,6 +408,15 @@ export default { this.$store.dispatch('training/emitTipFresh'); }); }, + getDirection(selected) { + if (this.mapConfig.upDirection === 'right') { + this.standName = selected.right ? '上行' : '下行'; + this.isUpDirection = selected.right; + } else if (this.mapConfig.upDirection === 'left') { + this.standName = selected.right ? '下行' : '上行'; + this.isUpDirection = !selected.right; + } + }, doClose() { this.loading = false; this.dialogShow = false; @@ -510,94 +524,23 @@ export default { }, // 设置扣车 setDetainTrain() { - const operate = { - over: true, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation, - cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN - }; - - this.loading = true; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - this.loading = false; - this.doClose(); - if (!valid) { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(); - }); + this.sendCommand(menuOperate.StationStand.setDetainTrain); }, // 取消扣车 cancelDetainTrain() { - const operate = { - over: true, - operation: this.operation, - cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, - param: { - standAllLine: `${this.radio}` - } - }; - - this.loading = true; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - this.loading = false; - this.doClose(); - if (!valid) { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(); - }); + if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { + this.sendCommand(menuOperate.StationStand.cancelDetainTrain); + } else { + this.sendCommand(menuOperate.StationStand.cancelDetainTrainAll); + } }, // 设置跳停 setJumpStop() { - const operate = { - over: true, - operation: OperationEvent.StationStand.setJumpStop.menu.operation, - cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, - param: { - trainGroupNumber: `${this.tripNumber}` - } - }; - - this.loading = true; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.doClose(); - } - }).catch(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(); - }); + this.sendCommand(menuOperate.StationStand.setJumpStop, {trainGroupNumber:this.tripNumber}); }, // 取消跳停 cancelJumpStop() { - const operate = { - over: true, - operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, - cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, - param: { - trainGroupNumber: `${this.tripNumber}` - } - }; - - this.loading = true; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.doClose(); - } - }).catch(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(); - }); + this.sendCommand(menuOperate.StationStand.cancelJumpStop, {trainGroupNumber:this.tripNumber}); }, // 设置停站时间 setStopTime() { @@ -647,11 +590,23 @@ export default { this.$refs.noticeInfo.doShow(); }); }, + sendCommand(operate, param) { + this.loading = true; + commitOperate(operate, param, 2).then(({valid})=>{ + this.loading = false; + if (valid) { + this.doClose(); + } + }).catch((error) => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(error.message); + }); + }, cancel() { const operate = { operation: OperationEvent.Command.cancel.menu.operation }; - this.loading = false; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/standDetail.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/standDetail.vue index 0618464fe..7b78857f2 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/standDetail.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/standDetail.vue @@ -114,6 +114,7 @@ export default { }, computed: { ...mapGetters('map', [ + 'mapConfig', 'stationList' ]), show() { @@ -155,7 +156,7 @@ export default { // } // } this.modelData = { - stopTime: selected.parkingTime ? selected.parkingTime : '自动', + stopTime: selected.parkingTime == 0 ? '自动' : `${selected.parkingTime} 秒`, runLevel: this.runLevelList[selected.runLevelTime], detainCar: selected.stationHoldTrain || selected.centerHoldTrain ? '已设置' : '无扣车', jumpStop: selected.allSkip || selected.assignSkip ? '已设置' : '无跳停' @@ -166,8 +167,13 @@ export default { if (!this.dialogShow) { this.standName = ''; this.stationName = ''; + debugger; if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { - this.standName = selected.direction == '01' ? '下行' : '上行'; + if (this.mapConfig.upDirection === 'right') { + this.standName = selected.right ? '上行' : '下行'; + } else if (this.mapConfig.upDirection === 'left') { + this.standName = selected.right ? '下行' : '上行'; + } const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); if (station) { this.stationName = station.name; @@ -187,9 +193,7 @@ export default { }, commit() { const operate = { - // over: true, operation: OperationEvent.Command.close.confirm.operation - // cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS }; this.loading = true; diff --git a/src/views/newMap/displayNew/demon/faultChoose.vue b/src/views/newMap/displayNew/demon/faultChoose.vue index dca67cfda..85cc76a16 100644 --- a/src/views/newMap/displayNew/demon/faultChoose.vue +++ b/src/views/newMap/displayNew/demon/faultChoose.vue @@ -13,7 +13,7 @@
- +
@@ -200,7 +200,9 @@ export default { closeFaultChoose() { this.dialogShow = false; this.isAdd = false; - this.$refs.addFault.resetForm(); + if (this.$refs.addFault) { + this.$refs.addFault.resetForm(); + } }, closeAddRules() { this.isAdd = false;