行调状态下点击车站报错调整

This commit is contained in:
fan 2022-12-02 10:53:39 +08:00
parent 0612de521f
commit 1e241b3460

View File

@ -58,7 +58,7 @@ export default {
return false;
} else {
const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
return !(myStation.centralized && myStation.chargeStationCodeList.includes(station.code));
return !(myStation && myStation.centralized && myStation.chargeStationCodeList.includes(station.code));
}
},
isShow: (station, work) => work === 'localWork'
@ -72,7 +72,7 @@ export default {
return false;
} else {
const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
return !(myStation.centralized && myStation.chargeStationCodeList.includes(station.code));
return !(myStation && myStation.centralized && myStation.chargeStationCodeList.includes(station.code));
}
},
isShow: (station, work) => work === 'localWork'
@ -142,8 +142,8 @@ export default {
initMenu() {
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
this.menu.push(menuItem);
});