Browse Source

处理地址回显

cxmo 7 months ago
parent
commit
d44a8615fb
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/components/searchDistPicker.vue

+ 7 - 0
src/components/searchDistPicker.vue

@@ -106,9 +106,16 @@ export default {
                     }else{
                         this.city = {cityKey:'',cityName:this.cityInfo}
                     }
+                    if(this.city.cityKey){
+                        const areaResult = Object.entries(area_sorce[this.city.cityKey]).find(([key,val])=>val===this.areaInfo)||['',this.areaInfo]
+                        this.area={areaKey:areaResult[0],areaName:areaResult[1]}
+                    }else{
+                        this.area={areaKey:'',areaName:this.areaInfo}
+                    }
                 }else{
                     this.province={provinceKey:'',provinceName:''}
                     this.city={cityKey:'',cityName:''}
+                    this.area={areaKey:'',areaName:''}
                 }
             },
             immediate:true