南昌市物联网技防平台-前端
liuyg
2021-05-06 338deda86b1496870cd843e0bff835de897c3fb2
src/views/system/cs.vue
@@ -177,6 +177,7 @@
      datas: [], //cc
      loadings: true, //等待
      querys: {}, //搜索
      isEdit:false,
      pages: {
        pageSize: 10,
        currentPage: 1,
@@ -727,11 +728,13 @@
      // 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;
          if(that.isEdit){
            getDetail(this.form.id).then((res) => {
              this.form = res.data.data;
              this.form.wd = val.latitude;
              this.form.jd = val.longitude;
            });
          }
          //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
          var address = val.formattedAddress.toString();
          if (address.search("县") != -1) {
@@ -902,6 +905,7 @@
    },
    beforeOpen(done, type) {
      if (["edit"].includes(type)) {
        that.isEdit=true;
        getDetail(this.form.id).then((res) => {
          if (this.form.type == "1") {
            const data = res.data.data;
@@ -994,6 +998,10 @@
          }
        });
      }
      if (["edit"].includes(type)) {
        that.isEdit=false;
      }
      done();
    },
    searchReset() {