赛总指示调整
This commit is contained in:
parent
4bfa9c78b8
commit
6142c2e90e
@ -232,7 +232,10 @@ export default {
|
||||
});
|
||||
},
|
||||
trainControlShow() {
|
||||
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) {
|
||||
|
@ -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;
|
||||
|
@ -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,15 +140,23 @@ export default {
|
||||
},
|
||||
'$store.state.menuOperation.selected': function (val) {
|
||||
if (val._type === 'Train' && val._event === MouseEvent.Left && this.project === 'thailandsandbox') {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user