From aa93cfc25032919e44fb0592db29813e4dca57a1 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 16 Mar 2020 17:54:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=8E=B0=E5=9C=B0=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/chengdu_03/menus/menuButton.vue | 24 +++++++++++++++---- src/utils/mapList.js | 12 +++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue index b26494d27..e1adfb013 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue @@ -111,7 +111,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import Handler from '@/scripts/cmdPlugin/Handler'; -// import { deepAssign } from '@/utils/index'; +import { getAutoReentryBySignalCode } from '@/utils/index'; import PasswordBox from './dialog/childDialog/passwordInputBox.vue'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; @@ -144,7 +144,8 @@ export default { 'routeList', 'routeData', 'signalList', - 'autoReentryList' + 'autoReentryList', + 'autoReentryData' ]), Switch() { return OperationEvent.Switch; @@ -355,6 +356,10 @@ export default { } else if (model._type === 'MapCycleButtonVO' ) { operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK; operate.param = {cycleCode: model.cycleCode}; + } else if (model._type === 'AutomaticRoute') { + const route = this.routeData[model.automaticRouteCode]; + operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_CI_AUTO; + operate.param = {signalCode: route.startSignalCode}; } this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}); console.log(operate); @@ -367,11 +372,22 @@ export default { param: {} }; if (model._type === 'Signal') { - operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE; - operate.param = {signalCode: model.code}; + const autoReentry = getAutoReentryBySignalCode(model.code, this.routeList, this.autoReentryList); + const autoReentryRel = this.autoReentryData[autoReentry.code]; + if (autoReentryRel.open) { + operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK; + operate.param = {cycleCode: model.cycleCode, cancelRoute: true}; + } else { + operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE; + operate.param = {signalCode: model.code}; + } } else if (model._type === 'MapCycleButtonVO') { operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK; operate.param = {cycleCode: model.cycleCode, cancelRoute: false}; + } else if (model._type === 'AutomaticRoute') { + const route = this.routeData[model.automaticRouteCode]; + operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO; + operate.param = {signalCode: route.startSignalCode}; } this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}); console.log(operate); diff --git a/src/utils/mapList.js b/src/utils/mapList.js index e226d92bf..e6288eaae 100644 --- a/src/utils/mapList.js +++ b/src/utils/mapList.js @@ -14,7 +14,17 @@ export async function getMapListByProject(drawWay) { } export function getAutoReentryBySignalCode(signalCode, routeList, autoReentryList) { // 根据折返进路的始端信号机去找 + let route = ''; + let autoReentry = ''; routeList.forEach(item => { - + if (item.startSignalCode === signalCode && item.turnBack) { + route = item; + } }); + autoReentryList.forEach(item => { + if (item.turnBackRouteCode === route.code || item.turnBackRoute2Code === route.code) { + autoReentry = item; + } + }); + return autoReentry; }