From 8db06da732d16fb47885c43833c4015792e64483 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 24 Aug 2020 19:18:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=88=E5=B0=94=E6=BB=A8=E7=BA=BF=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/haerbin_01/menus/menuButton.vue | 62 +++++++++++++++---- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index 104fc5c09..47a401201 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -86,6 +86,9 @@ export default { selectedObj: null, oldClickObj: null, // 上一次点击对象 route: null, // 进路对象 + atpRoute:null, + groundRoute:null, + guideRoute:null, centralizedStationList: new Array(15).fill({}), ciStationParamList: [], // startVirtual: false, @@ -194,14 +197,28 @@ export default { }, clickCommand(row) { this.clearAllMenuShow(); + const setList = ['ATP进路', '联锁进路', '引导进路']; + const cancleList = ['取消ATP', '取消联锁', '取消引导']; + const routeList = [this.atpRoute, this.groundRoute, this.guideRoute]; + const setIndex = setList.indexOf(row.name); + const cancleIndex = cancleList.indexOf(row.name); + let currentIndex = -1; + const step = {}; + if (setIndex >= 0) { currentIndex = setIndex; } + if (cancleIndex >= 0) { currentIndex = cancleIndex; } + if (currentIndex >= 0) { + this.route = routeList[currentIndex]; + this.tempData.push(this.route); + step.param = { + routeCode: this.route.code + }; + } if (this.tempData.length) { row.show = true; this.operate = row.operate.operation; this.cmdType = row.cmdType; this.canCommand = false; - const step = { - operation: this.operate - }; + step.operation = this.operate; this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); @@ -275,24 +292,45 @@ export default { this.centralizedStationList[index] = swicth; }); this.tempData = []; - this.tempData.push(this.route); - this.param = { - routeCode: this.route.code - }; + // this.tempData.push(this.route); + // this.param = { + // routeCode: this.route.code + // }; }, // 校验上次点击信号机 checkSignal() { this.route = null; + this.atpRoute = null; + this.groundRoute = null; + this.guideRoute = null; + this.atp = false; + this.ground = false; + this.guide = false; this.routeList.forEach(item => { if (item.startSignalCode == this.oldClickObj.code && item.endSignalCode == this.selectedObj.code) { - this.atp = item.atp; - this.ground = item.ground; - this.guide = item.guide; - this.route = item; + if (!this.atp) { + if (item.atp) { + this.atpRoute = item; + } + this.atp = item.atp; + } + if (!this.ground) { + if (item.ground) { + this.groundRoute = item; + } + this.ground = item.ground; + } + if (!this.guide) { + if (item.guide) { + this.guideRoute = item; + } + this.guide = item.guide; + } + // this.route = {}; this.initRouteMenus(); } }); - if (this.route && this.route.code) { + if (this.atpRoute || this.groundRoute || this.guideRoute) { this.handleRouteMenu(); this.deviceHighLight(this.selectedObj, true); this.oldDevice = this.selectedObj;