This commit is contained in:
joylink_cuiweidong 2022-08-15 16:49:24 +08:00
commit bfe2401f0f
4 changed files with 54 additions and 76 deletions

View File

@ -1119,6 +1119,14 @@ class Signal extends Group {
}
});
}
if (model.lockedRouteCode) {
this.model.signalButtonList && this.model.signalButtonList.length && this.model.signalButtonList.forEach(item => {
const button = store.getters['map/getDeviceByCode'](item);
if (button.type === 'GUIDE') {
button && button.instance && button.instance.setState({ toSelected: 0, type: button.model, pressDown: button.pressDown });
}
});
}
/** 信号机封锁 */ // 缺一个功能封锁
model.blockade && this.block(); // 因大铁处理信号按钮状态 封锁处理需在延时解锁时间之后处理
model.overlapLock && this.overlapLock();

View File

@ -24,7 +24,7 @@
<center><b></b><b></b></center>
</span>
</button>
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" @click="buttonDown(Signal.humanTrainRoute.button.operation, ['Signal'])">
<button :id="Signal.humanTrainRoute.button.domId" class="button_box" @click="buttonDown(Signal.humanTrainRoute.button.operation, ['SignalButton'])">
<span :style="{color: operation === Signal.humanTrainRoute.button.operation ? '#ccc':'black'}">
<center><b></b></center>
<center><b></b><b></b></center>
@ -36,7 +36,7 @@
<center><b></b><b></b></center>
</span>
</button>
<button :id="Station.guideLock.button.domId" :disabled="true" class="button_box" @click="buttonDown(Station.guideLock.button.operation, ['Button'])">
<button :id="Station.guideLock.button.domId" :disabled="true" class="button_box" @click="buttonDown(Station.guideLock.button.operation, ['SignalButton'])">
<span :style="{color: operation === Station.guideLock.button.operation?'#ccc':'black'}">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
@ -434,38 +434,6 @@ export default {
this.clearOperate();
this.$refs.defectiveShunting.doShow({ switchSection, code, shuntingTypeList });
},
// S
guideLockLeftButtonDown() {
const operate = {
operation: this.Station.stationMasterLock.leftButton.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
//
operate.nextCmdType = this.sGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
operate.param = { throat: 'S', stationCode: this.$store.state.map.showCentralizedStationCode };
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
});
},
// X
guideLockRightButtonDown() {
const operate = {
operation: this.Station.stationMasterLock.rightButton.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
//
operate.nextCmdType = this.xGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
operate.param = { throat: 'X', stationCode: this.$store.state.map.showCentralizedStationCode };
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
});
},
buttonDown(operation, commandTypeList, color) {
this.clearOperate();
this.pressedSignalButton && this.pressedSignalButton.instance.pressDown(true, color);
@ -477,7 +445,8 @@ export default {
const operationList = [
this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation,
this.Section.defectiveShunting.button.operation
this.Section.defectiveShunting.button.operation,
this.Signal.guide.button.operation
];
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -639,14 +608,14 @@ export default {
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
param: { signalCode: model.signalCode }
};
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode);
// 15s
if (signal.guideTime) {
this.sendCommand(operate);
} else {
operate.nextCmdType = CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE;
this.$refs.password.doShow(operate);
}
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
this.$store.dispatch('training/updateMapState', [{ code: model.code, _type: model._type, toSelected: 1 }]);
}).catch(error => {
console.error(error);
this.$refs.noticeInfo.doShow();
}).finally(() => {
this.clearOperate();
});
},
//
handleTotalHumanSolution(model) {
@ -658,6 +627,7 @@ export default {
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
};
// const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode || model.code);
console.log(model._type, model.type, '8888888');
if (model._type === 'SignalButton' && model.type === 'PICK') {
operate.param = { signalCode: model.signalCode };
this.sendCommand(operate);
@ -683,9 +653,7 @@ export default {
},
//
sendCommand(operate) {
this.$store
.dispatch('training/nextNew', operate)
.then(({ valid, response }) => {})
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {})
.catch(error => {
console.error(error);
this.$refs.noticeInfo.doShow();
@ -736,23 +704,28 @@ export default {
this.sendCommand(operate);
},
handleGuideLock(model) {
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode);
if ((signal && (this.guideLockRightFlag && signal.right)) || (this.guideLockLeftFlag && !signal.right)) {
const operate = {
over: true,
code: model.code,
operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton,
nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK,
param: { signalCode: model.signalCode }
};
// 15s
if (signal.guideTime) {
operate.cmdType = CMD.Switch.CMD_SWITCH_MASTER_LOCK;
this.sendCommand(operate);
} else {
// const operate = {
// over: true,
// code: model.code,
// operation: this.Station.guideLock.button.operation,
// nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK,
// param: { signalCode: model.signalCode }
// };
// // 15s
// this.$refs.password.doShow(operate);
const operate = {
operation: this.Station.guideLock.button.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
//
operate.nextCmdType = this.xGuideMasterLock ? CMD.Station.CMD_STATION_MASTER_UNLOCK : CMD.Station.CMD_STATION_MASTER_LOCK;
operate.param = { throat: model.labelEnum, stationCode: this.$store.state.map.showCentralizedStationCode };
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
}
});
},
handelFaultSection(model) {
if (model._type === 'Section') {
@ -801,11 +774,12 @@ export default {
'CANCEL', //
'HUMAN_RELEASE_ROUTE' //
];
if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') {
this.handleGuideLock(model);
} else if (buttonOperation && this.commandTypeList.includes(model._type)) {
console.log(buttonOperation, this.Signal.humanTrainRoute.button.operation, '9999');
if (buttonOperation && this.commandTypeList.includes(model._type)) {
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
this.handelTotalCancel(model);
} else if (buttonOperation === this.Station.guideLock.button.operation && model.type === 'GUIDELOCK') {
this.handleGuideLock(model);
} else if (buttonOperation === this.Signal.humanTrainRoute.button.operation) {
this.handleTotalHumanSolution(model);
} else if (switchOperation.includes(buttonOperation)) {
@ -821,23 +795,19 @@ export default {
this.arrangementRouteOperation(this.deviceList);
} else if (buttonOperation === this.Signal.reopenSignal.button.operation) {
this.reopenSignalOperation(model);
} else if (buttonOperation === this.Signal.guide.button.operation) {
this.handleGuideSignal(model);
} else {
this.clearOperate();
}
} else if (!buttonOperation) {
const signalButtonList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST', 'OCCLUSION', 'RECOVERY', 'ACCIDENT'];
if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE') {
this.handleGuideSignal(model);
} else if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
// if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE') {
// this.handleGuideSignal(model);
// } else
if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
//
this.assistOperateOrChange(model);
} else if (model._type === 'SignalButton' && model.type === 'GUIDELOCK') {
//
if (model.labelEnum === 'S') {
this.guideLockLeftButtonDown();
} else if (model.labelEnum === 'X') {
this.guideLockRightButtonDown();
}
} else if (model._type === 'SignalButton' && signalButtonOperation.includes(model.type)) {
this.pressedSignalButton = model;
const { lamp } = model.instance.style.SwitchFault;

View File

@ -153,7 +153,6 @@ export default {
this.menu = [];
}
//
console.log(OperateMode.FAULT, '*********************');
if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') {
this.menu = this.menuForce;
}

View File

@ -137,7 +137,8 @@ export default {
this.editModel = { code: '', pictureHide: false, position: {x:0, y:0} };
},
deviceChange(val) {
this.deviceSelect(val);
const device = this.$store.getters['map/getDeviceByCode'](val);
this.deviceSelect(device);
}
}
};