|
|
|
@ -1,79 +1,79 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div v-if="isShowBtn" class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }">
|
|
|
|
|
<button :id="Signal.arrangementRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.arrangementRoute.button.operation, 'MixinCommand')">
|
|
|
|
|
<button :id="Signal.arrangementRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.arrangementRoute.button.operation, ['Signal'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>排</b><b>列</b></center>
|
|
|
|
|
<center><b>进</b><b>路</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="MixinCommand.totalCancel.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.totalCancel.button.operation, 'Signal')">
|
|
|
|
|
<button :id="MixinCommand.totalCancel.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.totalCancel.button.operation, ['Signal','AutoTurnBack','AutomaticRoute'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>总</b></center>
|
|
|
|
|
<center><b>取</b><b>消</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Signal.guide.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.guide.button.operation, 'Signal')">
|
|
|
|
|
<button :id="Signal.guide.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.guide.button.operation, ['Signal'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>引</b><b>导</b></center>
|
|
|
|
|
<center><b>进</b><b>路</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<!-- 流程未做暂不显示 -->
|
|
|
|
|
<button :id="Station.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Station.guideLock.button.operation)">
|
|
|
|
|
<button :id="Station.guideLock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Station.guideLock.button.operation, ['GuideLock'])">
|
|
|
|
|
<span style="color: #800000">
|
|
|
|
|
<center><b>引</b><b>导</b></center>
|
|
|
|
|
<center><b>总</b><b>锁</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, 'Signal')">
|
|
|
|
|
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanTrainRoute.button.operation, ['Signal'])">
|
|
|
|
|
<span style="color: #800000">
|
|
|
|
|
<center><b>总</b></center>
|
|
|
|
|
<center><b>人</b><b>解</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Section.fault.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Section.fault.button.operation, 'Section')">
|
|
|
|
|
<button :id="Section.fault.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Section.fault.button.operation, ['Section'])">
|
|
|
|
|
<span style="color: #800000">
|
|
|
|
|
<center><b>区</b></center>
|
|
|
|
|
<center><b>故</b><b>解</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Switch.locate.button.domId" class="button_box" :style="{width: width+'px',backgroundColor:buttonUpColor}" @click="buttonDown(Switch.locate.button.operation, 'Switch')">
|
|
|
|
|
<button :id="Switch.locate.button.domId" class="button_box" :style="{width: width+'px',backgroundColor:buttonUpColor}" @click="buttonDown(Switch.locate.button.operation, ['Switch'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>道</b><b>岔</b></center>
|
|
|
|
|
<center><b>定</b><b>操</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Switch.reverse.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.reverse.button.operation, 'Switch')">
|
|
|
|
|
<button :id="Switch.reverse.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.reverse.button.operation, ['Switch'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>道</b><b>岔</b></center>
|
|
|
|
|
<center><b>反</b><b>操</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Switch.lock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.lock.button.operation, 'Switch')">
|
|
|
|
|
<button :id="Switch.lock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.lock.button.operation, ['Switch'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>道</b><b>岔</b></center>
|
|
|
|
|
<center><b>单</b><b>锁</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Switch.unlock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.unlock.button.operation, 'Switch')">
|
|
|
|
|
<button :id="Switch.unlock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Switch.unlock.button.operation, ['Switch'])">
|
|
|
|
|
<span style="color: #800000">
|
|
|
|
|
<center><b>道</b><b>岔</b></center>
|
|
|
|
|
<center><b>解</b><b>锁</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="MixinCommand.block.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.block.button.operation, 'MixinCommand')">
|
|
|
|
|
<button :id="MixinCommand.block.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.block.button.operation, ['Switch', 'Signal'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>封</b></center>
|
|
|
|
|
<center><b>锁</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="MixinCommand.unblock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.unblock.button.operation, 'MixinCommand')">
|
|
|
|
|
<button :id="MixinCommand.unblock.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.unblock.button.operation, ['Switch', 'Signal'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>解</b></center>
|
|
|
|
|
<center><b>封</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="MixinCommand.functionButton.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.functionButton.button.operation, 'MixinCommand')">
|
|
|
|
|
<button :id="MixinCommand.functionButton.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.functionButton.button.operation, ['StationStand', 'AutoTurnBack', 'AutomaticRoute'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center>
|
|
|
|
|
<b style="color:#4B4B99">功</b>
|
|
|
|
@ -85,13 +85,13 @@
|
|
|
|
|
</center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Signal.atsAutoControl.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.atsAutoControl.button.operation, 'Signal')">
|
|
|
|
|
<button :id="Signal.atsAutoControl.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.atsAutoControl.button.operation, ['Signal'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>自</b></center>
|
|
|
|
|
<center><b>动</b><b>控</b></center>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button :id="Signal.humanControl.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanControl.button.operation, 'Signal')">
|
|
|
|
|
<button :id="Signal.humanControl.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(Signal.humanControl.button.operation, ['Signal'])">
|
|
|
|
|
<span style="color: black">
|
|
|
|
|
<center><b>人</b></center>
|
|
|
|
|
<center><b>工</b><b>控</b></center>
|
|
|
|
@ -104,6 +104,7 @@
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<password-box ref="password" @checkOver="passWordCommit" />
|
|
|
|
|
<notice-info ref="noticeInfo" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -111,15 +112,17 @@
|
|
|
|
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
|
|
|
|
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
|
|
|
|
import Handler from '@/scripts/cmdPlugin/Handler';
|
|
|
|
|
import { getAutoReentryBySignalCode } from '@/utils/index';
|
|
|
|
|
import { getAutoReentryBySignalCode } from '@/utils/mapList';
|
|
|
|
|
import PasswordBox from './dialog/childDialog/passwordInputBox.vue';
|
|
|
|
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
|
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'MapButtonMenu',
|
|
|
|
|
components: {
|
|
|
|
|
PasswordBox
|
|
|
|
|
PasswordBox,
|
|
|
|
|
NoticeInfo
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -134,7 +137,7 @@ export default {
|
|
|
|
|
width: 58,
|
|
|
|
|
tempData: null,
|
|
|
|
|
offset: {},
|
|
|
|
|
commandType: '',
|
|
|
|
|
commandTypeList: [],
|
|
|
|
|
cmdTypeList: [],
|
|
|
|
|
deviceList: []
|
|
|
|
|
};
|
|
|
|
@ -177,8 +180,10 @@ export default {
|
|
|
|
|
return CMD.Switch.CMD_SWITCH_SINGLE_LOCK;
|
|
|
|
|
case this.Switch.unlock.button.operation: // 道岔解锁
|
|
|
|
|
return CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK;
|
|
|
|
|
case this.Switch.locate.button.operation || this.Switch.reverse.button.operation: // 道岔定位/反位
|
|
|
|
|
return CMD.Switch.CMD_SWITCH_TURN;
|
|
|
|
|
case this.Switch.locate.button.operation: // 道岔定位
|
|
|
|
|
return CMD.Switch.CMD_SWITCH_NORMAL_POSITION;
|
|
|
|
|
case this.Switch.reverse.button.operation: // 道岔反位
|
|
|
|
|
return CMD.Switch.CMD_SWITCH_REVERSE_POSITION;
|
|
|
|
|
case this.MixinCommand.block.button.operation: // 封锁
|
|
|
|
|
return {};
|
|
|
|
|
case this.MixinCommand.unblock.button.operation: // 解封
|
|
|
|
@ -190,15 +195,15 @@ export default {
|
|
|
|
|
case this.Section.fault.button.operation: // 区故解
|
|
|
|
|
return CMD.Section.CMD_SECTION_FAULT_UNLOCK;
|
|
|
|
|
case this.Signal.humanTrainRoute.button.operation: // 总人解 (取消引导进路)
|
|
|
|
|
return CMD.Section.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
|
|
|
|
|
case this.Signal.cancelTrainRoute.button.operation: // 总取消
|
|
|
|
|
return CMD.Section.CMD_SIGNAL_CANCEL_ROUTE;
|
|
|
|
|
return CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
|
|
|
|
|
case this.Signal.arrangementRoute.button.operation: // 排列进路
|
|
|
|
|
return CMD.Signal.CMD_SIGNAL_SET_ROUTE;
|
|
|
|
|
case this.Signal.guide.button.operation: // 引导进路
|
|
|
|
|
return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
|
|
|
|
|
case this.Signal.reopenSignal.button.operation:
|
|
|
|
|
return CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
|
|
|
|
|
case this.Station.guideLock.button.operation:
|
|
|
|
|
return CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK;
|
|
|
|
|
}
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
@ -223,10 +228,13 @@ export default {
|
|
|
|
|
type: 'mbm',
|
|
|
|
|
operation: data.operateNext
|
|
|
|
|
};
|
|
|
|
|
this.trainingOperation(operate);
|
|
|
|
|
},
|
|
|
|
|
// 执行操作
|
|
|
|
|
trainingOperation(operate) {
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$refs.noticeInfo.doShow(operate);
|
|
|
|
@ -262,33 +270,21 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
buttonDown(operation, commandType) {
|
|
|
|
|
buttonDown(operation, commandTypeList) {
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
if (operation != this.Command.cancel.clearMbm.operation) {
|
|
|
|
|
const operate = {
|
|
|
|
|
type: 'mbm',
|
|
|
|
|
operation: operation
|
|
|
|
|
};
|
|
|
|
|
const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation, this.Switch.unlock.button.operation, this.MixinCommand.unblock.button.operation];
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.operation = operation;
|
|
|
|
|
this.commandType = commandType;
|
|
|
|
|
if (this.commandType == 'MixinCommand') {
|
|
|
|
|
this.cmdTypeList = ['Switch', 'Signal'];
|
|
|
|
|
} else {
|
|
|
|
|
this.cmdTypeList = [commandType];
|
|
|
|
|
}
|
|
|
|
|
this.commandTypeList = commandTypeList;
|
|
|
|
|
this.$store.dispatch('menuOperation/setButtonOperation', operation); // 按钮菜单是否被按下
|
|
|
|
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
|
|
|
if (operation == this.Signal.humanTrainRoute.button.operation) { // 总人解操作 显示密码窗
|
|
|
|
|
operate['operateNext'] = this.Command.close.password.operation;
|
|
|
|
|
this.$refs.password.doShow(operate);
|
|
|
|
|
} else if (operation == this.Section.fault.button.operation) { // 区故解操作 显示密码窗
|
|
|
|
|
operate['operateNext'] = this.Command.close.password.operation;
|
|
|
|
|
this.$refs.password.doShow(operate);
|
|
|
|
|
} else if (operation == this.Switch.unlock.button.operation) { // 道岔解锁操作 显示密码窗
|
|
|
|
|
operate['operateNext'] = this.Command.close.password.operation;
|
|
|
|
|
this.$refs.password.doShow(operate);
|
|
|
|
|
} else if (operation == this.MixinCommand.unblock.button.operation) { // 解封操作 显示密码窗
|
|
|
|
|
if (operationList.includes(operation)) {
|
|
|
|
|
operate['operateNext'] = this.Command.close.password.operation;
|
|
|
|
|
this.$refs.password.doShow(operate);
|
|
|
|
|
}
|
|
|
|
@ -303,7 +299,7 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.commandType = '';
|
|
|
|
|
this.commandTypeList = [];
|
|
|
|
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
|
|
|
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
|
|
|
Handler.clear(); // 清空操作组
|
|
|
|
@ -313,6 +309,12 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
arrangementRouteOperation(deviceList) {
|
|
|
|
|
const routes = [];
|
|
|
|
|
const operate = {
|
|
|
|
|
send: true,
|
|
|
|
|
operation: this.$store.state.menuOperation.buttonOperation,
|
|
|
|
|
cmdType: '',
|
|
|
|
|
param: ''
|
|
|
|
|
};
|
|
|
|
|
let isArrangementRoute = false;
|
|
|
|
|
if (deviceList.length === 1) {
|
|
|
|
|
this.routeList.forEach(item => {
|
|
|
|
@ -325,19 +327,17 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].code);
|
|
|
|
|
if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) {
|
|
|
|
|
const operate = {
|
|
|
|
|
type: 'mbm',
|
|
|
|
|
operation: this.Signal.reopenSignal.button.operation
|
|
|
|
|
};
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
|
|
|
|
const newOperate = this.handelOperate(deviceList[0].code);
|
|
|
|
|
this.$store.dispatch('training/nextNew', newOperate).then(({ valid, response }) => {});
|
|
|
|
|
});
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
|
|
|
|
|
operate.param = {signalCode: deviceList[0].code};
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$store.dispatch('training/nextNew', newOperate).then(({ valid, response }) => {});
|
|
|
|
|
}
|
|
|
|
|
} else if (deviceList.length === 2) {
|
|
|
|
|
this.routeList.forEach(item => {
|
|
|
|
|
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
|
|
|
|
|
const operate = this.handelOperate(item);
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
|
|
|
|
|
operate.param = {routeCode: item.code};
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -364,7 +364,10 @@ export default {
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_CI_AUTO;
|
|
|
|
|
operate.param = {signalCode: route.startSignalCode};
|
|
|
|
|
}
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$refs.noticeInfo.doShow(operate);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handelTotalCancel(model, subType) {
|
|
|
|
|
const operate = {
|
|
|
|
@ -391,7 +394,10 @@ export default {
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO;
|
|
|
|
|
operate.param = {signalCode: route.startSignalCode};
|
|
|
|
|
}
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch(() => {
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$refs.noticeInfo.doShow(operate);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleGuideRoute(deviceList) {
|
|
|
|
|
if (deviceList.length === 1) {
|
|
|
|
@ -422,9 +428,9 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
|
|
|
operate['operateNext'] = this.Command.close.password.operation;
|
|
|
|
|
this.operation = '0';
|
|
|
|
|
this.$refs.password.doShow(operate);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -439,86 +445,129 @@ export default {
|
|
|
|
|
this.routeList.forEach(item => {
|
|
|
|
|
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
|
|
|
|
|
operate.param = {routeCode: item.code};
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
selectedChange() {
|
|
|
|
|
// 按钮按下时
|
|
|
|
|
if (this.$store.state.menuOperation.buttonOperation) {
|
|
|
|
|
const model = this.$store.state.menuOperation.selected; // 选择设备
|
|
|
|
|
const subType = this.$store.state.menuOperation.subType; // 选择设备的子元素
|
|
|
|
|
this.deviceList.push(model);
|
|
|
|
|
if (model._type) {
|
|
|
|
|
if (this.Signal.arrangementRoute.button.operation === this.$store.state.menuOperation.buttonOperation) {
|
|
|
|
|
if (model._type !== 'Signal') {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.arrangementRouteOperation(this.deviceList);
|
|
|
|
|
} else if (this.$store.state.menuOperation.buttonOperation === this.MixinCommand.functionButton.button.operation) {
|
|
|
|
|
this.handelFunctionButton(model, subType);
|
|
|
|
|
} else if (this.$store.state.menuOperation.buttonOperation === this.MixinCommand.totalCancel.button.operation) {
|
|
|
|
|
this.handelTotalCancel(model, subType);
|
|
|
|
|
} else if (this.$store.state.menuOperation.buttonOperation === this.Signal.guide.button.operation) {
|
|
|
|
|
if (model._type !== 'Signal') {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.handleGuideRoute(this.deviceList);
|
|
|
|
|
} else {
|
|
|
|
|
const operate = this.handelOperate(model);
|
|
|
|
|
if (this.cmdTypeList.indexOf(model._type) >= 0) {
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
|
|
|
|
} else {
|
|
|
|
|
Handler.clear(); // 清空操作组
|
|
|
|
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Handler.clear(); // 清空操作组
|
|
|
|
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
|
|
|
|
handleTotalHumanSolution(model) {
|
|
|
|
|
let route = '';
|
|
|
|
|
this.routeList.forEach(item => {
|
|
|
|
|
if (item.startSignalCode === model.code) {
|
|
|
|
|
route = item;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
const operate = {
|
|
|
|
|
send: true,
|
|
|
|
|
operation: this.$store.state.menuOperation.buttonOperation
|
|
|
|
|
};
|
|
|
|
|
if (this.routeData[route.code].settingGuide) {
|
|
|
|
|
operate.cmdType = CMD;
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {});
|
|
|
|
|
} else {
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
|
|
|
|
|
operate.param = {signalCode: model.code};
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch(() => {
|
|
|
|
|
this.$refs.noticeInfo.doShow(operate);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handelOperate(model) { // 设置operate
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
handelControlRoute(model) {
|
|
|
|
|
const routeCodeList = [];
|
|
|
|
|
const operate = {
|
|
|
|
|
send: true,
|
|
|
|
|
operation: this.$store.state.menuOperation.buttonOperation,
|
|
|
|
|
cmdType: this.cmdType,
|
|
|
|
|
param: {}
|
|
|
|
|
};
|
|
|
|
|
switch (this.commandType) {
|
|
|
|
|
case 'Switch':
|
|
|
|
|
operate.param['switchCode'] = model.code;
|
|
|
|
|
break;
|
|
|
|
|
case 'Signal':
|
|
|
|
|
operate.param['signalCode'] = model.code;
|
|
|
|
|
break;
|
|
|
|
|
case 'Section':
|
|
|
|
|
operate.param['sectionCode'] = model.code;
|
|
|
|
|
break;
|
|
|
|
|
case 'MixinCommand':
|
|
|
|
|
if (model._type == 'Switch') {
|
|
|
|
|
if (this.operation == this.MixinCommand.block.button.operation) {
|
|
|
|
|
operate.cmdType = CMD.Switch.CMD_SWITCH_BLOCK;
|
|
|
|
|
} else if (this.operation == this.MixinCommand.unblock.button.operation) {
|
|
|
|
|
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;
|
|
|
|
|
}
|
|
|
|
|
operate.param['Switch_Code'] = model.code;
|
|
|
|
|
} else if (model._type == 'Signal') {
|
|
|
|
|
if (this.operation == this.MixinCommand.block.button.operation) {
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_BLOCK;
|
|
|
|
|
} else if (this.operation == this.MixinCommand.unblock.button.operation) {
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK;
|
|
|
|
|
}
|
|
|
|
|
operate.param['Signal_Code'] = model.code;
|
|
|
|
|
} else if (model.deviceType == 'ROUTE') {
|
|
|
|
|
operate.param['routeCode'] = model.code;
|
|
|
|
|
this.routeList.forEach(item => {
|
|
|
|
|
if (item.startSignalCode === model.code) {
|
|
|
|
|
routeCodeList.push(item.code);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
});
|
|
|
|
|
operate.param = {signalCode: model.code, routeCodeList: routeCodeList};
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch(() => {
|
|
|
|
|
this.$refs.noticeInfo.doShow(operate);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handelSwitchOperate(model) {
|
|
|
|
|
const operate = {
|
|
|
|
|
send: true,
|
|
|
|
|
operation: this.$store.state.menuOperation.buttonOperation,
|
|
|
|
|
cmdType: this.cmdType,
|
|
|
|
|
param: { switchCode: model.code}
|
|
|
|
|
};
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch(() => {
|
|
|
|
|
this.$refs.noticeInfo.doShow(operate);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handelBlockOrUnblock(model) {
|
|
|
|
|
const buttonOperation = this.$store.state.menuOperation.buttonOperation;
|
|
|
|
|
const operate = {
|
|
|
|
|
send: true,
|
|
|
|
|
operation: buttonOperation,
|
|
|
|
|
cmdType: '',
|
|
|
|
|
param: {}
|
|
|
|
|
};
|
|
|
|
|
if (model.type === 'Switch' && buttonOperation === this.MixinCommand.block.button.operation) {
|
|
|
|
|
operate.cmdType = CMD.Switch.CMD_SWITCH_BLOCK;
|
|
|
|
|
operate.param = {SwitchCode: model.code};
|
|
|
|
|
} else if (model.type === 'Switch' && buttonOperation === this.MixinCommand.unblock.button.operation) {
|
|
|
|
|
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;
|
|
|
|
|
operate.param = {SwitchCode: model.code};
|
|
|
|
|
} else if (model.type === 'Signal' && buttonOperation === this.MixinCommand.block.button.operation) {
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_BLOCK;
|
|
|
|
|
operate.param = {SignalCode: model.code};
|
|
|
|
|
} else if (model.type === 'Signal' && buttonOperation === this.MixinCommand.unblock.button.operation) {
|
|
|
|
|
operate.cmdType = CMD.Signal.CMD_SIGNAL_UNBLOCK;
|
|
|
|
|
operate.param = {SignalCode: model.code};
|
|
|
|
|
}
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch(() => {
|
|
|
|
|
this.$refs.noticeInfo.doShow(operate);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
selectedChange() {
|
|
|
|
|
// 按钮按下时
|
|
|
|
|
const buttonOperation = this.$store.state.menuOperation.buttonOperation;
|
|
|
|
|
const model = this.$store.state.menuOperation.selected; // 选择设备
|
|
|
|
|
const subType = this.$store.state.menuOperation.subType; // 选择设备的子元素
|
|
|
|
|
const switchOperation = [this.Switch.lock.button.operation, this.Switch.unlock.button.operation, this.Switch.locate.button.operation, this.Switch.reverse.button.operation];
|
|
|
|
|
if (buttonOperation && this.commandTypeList.includes(model._type)) {
|
|
|
|
|
this.deviceList.push(model);
|
|
|
|
|
if (buttonOperation === this.Signal.arrangementRoute.button.operation) {
|
|
|
|
|
this.arrangementRouteOperation(this.deviceList);
|
|
|
|
|
} else if (buttonOperation === this.MixinCommand.functionButton.button.operation) {
|
|
|
|
|
this.handelFunctionButton(model, subType);
|
|
|
|
|
} else if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
|
|
|
|
|
this.handelTotalCancel(model, subType);
|
|
|
|
|
} else if (buttonOperation === this.Signal.humanTrainRoute.button.operation) {
|
|
|
|
|
this.handleTotalHumanSolution(model);
|
|
|
|
|
} else if (buttonOperation === this.Signal.guide.button.operation) {
|
|
|
|
|
this.handleGuideRoute(this.deviceList);
|
|
|
|
|
} else if (buttonOperation === this.Signal.atsAutoControl.button.operation || buttonOperation === this.Signal.humanControl.button.operation) {
|
|
|
|
|
this.handelControlRoute(model);
|
|
|
|
|
} else if (switchOperation.includes(buttonOperation)) {
|
|
|
|
|
this.handelSwitchOperate(model);
|
|
|
|
|
} else if (buttonOperation === this.MixinCommand.block.button.operation || buttonOperation === this.MixinCommand.unblock.button.operation) {
|
|
|
|
|
this.handelBlockOrUnblock(model);
|
|
|
|
|
} else {
|
|
|
|
|
const operate = this.handelOperate(model);
|
|
|
|
|
if (this.cmdTypeList.indexOf(model._type) >= 0) {
|
|
|
|
|
this.deviceList = [];
|
|
|
|
|
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {});
|
|
|
|
|
} else {
|
|
|
|
|
Handler.clear(); // 清空操作组
|
|
|
|
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Handler.clear(); // 清空操作组
|
|
|
|
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
|
|
|
|
}
|
|
|
|
|
return operate;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|