Browse Source

组织树网格切换不生效

chengyang
mk 9 months ago
parent
commit
59c8d13549
  1. 8
      src/views/components/resiSearch.vue
  2. 5
      src/views/modules/base/resi.vue

8
src/views/components/resiSearch.vue

@ -993,6 +993,14 @@ export default {
} else if (val.type === 'building') { } else if (val.type === 'building') {
this.form.buildId = val.id; this.form.buildId = val.id;
await this.handleChangeB(val.id); await this.handleChangeB(val.id);
}else if (val.type === 'grid') {
this.cascaderAgencyId = val.id;
this.optionsV = [];
this.form.villageId = '';
this.form.buildId = '';
this.form.grid = val.id;
this.form.agencyId = val.id;
await this.getValiheList();
} }
}, 300)); // 300ms }, 300)); // 300ms
}, },

5
src/views/modules/base/resi.vue

@ -1221,17 +1221,16 @@ export default {
this.selTreeObj = obj; this.selTreeObj = obj;
await nextTick(1000); await nextTick(1000);
this.$nextTick(async ()=>{ this.$nextTick(async ()=>{
if(obj.level === "building" || obj.level === "neighborHood"){ if(obj.level === "building" || obj.level === "neighborHood"|| obj.level === "grid"){
const gridNode = this.traverseTree([node]); const gridNode = this.traverseTree([node]);
const gridResult = gridNode.find(item => item.level === 'grid'); const gridResult = gridNode.find(item => item.level === 'grid');
const neighborHoodResult = gridNode.find(item => item.level === "neighborHood"); const neighborHoodResult = gridNode.find(item => item.level === "neighborHood");
const buildingResult = gridNode.find(item => item.level === "building"); const buildingResult = gridNode.find(item => item.level === "building");
const gridId = gridResult ? gridResult.id : null; const gridId = gridResult ? gridResult.id : null;
const neighborHoodId = neighborHoodResult ? neighborHoodResult.id : null; const neighborHoodId = neighborHoodResult ? neighborHoodResult.id : null;
const buildingId = buildingResult ? buildingResult.id : null; const buildingId = buildingResult ? buildingResult.id : null;
if (gridId) { if (gridId) {
await this.$EventBus.$emit('handleClickResiTree', { type: 'agency', id: gridId }); await this.$EventBus.$emit('handleClickResiTree', { type: 'grid', id: gridId });
} }
await nextTick(500); await nextTick(500);
if (neighborHoodId) { if (neighborHoodId) {

Loading…
Cancel
Save