代码调整

This commit is contained in:
joylink_cuiweidong 2023-02-08 17:43:09 +08:00
parent 362caf8ef1
commit 150ede0cb9

View File

@ -98,14 +98,16 @@ export default {
},
{
label: '封锁/解封',
handle: '',
handler: this.blockOrUnblock,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK,
isDisabled: (section, station, work) => station.controlMode !== 'Local',
isShow: (section, work) => work === 'ctcWork'
},
{
label: '区故解',
handle: '',
isDisabled: (section, station, work) => station.controlMode !== 'Local',
handler: this.fault,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK,
isDisabled: (_section, station, work) => station.controlMode !== 'Local',
isShow: (section, work) => work === 'ctcWork'
},
{
@ -275,27 +277,37 @@ export default {
}
});
},
blockOrUnblock() {
if (this.selected.blockade) {
this.unblock();
} else {
this.block();
}
},
//
block() {
commitOperate(menuOperate.Switch.block, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Switch.block, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
// this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
//
unblock() {
commitOperate(menuOperate.Switch.unblock, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Switch.unblock, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
// this.$refs.switchControl.doShow(operate, this.selected);
}
});
},
// /
fault() {
commitOperate(menuOperate.Switch.fault, { switchCode: this.selected.code}, 0).then(({valid, operate}) => {
commitOperate(menuOperate.Switch.fault, { switchCode: this.selected.code}, 3).then(({valid, operate}) => {
if (valid) {
this.$refs.switchControl.doShow(operate, this.selected);
// this.$refs.switchControl.doShow(operate, this.selected);
}
});
},