修改报错问题

This commit is contained in:
dong 2022-12-29 15:21:50 +08:00
parent 61fdf8eb31
commit a4ccf0c678

View File

@ -43,18 +43,20 @@ export default {
if (elem && (elem.hasOwnProperty('success') || elem.hasOwnProperty('timeout'))) { if (elem && (elem.hasOwnProperty('success') || elem.hasOwnProperty('timeout'))) {
const operate = this.$store.state.training.operate; const operate = this.$store.state.training.operate;
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode); const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode); if (control && control.stationCode) {
const newOperate = { const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
type: operate.type, const newOperate = {
name: station.name type: operate.type,
}; name: station.name
};
if (elem.timeout) { if (elem.timeout) {
newOperate['msg'] = '请求超时'; newOperate['msg'] = '请求超时';
this.doShow(newOperate); this.doShow(newOperate);
} else if (!elem.success) { } else if (!elem.success) {
newOperate['msg'] = '请求拒绝'; newOperate['msg'] = '请求拒绝';
this.doShow(newOperate); this.doShow(newOperate);
}
} }
} }
} }