北京佛山线路现地工作站操作新增控制器判断

This commit is contained in:
fan 2023-05-21 13:39:42 +08:00
parent bc6ad0226b
commit 5e55daf3a4
4 changed files with 44 additions and 9 deletions

View File

@ -348,9 +348,26 @@ export default {
this.$refs.noticeInfo.doShow();
});
},
checkStationControl(device) {
let cenStationCode = '';
if (['Section', 'Signal', 'Switch', 'GuideLock', 'AutoTurnBack'].includes(device._type)) {
cenStationCode = device.stationCode;
} else if (device._type === 'Stand') {
cenStationCode = device.deviceStationCode;
}
if (!cenStationCode) {
return false;
}
const cenStation = this.$store.getters['map/getDeviceByCode'](cenStationCode);
const flag = cenStation.controlMode === 'Emergency' || cenStation.controlMode === 'Local';
if (!flag) {
this.$message.info('请先切换到站控或紧急站控');
}
return flag;
},
selectedChange() {
const model = this.$store.state.menuOperation.selected;
if (model && model._type) {
if (model && model._type && this.checkStationControl(model)) {
switch (this.$store.state.menuOperation.buttonOperation) {
case OperationEvent.Station.guideLock.button.operation : {
if (model && model._type == 'GuideLock') {

View File

@ -135,8 +135,14 @@ export default {
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
const device = this.$store.state.menuOperation.selected;
if (this.buttonOperation && device._type == 'Section') {
const cenStation = this.$store.getters['map/getDeviceByCode'](device.stationCode);
if (cenStation.controlMode !== 'Emergency' && cenStation.controlMode !== 'Local') {
this.$message.info('请先切换到站控或紧急站控');
return;
}
this.operationHandler(this.buttonOperation, device);
}
}
},
@ -200,7 +206,7 @@ export default {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}).catch(error=>{
}).catch(()=>{
this.$refs.noticeInfo.doShow();
});
break;
@ -213,7 +219,7 @@ export default {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
this.$store.dispatch('menuOperation/setButtonOperation', null);
}
}).catch(error=>{
}).catch(()=>{
this.$refs.noticeInfo.doShow();
});
break;

View File

@ -202,8 +202,14 @@ export default {
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Signal') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
const device = this.$store.state.menuOperation.selected;
if (this.buttonOperation && device._type == 'Signal') {
const cenStation = this.$store.getters['map/getDeviceByCode'](device.stationCode);
if (cenStation.controlMode !== 'Emergency' && cenStation.controlMode !== 'Local') {
this.$message.info('请先切换到站控或紧急站控');
return;
}
this.operationHandler(this.buttonOperation, device);
}
}
},

View File

@ -175,8 +175,14 @@ export default {
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Switch') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
const device = this.$store.state.menuOperation.selected;
if (this.buttonOperation && device._type == 'Switch') {
const cenStation = this.$store.getters['map/getDeviceByCode'](device.stationCode);
if (cenStation.controlMode !== 'Emergency' && cenStation.controlMode !== 'Local') {
this.$message.info('请先切换到站控或紧急站控');
return;
}
this.operationHandler(this.buttonOperation, device);
}
}
},