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;