南昌市物联网技防平台-前端
Administrator
2021-05-10 b921db470a289d3a5bdf2db8d60e6e5e6b4b5973
src/views/system/cs.vue
@@ -177,7 +177,7 @@
      datas: [], //cc
      loadings: true, //等待
      querys: {}, //搜索
      isEdit:false,
      isEdit: false,
      pages: {
        pageSize: 10,
        currentPage: 1,
@@ -728,7 +728,7 @@
      // form是表单或者表格绑定的数据集,v-model='form'
      handler(val) {
        if (val) {
          if(that.isEdit){
          if (that.isEdit) {
            getDetail(this.form.id).then((res) => {
              this.form = res.data.data;
              this.form.wd = val.latitude;
@@ -905,7 +905,7 @@
    },
    beforeOpen(done, type) {
      if (["edit"].includes(type)) {
        that.isEdit=true;
        that.isEdit = true;
        getDetail(this.form.id).then((res) => {
          if (this.form.type == "1") {
            const data = res.data.data;
@@ -1000,7 +1000,7 @@
      }
      if (["edit"].includes(type)) {
        that.isEdit=false;
        that.isEdit = false;
      }
      done();
    },
@@ -1154,19 +1154,29 @@
      if (dat.length > 0) {
        for (var key in dat) {
          let states;
          if (dat[key].state != "") {
            states = "故障";
          } else {
            if (dat[key].jtype != 1) {
              if (dat[key].onlineStatus == 1) {
                states = "在线";
              } else {
                states = "掉线";
              }
            } else {
              states = "预警";
            }
          }
          // if (dat[key].state != "") {
          //   states = "故障";
          // } else {
          //   if (dat[key].jtype != 1) {
          //     if (dat[key].onlineStatus == 1) {
          //       states = "在线";
          //     } else {
          //       states = "掉线";
          //     }
          //   } else {
          //     states = "预警";
          //   }
          // }
          states =
            dat[key].dtype == 0
              ? "掉线"
              : dat[key].dtype == 1
              ? "正常"
              : dat[key].dtype == 2
              ? "预警"
              : dat[key].dtype == 3
              ? "故障"
              : "";
          // console.log(states);
          dat[key].states = states;
          dat[key].stateSevicestate =