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 = {