From 101e58118a9934ffd0a1294acb842e23b0272ff0 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 30 Apr 2020 18:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=9C=B0=E5=9B=BE=20?= =?UTF-8?q?=E7=BB=98=E5=9B=BE=20=E4=BA=A4=E8=B7=AF=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/dataRelation/index.vue | 4 +-- .../dataRelation/routingoperate/index.vue | 6 ++++ .../dataRelation/routingoperate/route.vue | 29 ++++++++++++++----- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/views/newMap/newMapdraft/dataRelation/index.vue b/src/views/newMap/newMapdraft/dataRelation/index.vue index 0926b567e..8b95e1973 100644 --- a/src/views/newMap/newMapdraft/dataRelation/index.vue +++ b/src/views/newMap/newMapdraft/dataRelation/index.vue @@ -170,10 +170,10 @@ export default { this.$emit('selectView', 'draft'); }, tabBeforeLeave(activeName, oldActiveName) { - if (oldActiveName === 'route' || oldActiveName === 'signal' || oldActiveName == 'runLevel') { + if (oldActiveName === 'route' || oldActiveName === 'signal' || oldActiveName == 'runLevel' || oldActiveName == 'routing') { this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false); } - if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel') { + if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel' || activeName == 'routing') { this.$nextTick(() => { this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true); }); diff --git a/src/views/newMap/newMapdraft/dataRelation/routingoperate/index.vue b/src/views/newMap/newMapdraft/dataRelation/routingoperate/index.vue index 1d0c726f9..4448c0dc6 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routingoperate/index.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routingoperate/index.vue @@ -78,6 +78,12 @@ export default { }, setCenter(code) { this.$emit('setCenter', code); + }, + initLoad() { + this.$refs.routeEdit.batchSectionListFocus(true); + }, + batchSectionListFocus(flag) { + this.$refs.routeEdit.batchSectionListFocus(flag); } } }; diff --git a/src/views/newMap/newMapdraft/dataRelation/routingoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routingoperate/route.vue index a761e0100..3397128b5 100644 --- a/src/views/newMap/newMapdraft/dataRelation/routingoperate/route.vue +++ b/src/views/newMap/newMapdraft/dataRelation/routingoperate/route.vue @@ -276,16 +276,16 @@ export default { } }, 'addModel.parkSectionCodeList':function(val, old) { - val.forEach(each=>{ - const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode); - section.instance.drawBatchSelected(section, 'routingSection'); - }); + this.changeSectionSelected(val, true); } }, mounted() { this.rowDrop(); }, + beforeDestroy() { + // debugger; + }, methods: { // 行拖拽 rowDrop() { @@ -542,14 +542,27 @@ export default { } }); }, - clear() { - if (this.$refs && this.$refs.form && this.mapInfo) { - if (this.addModel.parkSectionCodeList.length > 0) { - this.addModel.parkSectionCodeList.forEach(each=>{ + batchSectionListFocus(flag) { + this.changeSectionSelected(this.addModel.parkSectionCodeList, flag); + }, + changeSectionSelected(selectedList, flag) { + if (this.addModel.parkSectionCodeList.length > 0) { + if (flag) { + selectedList.forEach(each=>{ + const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode); + section.instance.drawBatchSelected(section, 'routingSection'); + }); + } else { + selectedList.forEach(each=>{ const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode); section.instance.drawBatchSelected(section, ''); }); } + } + }, + clear() { + if (this.$refs && this.$refs.form && this.mapInfo) { + this.changeSectionSelected(this.addModel.parkSectionCodeList, false); delete this.addModel.id; this.$refs.form.resetFields(); this.addModel.mapId = this.mapInfo.id;