南昌市物联网技防平台-前端
Administrator
2021-04-26 6ea9d061b33f9e411bb847ffcf7dd7908ba508a9
src/views/system/cs.vue
@@ -714,6 +714,9 @@
      // form是表单或者表格绑定的数据集,v-model='form'
      handler(val) {
        if (val) {
          getDetail(this.form.id).then((res) => {
            this.form = res.data.data;
          })
          this.form.wd = val.latitude;
          this.form.jd = val.longitude;
          //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
@@ -724,6 +727,10 @@
          if(address.search("区") != -1){
            this.form.address = address.substring(address.indexOf("区")+1,address.length);
          }
          //写入新的省市区
          that.form.province = val.addressComponent.province;
          that.form.city = val.addressComponent.city;
          that.form.district = val.addressComponent.district;
        }
      },
      immediate: true,