From d9bf1af2d9ef2d8ca3f5ca523a514c1f4ccd8b15 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 23 Dec 2019 09:23:29 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E7=BB=98?= =?UTF-8?q?=E5=9B=BE=E9=AB=98=E7=BA=A7=E7=BB=98=E5=9B=BE=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataRelation/routeoperate/protect.vue | 38 +++++++++---------- .../dataRelation/routeoperate/route.vue | 36 +++++++----------- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue index b299edde4..0c47e3bcb 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue @@ -214,29 +214,12 @@ export default { } }, 'addOverlapModel.routeOverlapSectionList': function (val, old) { + console.log(val, old, '=========='); if (old && old.length) { - old.forEach((item) => { - const section = this.$store.getters['map/getDeviceByCode'](item); - if (section.logicSectionCodeList && section.logicSectionCodeList.length) { - section.logicSectionCodeList.forEach( (logicSectionCode) => { - this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(false, ''); - }); - } else { - section.instance.drawBatchSelected(false, ''); - } - }); + this.changeSectionSelected(old, false, 'continueProtectSection' ); } if (val && val.length) { - val.forEach((item) => { - const section = this.$store.getters['map/getDeviceByCode'](item); - if (section.logicSectionCodeList && section.logicSectionCodeList.length) { - section.logicSectionCodeList.forEach( (logicSectionCode) => { - this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(true, 'continueProtectSection'); - }); - } else { - section.instance.drawBatchSelected(true, 'continueProtectSection'); - } - }); + this.changeSectionSelected(val, true, 'continueProtectSection' ); } } @@ -392,6 +375,21 @@ export default { }; this.overlapCode = ''; this.overlapType = ''; + }, + changeSectionSelected(list, flag, type) { + list.forEach((item) => { + const section = this.$store.getters['map/getDeviceByCode'](item); + if (section.logicSectionCodeList && section.logicSectionCodeList.length) { + section.logicSectionCodeList.forEach( (logicSectionCode) => { + this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(flag, flag ? type : ''); + }); + } else { + section.instance.drawBatchSelected(flag, flag ? type : ''); + } + }); + }, + routeSectionListFocus(flag) { + this.changeSectionSelected(this.addModel.routeSectionList, flag, 'continueProtectSection'); } } }; diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue index 689a20459..18a251edb 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue @@ -347,31 +347,13 @@ export default { }, 'addModel.routeSectionList': function(val, old) { if (old && old.length) { - old.forEach((item) => { - const section = this.$store.getters['map/getDeviceByCode'](item); - if (section.logicSectionCodeList && section.logicSectionCodeList.length) { - section.logicSectionCodeList.forEach( (logicSectionCode) => { - this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(false, ''); - }); - } else { - section.instance.drawBatchSelected(false, ''); - } - }); + this.changeSectionSelected(old, false, 'routePhysicalSection'); } if (val && val.length) { if (!this.addModel.code) { this.$refs.protect.addModel.unlockSectionCode = val[val.length - 1]; } - val.forEach((item) => { - const section = this.$store.getters['map/getDeviceByCode'](item); - if (section.logicSectionCodeList && section.logicSectionCodeList.length) { - section.logicSectionCodeList.forEach( (logicSectionCode) => { - this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(true, 'routePhysicalSection'); - }); - } else { - section.instance.drawBatchSelected(true, 'routePhysicalSection'); - } - }); + this.changeSectionSelected(val, true, 'routePhysicalSection'); } } }, @@ -496,9 +478,19 @@ export default { }); }, routeSectionListFocus(flag) { - this.addModel.routeSectionList.forEach((item) => { + this.changeSectionSelected(this.addModel.routeSectionList, flag, ''); + this.$refs['protect'].routeSectionListFocus(flag); + }, + changeSectionSelected(list, flag, type) { + list.forEach((item) => { const section = this.$store.getters['map/getDeviceByCode'](item); - section.instance.drawBatchSelected(flag); + if (section.logicSectionCodeList && section.logicSectionCodeList.length) { + section.logicSectionCodeList.forEach( (logicSectionCode) => { + this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(flag, flag ? type : ''); + }); + } else { + section.instance.drawBatchSelected(flag, flag ? type : 'routePhysicalSection'); + } }); }, setSelected(selected) { From 35dceb2950a374129e766e01c13213ad89ec9f7d Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 23 Dec 2019 09:31:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=9D=9E=E7=A9=BA=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/dataRelation/routeoperate/protect.vue | 2 +- .../newMap/newMapdraft/dataRelation/routeoperate/route.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue index 0c47e3bcb..f8931d6df 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue @@ -377,7 +377,7 @@ export default { this.overlapType = ''; }, changeSectionSelected(list, flag, type) { - list.forEach((item) => { + list && list.forEach((item) => { const section = this.$store.getters['map/getDeviceByCode'](item); if (section.logicSectionCodeList && section.logicSectionCodeList.length) { section.logicSectionCodeList.forEach( (logicSectionCode) => { diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue index 18a251edb..7ab10ed80 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue @@ -482,7 +482,7 @@ export default { this.$refs['protect'].routeSectionListFocus(flag); }, changeSectionSelected(list, flag, type) { - list.forEach((item) => { + list && list.forEach((item) => { const section = this.$store.getters['map/getDeviceByCode'](item); if (section.logicSectionCodeList && section.logicSectionCodeList.length) { section.logicSectionCodeList.forEach( (logicSectionCode) => { From 4677be1b3247e234fd6fb52f17a15aab778f5040 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 23 Dec 2019 09:44:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=80=89=E4=B8=ADtype=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/dataRelation/routeoperate/protect.vue | 3 +-- .../newMap/newMapdraft/dataRelation/routeoperate/route.vue | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue index f8931d6df..a43ee3a7b 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/protect.vue @@ -214,7 +214,6 @@ export default { } }, 'addOverlapModel.routeOverlapSectionList': function (val, old) { - console.log(val, old, '=========='); if (old && old.length) { this.changeSectionSelected(old, false, 'continueProtectSection' ); } @@ -389,7 +388,7 @@ export default { }); }, routeSectionListFocus(flag) { - this.changeSectionSelected(this.addModel.routeSectionList, flag, 'continueProtectSection'); + this.changeSectionSelected(this.addOverlapModel.routeOverlapSectionList, flag, 'continueProtectSection'); } } }; diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue index 7ab10ed80..aa1417e62 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue @@ -478,7 +478,7 @@ export default { }); }, routeSectionListFocus(flag) { - this.changeSectionSelected(this.addModel.routeSectionList, flag, ''); + this.changeSectionSelected(this.addModel.routeSectionList, flag, 'routePhysicalSection'); this.$refs['protect'].routeSectionListFocus(flag); }, changeSectionSelected(list, flag, type) { @@ -489,7 +489,7 @@ export default { this.$store.getters['map/getDeviceByCode'](logicSectionCode).instance.drawBatchSelected(flag, flag ? type : ''); }); } else { - section.instance.drawBatchSelected(flag, flag ? type : 'routePhysicalSection'); + section.instance.drawBatchSelected(flag, flag ? type : ''); } }); }, From 065a3ba72ea89d52a1a7a78fcd0a9e263ebdf8db Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 23 Dec 2019 10:15:45 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=B7=A6=E5=8F=B3=E5=85=B3=E8=81=94=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?list=E6=95=B0=E6=8D=AE=E4=B8=BA=E8=AE=A1=E8=BD=B4=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E5=92=8C=E9=81=93=E5=B2=94=E5=8C=BA=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/mapoperate/section.vue | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 750899510..fb7c3ecf3 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -41,7 +41,7 @@ - + - + { return elem.type === '01' || elem.type === '03'; }); + } + return list; + }, switchSectionList() { let list = []; if (this.sectionList && this.sectionList.length) { @@ -1080,7 +1087,7 @@ export default { const models = []; let rsection = null; let lsection = null; - this.PhysicalSectionList.forEach(section => { + this.switchAndPhySicalSectionList.forEach(section => { if (section.code === this.mergeModel.lsectioncode) { lsection = section; } @@ -1187,13 +1194,6 @@ export default { this.$emit('updateMapModel', models); } } - - this.PhysicalSectionList.forEach(lsection => { - if (lsection.code === this.mergeModel.lsectioncode) { - this.PhysicalSectionList.forEach(rsection => { - }); - } - }); } } });