北京一号线 现地 设置进路操作代码调整

This commit is contained in:
joylink_cuiweidong 2020-03-13 15:36:26 +08:00
parent 264310f28e
commit 494e1fc815

View File

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