成都三号线 现地工作站 指令操作代码调整

This commit is contained in:
joylink_cuiweidong 2020-12-22 18:16:06 +08:00
parent 59371074ca
commit b5ebe1599d
2 changed files with 32 additions and 23 deletions

View File

@ -139,8 +139,7 @@ export default {
offset: {},
commandTypeList: [],
cmdTypeList: [],
deviceList: [],
routeListFilter: []
deviceList: []
};
},
computed: {
@ -268,18 +267,28 @@ export default {
}
},
buttonDown(operation, commandTypeList) {
//
this.deviceList = [];
if (operation != this.Command.cancel.clearMbm.operation) {
const operate = {
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.Station.guideLock.button.operation, this.MixinCommand.totalCancel.button.operation];
//
const operationList = [this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation,
this.Switch.unlock.button.operation,
this.MixinCommand.unblock.button.operation,
this.Station.guideLock.button.operation
// this.MixinCommand.totalCancel.button.operation
];
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.operation = operation;
this.commandTypeList = commandTypeList;
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
//
if (operationList.includes(operation)) {
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
@ -302,27 +311,24 @@ export default {
});
}
},
arrangementRouteOperation(deviceList) { //
// OR
arrangementRouteOperation(deviceList) {
const operate = {
operation: this.$store.state.menuOperation.buttonOperation
};
let isArrangementRoute = false;
if (deviceList.length === 1) {
this.routeListFilter = [];
this.routeList.forEach(item => {
if (item.startSignalCode === deviceList[0].code) {
this.routeListFilter.push(item);
}
});
const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].code);
const signal = deviceList[0];
const sectionModel = this.$store.getters['map/getDeviceByCode'](signal.sectionCode);
if (sectionModel) {
//
const sectionLeft = this.$store.getters['map/getDeviceByCode'](sectionModel.leftSectionCode);
const sectionRight = this.$store.getters['map/getDeviceByCode'](sectionModel.rightSectionCode);
if (sectionLeft.routeLock || sectionRight.routeLock) {
isArrangementRoute = true;
}
}
//
if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) { //
operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
@ -340,8 +346,10 @@ export default {
}
} else if (deviceList.length === 2) {
let flag = false;
this.routeListFilter.forEach(item => {
if (item.endButtonSignalCode === deviceList[1].code) { //
this.routeList.forEach(item => {
// item.endButtonSignalCode
//
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE;
operate.code = deviceList[1].code;
@ -349,7 +357,6 @@ export default {
this.deviceList = [];
flag = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.routeListFilter = [];
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
@ -357,12 +364,12 @@ export default {
});
if (!flag) {
this.deviceList = [];
this.$refs.noticeInfo.doShow('未找到选择进路!');
this.$refs.noticeInfo.doShow('未找到选择进路!');
}
}
},
handelFunctionButton(model, subType) {
debugger;
// debugger;
const operate = {
over: true,
operation: this.$store.state.menuOperation.buttonOperation,
@ -629,7 +636,9 @@ export default {
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 (!model._type && !model._code) {
return;
}
if (buttonOperation && buttonOperation === this.MixinCommand.functionButton.button.operation) {
this.handelFunctionButton(model, subType);
} else {
@ -638,6 +647,7 @@ export default {
if (station.controlMode == 'Local' || station.controlMode == 'Emergency') {
if (buttonOperation && this.commandTypeList.includes(model._type)) {
this.deviceList.push(model);
// debugger;
if (buttonOperation === this.Signal.arrangementRoute.button.operation) {
this.arrangementRouteOperation(this.deviceList);
} else if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
@ -664,6 +674,7 @@ export default {
}
} else {
this.clearOperate();
this.$messageBox('请先切换到站控或紧急站控');
}
}
}

View File

@ -20,15 +20,13 @@ export function getAutoReentryBySignalCode(signalCode, routeList, autoReentryLis
const autoReentry = [];
routeList.forEach(item => {
if (item.startSignalCode === signalCode && item.turnBack) {
route.push(item);
route.push(item.code);
}
});
autoReentryList.forEach(item => {
route.forEach(it => {
if (item.turnBackRouteCode === it.code || item.turnBackRoute2Code === it.code) {
autoReentry.push(item);
}
});
if (route.includes(item.turnBackRouteCode) || route.includes(item.turnBackRoute2Code)) {
autoReentry.push(item);
}
});
return autoReentry;
}