From 12198f0c358915cb63a0061cb3298134a4860d2b Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 18 Feb 2020 16:55:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=97=E4=BA=AC=E7=BA=BF=20=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beijing_01/menus/dialog/routeControl.vue | 15 +-- .../menus/dialog/routeSelection.vue | 5 +- .../theme/beijing_01/menus/menuSignal.vue | 94 ++++++++----------- src/scripts/cmdPlugin/Handler.js | 2 +- src/scripts/cmdPlugin/MenuContextHandler.js | 4 - 5 files changed, 47 insertions(+), 73 deletions(-) diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/routeControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/routeControl.vue index 4a63296a5..f5b0aa312 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/routeControl.vue @@ -55,8 +55,7 @@ export default { selected: null, operation: null, stationName: '', - signalName: '', - operateName:'' + signalName: '' }; }, computed: { @@ -70,8 +69,7 @@ export default { return this.dialogShow ? getDomIdByOperation(this.operation) : ''; }, title() { - // if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) { - if (this.operateName == CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE.value) { + if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) { return '取消列车进路'; } else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) { return '信号关灯'; @@ -101,7 +99,6 @@ export default { } } this.operation = operate.operation; - this.operateName = operate.operateName; } this.dialogShow = true; this.$nextTick(function () { @@ -115,8 +112,7 @@ export default { mouseCancelState(this.selected); }, commit() { - // if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) { - if (this.operateName == CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE.value) { + if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) { /** 取消列车进路*/ this.cancelTrainRoute(); } else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) { @@ -141,8 +137,7 @@ export default { cancelTrainRouteFunc() { const operate = { over: true, - operation:this.operation, - // operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, + operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE }; this.loading = true; @@ -203,7 +198,7 @@ export default { operation: OperationEvent.Command.close.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.doClose(); } diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue index 2ac879382..96e1ba6df 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/routeSelection.vue @@ -230,8 +230,7 @@ export default { if (this.row && this.row.canSetting) { const operate = { over: true, - // operation: OperationEvent.Signal.arrangementRoute.menu.operation, - operate:this.operation, + operation: OperationEvent.Signal.arrangementRoute.menu.operation, cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, param: { routeCode: this.row.code @@ -257,7 +256,7 @@ export default { operation: OperationEvent.Command.cancel.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.doClose(); } diff --git a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue index 317056d4a..88f221653 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue @@ -253,64 +253,48 @@ export default { }, // 设置进路 arrangementRoute() { - const command = MenuContextHandler.getCommandByCmdType(CMD.Signal.CMD_SIGNAL_SET_ROUTE); - if (command) { - const operate = { - start: true, - // send: true, - code: this.selected.code, - // type: MapDeviceType.Signal.type, - // label: MapDeviceType.Signal.label, - operation:command.id, - // operation: OperationEvent.Signal.arrangementRoute.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - const routes = []; - this.routeList.forEach(elem => { - if (elem.startSignalCode === this.selected.code) { - routes.push(elem); - } - }); - this.$refs.routeSelection.doShow(operate, this.selected, routes); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - - } else { - this.$refs.noticeInfo.doShow({}, '该指令不存在'); - console.error('该指令不存在,可能是指令字典里面没有该指令,可能是指令每句里面没有该指令'); - } + const operate = { + start: true, + // send: true, + code: this.selected.code, + // type: MapDeviceType.Signal.type, + // label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.arrangementRoute.menu.operation, + param: { + signalCode: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + const routes = []; + this.routeList.forEach(elem => { + if (elem.startSignalCode === this.selected.code) { + routes.push(elem); + } + }); + this.$refs.routeSelection.doShow(operate, this.selected, routes); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); }, // 取消进路 cancelTrainRoute() { - const command = MenuContextHandler.getCommandByCmdType(CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE); - if (command) { - const operate = { - start: true, - code: this.selected.code, - operation:command.id, - operateName:command.operate, - // operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - this.$refs.routeControl.doShow(operate, this.selected); - } - }); - } else { - this.$refs.noticeInfo.doShow({}, '该指令不存在'); - console.error('该指令不存在,可能是指令字典里面没有该指令,可能是指令每句里面没有该指令'); - } + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, + param: { + signalCode: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } + }); }, // // 信号封锁 // lock() { diff --git a/src/scripts/cmdPlugin/Handler.js b/src/scripts/cmdPlugin/Handler.js index 3e73fce60..c8b463cf2 100644 --- a/src/scripts/cmdPlugin/Handler.js +++ b/src/scripts/cmdPlugin/Handler.js @@ -98,7 +98,7 @@ class Handler { const valid = ValidateHandler.vaildate(this.getTrainingMode(), operation); this.afterValid(operation, valid); rtn.valid = valid; - + if (operation.cmdType) { const command = this.getCommand(operation); if (command) { diff --git a/src/scripts/cmdPlugin/MenuContextHandler.js b/src/scripts/cmdPlugin/MenuContextHandler.js index 69c6dc284..246363225 100644 --- a/src/scripts/cmdPlugin/MenuContextHandler.js +++ b/src/scripts/cmdPlugin/MenuContextHandler.js @@ -121,10 +121,6 @@ class MenuContextHandler { return menu; } - getCommandByCmdType(cmdType) { - return CommandHandler.getDefinition(cmdType); - } - menuBarConvert(menu, mode) { if (menu) { if (mode === OperateMode.NORMAL) {