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; }