大铁项目 ctc 修改 改方、闭塞等操作 调整

This commit is contained in:
joylink_cuiweidong 2022-07-21 16:57:09 +08:00
parent 1deb1e017d
commit 5909f738f7
2 changed files with 185 additions and 35 deletions

View File

@ -30,29 +30,33 @@ export default class SignalButton extends Group {
const model = this.model;
const computedPosition = this.computedPosition;
const fillColor = this.getTypeColor();
const queryList = window.location.search.substring(1).split('&');
const queryCtc = queryList.find(item => {
return item.includes('ctc');
});
const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST'];
// const queryList = window.location.search.substring(1).split('&');
// const queryCtc = queryList.find(item => {
// return item.includes('ctc');
// });
// const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST'];
const typeList = [];
if (queryCtc && ctcArcList.includes(model.type)) {
this.arcShape = new Arc({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: computedPosition.x + 7,
cy: computedPosition.y + 7,
r: 7
},
style: {
stroke: '#69666E',
lineWidth: 1,
fill: fillColor
}
});
this.add(this.arcShape);
} else if (this.style.SignalButton &&
// debugger;
// console.log(model.type);
// if (queryCtc && ctcArcList.includes(model.type)) {
// // debugger;
// this.arcShape = new Arc({
// zlevel: this.zlevel,
// z: this.z,
// shape: {
// cx: computedPosition.x + 7,
// cy: computedPosition.y + 7,
// r: 7
// },
// style: {
// stroke: '#69666E',
// lineWidth: 1,
// fill: fillColor
// }
// });
// this.add(this.arcShape);
// } else
if (this.style.SignalButton &&
this.style.SignalButton.shape === 'roundWithDock' &&
typeList.includes(model.type)) {
const circle1 = new Circle({
@ -314,6 +318,9 @@ export default class SignalButton extends Group {
}
}
}
// let
// { value: 'PICK', label: '接车按钮' },
// { value: 'SHUNT_TERMINAL', label: '调车终端按钮' },
if (!store.getters['map/checkDeviceShow'](this._code)) {
this.buttonText && this.buttonText.hide();
this.rectButton && this.rectButton.hide();

View File

@ -66,7 +66,7 @@
<center><b></b><b></b></center>
</span>
</button>
<button :id="MixinCommand.functionButton.button.domId" class="button_box" @click="buttonDown(MixinCommand.functionButton.button.operation, ['StationStand', 'Station'])">
<button :id="MixinCommand.functionButton.button.domId" class="button_box" @click="buttonDown(MixinCommand.functionButton.button.operation, ['StationStand', 'Station','SignalButton'])">
<span :style="{color: operation === MixinCommand.functionButton.button.operation ? '#ccc':'black'}">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
@ -673,6 +673,7 @@ export default {
// this.handleGuideLock(model);
// this.handleGuideSignal(model);
// } else
debugger;
if (buttonOperation && this.commandTypeList.includes(model._type)) {
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
this.handelTotalCancel(model);
@ -691,22 +692,37 @@ export default {
this.arrangementRouteOperation(this.deviceList);
} else if (buttonOperation === this.Signal.guide.button.operation ) {
this.handleGuideSignal(model);
} else if (buttonOperation === this.MixinCommand.functionButton.button.operation) {
const signalButtonList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST', 'OCCLUSION', 'RECOVERY', 'ACCIDENT'];
if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
//
this.assistOperateOrChange(model);
}
} else {
this.clearOperate();
}
} else if (!buttonOperation) {
if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE' ) {
this.handleGuideSignal(model);
} else if (model._type === 'SignalButton' && model.type === 'CHANGE_DIRECTION') {
//
// this.changeDirection(model);
this.clearOperate();
} else if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) || (model._type === 'Signal' && !model.blockade)) {
this.deviceList.push(model);
this.arrangementRouteOperation(this.deviceList);
} else {
this.clearOperate();
}
// if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE' ) {
// this.handleGuideSignal(model);
// } else if (model._type === 'SignalButton' && model.type === 'CHANGE_DIRECTION') {
// //
// // this.changeDirection(model);
// this.clearOperate();
// } else if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) || (model._type === 'Signal' && !model.blockade)) {
// this.deviceList.push(model);
// this.arrangementRouteOperation(this.deviceList);
// } else {
// this.clearOperate();
// }
// if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE' ) {
// this.handleGuideSignal(model);
// } else if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) || (model._type === 'Signal' && !model.blockade)) {
// this.deviceList.push(model);
// this.arrangementRouteOperation(this.deviceList);
// } else {
// this.clearOperate();
// }
} else { this.clearOperate(); }
if (this.timeNode) { this.timeNode = 0; }
},
@ -791,6 +807,133 @@ export default {
},
commandClear() {
this.clearOperate();
},
assistOperateOrChange(model) {
// mode.type==
const modelTypeMap = {
//
'ASSIST':{
operation:this.CTCCommand.assistPressMainAssist.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_MAIN_ASSIST,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode,
pressDown:model.pressDown ? 0 : 1 // 10
}
},
//
'CHANGE_DIRECTION':{
operation:this.CTCCommand.assistPressDownTurnDirection.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode,
pressDown:model.pressDown ? 0 : 1 // 10
}
},
//
'PICK_ASSIST':{
// this.CTCCommand.assistPressDownTurnDirection.menu.operation
operation:this.CTCCommand.assistPressReceiveAssist.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_RECEIVE_ASSIST,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode
}
},
//
'DEPART_ASSIST':{
operation:this.CTCCommand.assistPressDeliverAssist.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_DELIVER_ASSIST,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode
}
},
//
'ACCIDENT':{
operation:this.CTCCommand.assistPressAccident.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_ACCIDENT,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode
}
}
};
const noPasswordModelTypeMap = {
//
'OCCLUSION':{
operation:this.CTCCommand.assistPressBlock.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_BLOCK,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode
}
},
//
'RECOVERY':{
operation:this.CTCCommand.assistPressRestore.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_RESTORE,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode
}
}
};
if (noPasswordModelTypeMap[model.type]) {
const operate = {
over:true,
operation: noPasswordModelTypeMap[model.type].operation,
code: model.code,
param: noPasswordModelTypeMap[model.type].param,
cmdType : noPasswordModelTypeMap[model.type].nextCmdType
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.clearOperate();
} else {
this.$refs.noticeInfo.doShow();
}
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
} else {
const operate = {
operation: modelTypeMap[model.type].operation,
code: model.code,
param: modelTypeMap[model.type].param
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
operate.nextCmdType = modelTypeMap[model.type].nextCmdType;
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
}
// const operate = {
// over: true,
// code: model.code,
// operation: this.CTCCommand.assistPressDownTurnDirection.menu.operation,
// cmdType: CMD.CTC.CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION,
// param: {
// labelEnum:model.labelEnum,
// stationCode:model.stationCode
// }
// };
// this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {
// // this.clearOperate();
// }).catch((error) => {
// // this.clearOperate();
// console.error(error);
// this.$refs.noticeInfo.doShow();
// });
}
}
};