赛总指示调整

This commit is contained in:
fan 2023-07-13 17:16:14 +08:00
parent 4bfa9c78b8
commit 6142c2e90e
3 changed files with 29 additions and 27 deletions

View File

@ -35,7 +35,7 @@ export default {
TrainOperation,
SwitchControl,
SignalControl,
OperationPlanDetail
OperationPlanDetail
},
data() {
return {
@ -232,7 +232,10 @@ export default {
});
},
trainControlShow() {
this.$refs.trainOperation.doShow();
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
if (station && station.controlMode === 'Local') {
this.$refs.trainOperation.doShow();
}
},
back() {
if (this.$store.state.training.simulationCreator) {

View File

@ -55,12 +55,18 @@ export default {
return {
menu: [],
menuNormal: [
// {
// label: 'Increase the number of trips',
// handler: this.addSpare,
// cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN,
// isDisabled: (section, station, work) => station.controlMode === 'Interlock' && work === 'ctcWork',
// isShow: (section, work) => ['01', '02', '03'].includes(section.type)
// },
{
label: 'Increase the number of trips',
handler: this.addSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN,
isDisabled: (section, station, work) => station.controlMode === 'Interlock' && work === 'ctcWork',
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
label: 'Add Train',
handler: this.loadSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_SPARE_TRAIN,
isDisabled: (section, station, work) => station.controlMode !== 'Local' && work === 'localWork'
},
{
label: 'Bad split',
@ -87,11 +93,6 @@ export default {
label: 'Cancel faults',
handler: this.cancelStoppage,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
},
{
label: 'Add Train',
handler: this.loadSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_SPARE_TRAIN
}
]
};
@ -128,7 +129,7 @@ export default {
initMenu() {
//
this.menu = [];
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, station || {}, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;

View File

@ -58,22 +58,12 @@ export default {
return {
menu: [],
menuNormal: [
{
label: 'Change of train number',
handler: this.modifyTripNumber,
cmdType: CMD.Train.CMD_TRAIN_UPDATE_TRIP_NUMBER_TRAIN
},
{
label: 'Remove train number',
handler: this.removeTripNumber,
cmdType: CMD.Train.CMD_TRAIN_REMOVE_TRAIN_TRACE,
isShow: (train, work) => work === 'localWork' || work === 'ctcWork'
},
{
label: 'Change end',
handler: this.turnDirection,
cmdType: CMD.Train.CMD_TRAIN_REMOVE_TRAIN_TRACE,
isShow: (train, work) => work === 'localWork' || work === 'ctcWork'
isDisabled: (section, station, work) => station.controlMode !== 'Local' && work === 'localWork',
isShow: (train, work) => work === 'localWork' || work === 'dispatchWork'
}
],
menuForce: [
@ -150,7 +140,15 @@ export default {
},
'$store.state.menuOperation.selected': function (val) {
if (val._type === 'Train' && val._event === MouseEvent.Left && this.project === 'thailandsandbox') {
this.$refs.trainOperation.doShow(val);
if (this.work === 'localWork') {
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
if (station && station.controlMode === 'Local') {
this.$refs.trainOperation.doShow(val);
}
} else {
this.$refs.trainOperation.doShow(val);
}
}
}
},
@ -158,7 +156,7 @@ export default {
initMenu() {
//
this.menu = [];
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode);
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, station || {}, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;