From 494e1fc815df26d97a33757bd8530e087afd1fb6 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 13 Mar 2020 15:36:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=97=E4=BA=AC=E4=B8=80=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=20=E7=8E=B0=E5=9C=B0=20=E8=AE=BE=E7=BD=AE=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=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 --- .../theme/beijing_01/menus/menuSignal.vue | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue index a64facb7a..b09861534 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue @@ -47,6 +47,8 @@ export default { data() { return { menu: [], + clickNum:0, + oldSelected:null, menuNormal: { Local: [ // { @@ -206,6 +208,23 @@ export default { switch (buttonOperation) { case OperationEvent.Signal.arrangementRoute.button.operation: { // 进路建立 + if (this.clickNum >= 1) { + let route = null; + this.routeList.forEach(elem => { + if (elem.startSignalCode === this.oldSelected.code && elem.endSignalCode === selectType.code) { + route = elem; + } + }); + if (route) { + this.setRoute(route); + } else { + this.$refs.noticeInfo.doShow({}, `没有以[${this.oldSelected.name}(${this.oldSelected.code})]为始端信号机,以[${selectType.name}(${selectType.code})] 为终端信号机的进路`); + } + this.clickNum = 0; + } else { + this.oldSelected = selectType; + this.clickNum++; + } break; } case OperationEvent.Signal.cancelTrainRoute.button.operation: { @@ -325,6 +344,23 @@ export default { this.$refs.noticeInfo.doShow(operate); }); }, + // 现地设置进路 + setRoute(route) { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Signal.arrangementRoute.menu.operation, + param: { + routeCode: route.code + }, + cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + }).catch((error) => { + this.$refs.noticeInfo.doShow(operate, error.message); + }); + }, // 取消进路 cancelTrainRoute() { const operate = {