diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue index 5d0819d4a..b97fc6640 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue @@ -388,12 +388,13 @@ export default { changeSectionSelected(list, flag, type) { list && list.forEach((item) => { const section = this.$store.getters['map/getDeviceByCode'](item); - if (section.logicSectionCodeList && section.logicSectionCodeList.length) { + if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) { section.logicSectionCodeList.forEach( (logicSectionCode) => { - this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(flag, flag ? type : ''); + const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode); + logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : ''); }); } else { - section.instance.drawBatchSelected(flag, flag ? type : ''); + section && section.instance.drawBatchSelected(flag, flag ? type : ''); } }); }, diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue index 711f8d3b9..692261451 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue @@ -512,13 +512,13 @@ export default { changeSectionSelected(list, flag, type) { list && list.forEach((item) => { const section = this.$store.getters['map/getDeviceByCode'](item); - if (section.logicSectionCodeList && section.logicSectionCodeList.length > 0) { + if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) { section.logicSectionCodeList.forEach( (logicSectionCode) => { const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode); logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : ''); }); } else { - section.instance.drawBatchSelected(flag, flag ? type : ''); + section && section.instance.drawBatchSelected(flag, flag ? type : ''); } }); }, diff --git a/src/views/newMap/newMapdraft/dataRelation/signaloperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/signaloperate/route.vue index bb676fe13..1156ce74e 100644 --- a/src/views/newMap/newMapdraft/dataRelation/signaloperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/signaloperate/route.vue @@ -233,13 +233,13 @@ export default { changeSectionSelected(list, flag, type) { list && list.forEach((item) => { const section = this.$store.getters['map/getDeviceByCode'](item); - if (section.logicSectionCodeList && section.logicSectionCodeList.length) { + if (section && section.logicSectionCodeList && section.logicSectionCodeList.length) { section.logicSectionCodeList.forEach( (logicSectionCode) => { const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode); logicSection && logicSection.instance.drawBatchSelected(flag, flag ? type : ''); }); } else { - section.instance.drawBatchSelected(flag, flag ? type : ''); + section && section.instance.drawBatchSelected(flag, flag ? type : ''); } }); }