From 8431ff8cc411189f30daa2b2bc97be43f75f754b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 26 Dec 2019 11:04:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=9D=9E=E7=A9=BA=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMapdraft/dataRelation/routeoperate/protect.vue | 7 ++++--- .../newMap/newMapdraft/dataRelation/routeoperate/route.vue | 4 ++-- .../newMapdraft/dataRelation/signaloperate/route.vue | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) 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 : ''); } }); }