南昌市物联网技防平台-前端
shuishen
2021-04-23 e2ed7cb4ef578d970beca80aea4903e9b13cd1f8
src/views/dataL/dataL.vue
@@ -8,11 +8,25 @@
              {{ name.length > 14 ? name.substr(0, 14) + "···" : name }}
            </p>
            <div class="l-t-state">
              <!-- dataState: ["掉线", "在线", "故障", "预警"],
                if (s != "") {
                    states = "故障";
                  } else {
                    if (j != 1) {
                      if (o == 1) {
                        states = "在线";
                      } else {
                        states = "掉线";
                      }
                    } else {
                      states = "预警";
                    }
                  }-->
              <span
                :class="{
                  'l-t-s-grey': state == dataState[0],
                  'l-t-s-green': state == dataState[1],
                  'l-t-s-yewllo': state == dataState[3],
                  'l-t-s-yewllo': state == dataState[2],
                  'l-t-s-red': state == dataState[3],
                  'l-t-s-yuan': true,
                }"
@@ -468,7 +482,7 @@
      <div class="r-one">
        <div class="r-heard">
          <div class="r-heard-top">部署信息</div>
          <button @click="modifyl" class="r-but-top">修改</button>
          <!-- <button @click="modifyl" class="r-but-top">修改</button> -->
        </div>
        <div class="r-body">
          <div class="r-b-top">
@@ -951,25 +965,24 @@
        var data = res.data.data.records[0];
        var setimgl = null;
        //插入图片api获取图片
// this.stetDetails(data);
        getImg(imgdadta,'post').then((res) => {
        // this.stetDetails(data);
        getImg(imgdadta, "post").then((res) => {
          // console.log(res.data.data.length != 0)
          var imgdatas = [];
          if(res.data.data.length != 0){
            imgdatas = res.data.data[0].paddress.split(',');
          }else{
          if (res.data.data.length != 0) {
            imgdatas = res.data.data[0].paddress.split(",");
          } else {
          }
          // console.log(imgdatas);
          // imgdatas = [ //最多5张照片
      //   "https://resource-city.sensoro.com/B8D675A3C4F71C5C8DE2FD764881BE57",
      //   "https://resource-city.sensoro.com/B8D675A3C4F71C5C8DE2FD764881BE57",
      //   "https://resource-city.sensoro.com/B8D675A3C4F71C5C8DE2FD764881BE57",
          // imgdatas = [ //最多5张照片
          //   "https://resource-city.sensoro.com/B8D675A3C4F71C5C8DE2FD764881BE57",
          //   "https://resource-city.sensoro.com/B8D675A3C4F71C5C8DE2FD764881BE57",
          //   "https://resource-city.sensoro.com/B8D675A3C4F71C5C8DE2FD764881BE57",
      //   "https://resource-city.sensoro.com/1723C1A66DB44F792564F3648E5AA1EE",
        // "https://web.byisf.com/minio/jfpt/upload/depl/ad049799e7024c529b9c890d3ba434bc.JPEG",
      // ];
          setimgl =  imgdatas.length == 0? ['no'] : imgdatas;
          //   "https://resource-city.sensoro.com/1723C1A66DB44F792564F3648E5AA1EE",
          // "https://web.byisf.com/minio/jfpt/upload/depl/ad049799e7024c529b9c890d3ba434bc.JPEG",
          // ];
          setimgl = imgdatas.length == 0 ? ["no"] : imgdatas;
          this.stetDetails(data, setimgl);
        });
        // console.log(data);
@@ -988,16 +1001,34 @@
        o = this.a.onlineStatus,
        s = this.a.state,
        j = this.a.jtype;
      if (o == 0) {
        states = "掉线";
      } else if (o == 1) {
        states = "在线";
      } else if (s != "") {
      // if (o == 0) {
      //   states = "掉线";
      // } else if (o == 1) {
      //   states = "在线";
      // } else if (s != "") {
      //   states = "故障";
      // } else if (j != 2) {
      //   states = "预警";
      // }
      if (s != "") {
        states = "故障";
      } else if (j != 2) {
        states = "预警";
      } else {
        if (j != 1) {
          if (o == 1) {
            states = "在线";
          } else {
            states = "掉线";
          }
        } else {
          states = "预警";
        }
      }
      this.state = "无数据" && states;
      // console.log(o, 1000);
      // console.log(s, 1000);
      // console.log(j, 1000);
      // console.log(states, 1000);
      this.state =  states;
      this.evaluate = "空气质量";
      this.machineCode = "无数据" && this.a.deviceNumber;
@@ -1254,16 +1285,16 @@
              border: 1px solid transparent;
            }
            .l-t-s-grey {
              background-color: rgb(187, 187, 187);
              background-color: #CDCDCD;
            }
            .l-t-s-green {
              background-color: rgb(41, 202, 135);
              background-color: #32C1A2;
            }
            .l-t-s-yewllo {
              background-color: rgb(240, 181, 20);
              background-color: #F49966;
            }
            .l-t-s-red {
              background-color: rgba(247, 28, 28, 0.877);
              background-color: #F35B5B;
            }
          }
        }