markerInfoWindow.vue 10.8 KB
Newer Older
1 2 3 4
<template>
  <div class="wrapper">
    <span class="dot-left"></span>
    <div class="top display-default">
5
      <div class="left text ddd" :title="data.deviceName">{{ data.deviceName }}</div>
6
      <div class="right text">
7
        <img src="../../assets/images/closeBtn.png" alt="" @click="close" />
8 9 10
      </div>
    </div>
    <!-- 设备信息 -->
纪泽龙's avatar
纪泽龙 committed
11
    <div class="content  scrollStyle">
12 13
      <div class="eq-content display-default">
        <div class="text-wrapper">
纪泽龙's avatar
纪泽龙 committed
14
          <div class="eq-text">
yaqizhang's avatar
yaqizhang committed
15
            设备类型:<span>{{ title ? title : "-"  }}</span>
纪泽龙's avatar
纪泽龙 committed
16 17
          </div>
          <div class="eq-text">
yaqizhang's avatar
yaqizhang committed
18
            设备型号:<span>{{ data.deviceModel ? data.deviceModel : "-"  }}</span>
纪泽龙's avatar
纪泽龙 committed
19 20
          </div>
          <div class="eq-text">
yaqizhang's avatar
yaqizhang committed
21
            所属管道:<span>{{ data.pipeName ? data.pipeName : "-"  }}</span>
纪泽龙's avatar
纪泽龙 committed
22 23
          </div>
          <div class="eq-text">
yaqizhang's avatar
yaqizhang committed
24
            物联网编号:<span>{{ data.iotNo ? data.iotNo : "-" }}</span>
纪泽龙's avatar
纪泽龙 committed
25
          </div>
26 27 28 29 30 31
        </div>
        <div class="pic">
          <img v-bind:src="data.iconUrl" alt="" />
        </div>
      </div>
      <!-- 维修人员 -->
纪泽龙's avatar
纪泽龙 committed
32
      <div class="maintain-content">
33 34 35
        <el-col :span="11">
          <div>
            <span>安装日期:</span>
纪泽龙's avatar
纪泽龙 committed
36 37 38
            <span>{{
              moment(data.installationTime).format("YYYY-MM-DD")
            }}</span>
39 40 41 42 43 44
          </div>
        </el-col>

        <el-col :span="13">
          <div>
            <span>最后巡检日期:</span>
纪泽龙's avatar
纪泽龙 committed
45
            <span>{{ data.inspectionTime ? data.inspectionTime : "-" }}</span>
46 47 48 49
          </div>
        </el-col>

        <div>
50
          <span>设备所在地址:</span>
yaqizhang's avatar
yaqizhang committed
51
          <span>{{ data.pipeAddr ? data.pipeAddr : "-"}}</span>
52 53 54
        </div>
        <div>
          <span>备注信息:</span>
yaqizhang's avatar
yaqizhang committed
55
          <span>{{ data.remarks ? data.remarks : "-"}} </span>
56 57 58 59
        </div>
      </div>
    </div>

纪泽龙's avatar
纪泽龙 committed
60 61 62 63 64 65
    <!-- 报警状态 -->
    <div class="warn-wrapper" v-if="true">
      <!-- <div class="warn-content">
        <div>报警状态:<span>报警</span></div>
        <div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
      </div> -->
66
      <template v-if="data.deviceType ==3 || data.deviceType==4">
yaqizhang's avatar
yaqizhang committed
67
        <div v-if="data.deviceType==3" class="windowwarn-content" style="
68 69 70 71
          border-bottom: 1px solid #e2e2e2;
          padding: 10px 0 2px 22px;
          height: 150px;padding-bottom: 2px;
          ">
yaqizhang's avatar
yaqizhang committed
72 73
          <el-col :span="12">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
74
              标况累积量:<span class="standardConditionAccumulation">-</span>
yaqizhang's avatar
yaqizhang committed
75 76 77 78
            </div>
          </el-col>
          <el-col :span="11">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
79
              工况累积量:<span class="workingConditionAccumulation">-</span>
yaqizhang's avatar
yaqizhang committed
80 81 82 83
            </div>
          </el-col>
          <el-col :span="12">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
84
              剩余量:<span class="residualQuantity">-</span>
yaqizhang's avatar
yaqizhang committed
85 86 87 88
            </div>
          </el-col>
          <el-col :span="11">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
89
              标况流量:<span class="standardConditionFlow">-</span>
yaqizhang's avatar
yaqizhang committed
90 91 92 93
            </div>
          </el-col>
          <el-col :span="12">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
94
              工况流量:<span class="workingConditionFlow">-</span>
yaqizhang's avatar
yaqizhang committed
95 96 97 98
            </div>
          </el-col>
          <el-col :span="11">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
99
              温度:<span class="temperature">-</span>
yaqizhang's avatar
yaqizhang committed
100 101 102 103
            </div>
          </el-col>
          <el-col :span="12">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
104
              压力:<span class="pressure">-</span>
yaqizhang's avatar
yaqizhang committed
105 106 107 108
            </div>
          </el-col>
          <el-col :span="15">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
109
              上报时间:<span class="reportTime">-</span>
yaqizhang's avatar
yaqizhang committed
110 111 112 113
            </div>
          </el-col>
        </div>
        <div v-if="data.deviceType==4" class="windowwarn-content" style="
114 115
          border-bottom: 1px solid #e2e2e2;
          padding: 10px 0 2px 22px;
yaqizhang's avatar
yaqizhang committed
116
          height: 70px;padding-bottom: 2px;
117
          ">
yaqizhang's avatar
yaqizhang committed
118 119
          <el-col :span="24">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
120
              压力:<span class="pressure">-</span>
yaqizhang's avatar
yaqizhang committed
121 122 123 124
            </div>
          </el-col>
          <el-col :span="24">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
125
              上报时间:<span class="reportTime">-</span>
yaqizhang's avatar
yaqizhang committed
126 127 128
            </div>
          </el-col>
        </div>
129 130 131
      </template>


纪泽龙's avatar
纪泽龙 committed
132
      <div class="btn">
纪泽龙's avatar
纪泽龙 committed
133 134 135
        <span @mousedown.stop="deviceMore">
          <el-button class="elbtn" type="primary">设备详情</el-button>
        </span>
纪泽龙's avatar
纪泽龙 committed
136 137 138
        <!-- <el-button class="elbtn" type="primary">生成工单</el-button> -->
      </div>
    </div>
139 140 141 142
  </div>
</template>

<script>
yaqizhang's avatar
yaqizhang committed
143
  let closeInfoWindowTimer = null;
144
  import { getWindowData } from "@/api/dataMonitoring/reportData";
yaqizhang's avatar
yaqizhang committed
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
  import moment from "moment";
  //line移入时的的infowindow
  export default {
    props: {
      obj: { typs: Object },
      title: "",
      data: {},
      map: null,
    },
    data() {
      return {
        deviceId: "",
        alarm: {},
      }
    },
    mounted() {
161 162 163 164 165 166
      clearInterval(this.data.class.view.deviceTimer);


      if (this.data.deviceType == 3 || this.data.deviceType == 4) {
        this.getDataid();
        this.data.class.view.deviceTimer = setInterval(this.getDataid, 5000);
yaqizhang's avatar
yaqizhang committed
167 168 169 170 171 172 173 174 175 176

        closeInfoWindowTimer = setInterval(() => {
          const dom= document.getElementsByClassName("amap-info")[0];
          const disPlay =dom?.style.display;
          if (!dom || (dom && disPlay == "none")) {
            clearInterval(this.data.class.view.deviceTimer)
            clearInterval(closeInfoWindowTimer)
            console.log("请求关闭")
          }
        }, 1000)
177 178 179
      }

    },
yaqizhang's avatar
yaqizhang committed
180 181 182 183 184 185 186 187 188 189 190 191 192
    methods: {
      moment,
      deviceMore() {
        this.data.class.view.$router.push({
          // path: "/dataMonitoring/realtimedetail",
          path: "/device/deviceInfoDetail",
          query: {
            deviceId: this.data.deviceId,
            // deviceType: this.data.deviceType,
          },
        });
      },
      getDataid() {
yaqizhang's avatar
yaqizhang committed
193
        getWindowData(this.data.deviceId).then(response => {
194 195 196 197 198 199 200
          this.changeValue(response.data)

        })
      },
      changeValue(data) {
        const keyArr = Object.keys(data);
        keyArr.forEach((item) => {
yaqizhang's avatar
yaqizhang committed
201
          const dw = this.danwei(item)
202
          const dom = document.getElementsByClassName(item)[0];
yaqizhang's avatar
yaqizhang committed
203
          if (dom) {
yaqizhang's avatar
yaqizhang committed
204
            dom.innerHTML = data[item] +"&nbsp"+ dw;
205 206 207
          }
        })
      },
yaqizhang's avatar
yaqizhang committed
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
      danwei(item) {
        let dw='';
        if(item =='standardConditionAccumulation' || item == 'workingConditionAccumulation' || item == 'residualQuantity'){
          dw="m³"
        }else if(item =='standardConditionFlow'|| item == 'workingConditionFlow'){
          dw="m³/h"
        }else if(item =='temperature'){
          dw="℃"
        }else if(item == 'pressure'){
          dw="KPa"
        }else if(item == 'reportTime'){
          dw=" "
        }
        return dw;
      } ,
      close() {
        this.map.clearInfoWindow();
        this.data.class.view.domAllShow()
      },
227
    },
yaqizhang's avatar
yaqizhang committed
228
  };
229 230 231
</script>

<style lang="scss" scoped>
yaqizhang's avatar
yaqizhang committed
232 233
  .windowwarn-content {
    div {
234 235
      font-size: 14px;
      font-wwight: 400;
yaqizhang's avatar
yaqizhang committed
236 237

      .windowwarn {
238 239 240 241
        margin-bottom: 7px;
      }
    }
  }
yaqizhang's avatar
yaqizhang committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279

  .wrapper {
    width: 406px;
    max-height: 600px;
    // background: #fff;
    border-radius: 4px;
    background: rgba(7, 29, 51, 0.9);
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
    color: #fff;

    // overflow: hidden;
    .top {
      width: 100%;
      height: 51px;
      // background-color: #053b6a;
      background-image: url(../../assets/images/blueTopBg.png);
      background-size: 100% 100%;
      background-position: center;

      &:before {
        // content: "";
        // position: absolute;
        // left: -20px;
        // top: 5px;
        // width: 0px;
        // height: 0px;
        // z-index:-1;
        // border-top: 15px solid transparent;
        // border-bottom: 15px solid transparent;
        // border-right: 30px solid #053b6a;
        content: "";
        position: absolute;
        left: -20px;
        top: 5px;
        z-index: -1;
        width: 33px;
        height: 33px;
        background-image: url(../../assets/images/blueLeftTriangle.png);
280
      }
yaqizhang's avatar
yaqizhang committed
281 282 283 284 285 286

      .text {
        font-weight: 600;
        font-size: 16px;
        color: #ffffff;
        line-height: 51px;
287
      }
yaqizhang's avatar
yaqizhang committed
288 289 290 291 292 293 294 295

      .left {
        padding-left: 22px;
      }

      .right {
        padding-right: 22px;

296
        img {
yaqizhang's avatar
yaqizhang committed
297
          cursor: pointer;
298 299 300 301
        }
      }
    }

yaqizhang's avatar
yaqizhang committed
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
    .content {
      position: relative;
      max-height: 300px;
      overflow: hidden;
      overflow-y: auto;
      padding-bottom: 2px;
      border-bottom: 1px solid #eeeeee;

      .eq-content {
        // min-height: 156px;
        box-sizing: border-box;
        padding: 13px 22px 0px 22px;

        // border-bottom: 1px solid #e2e2e2;
        .text-wrapper {
          padding-top: 1px;

          &>div {
            margin-bottom: 6px;
          }

          .eq-text {
            font-size: 14px;
            font-weight: 400;
            // color: #1d1d1d;
            color: #fff;
            opacity: 1;

            &>span {
              vertical-align: top;
              display: inline-block;
              // white-space: nowrap;
              // text-overflow: ellipsis;
              // overflow: hidden;
              word-break: break-all;
              max-width: 100px;
            }
          }
        }

        .pic {
          width: 180px;
          height: 103px;

          // background-color: black;
          img {
            width: 100%;
            height: 100%;
            // cursor: pointer;
          }
        }
353 354
      }
    }
yaqizhang's avatar
yaqizhang committed
355 356 357 358 359 360 361 362

    .maintain-content {
      width: 100%;
      max-height: 119px;
      padding-left: 22px;
      // padding-right: 22px;
      // padding-bottom: 10px;
      // padding-top: 16px;
纪泽龙's avatar
纪泽龙 committed
363
      box-sizing: border-box;
yaqizhang's avatar
yaqizhang committed
364 365 366 367

      // border-bottom: 1px solid #e2e2e2;
      &>div {
        margin-bottom: 8px;
纪泽龙's avatar
纪泽龙 committed
368 369
        font-size: 14px;
        font-weight: 400;
yaqizhang's avatar
yaqizhang committed
370 371 372 373 374 375 376

        span {
          vertical-align: top;
          display: inline-block;
          word-break: break-all;
          max-width: 280px;
        }
纪泽龙's avatar
纪泽龙 committed
377
      }
378
    }
yaqizhang's avatar
yaqizhang committed
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403

    .warn-wrapper {
      .warn-content {
        box-sizing: border-box;
        padding: 10px 0 2px 22px;
        border-bottom: 1px solid #e2e2e2;
        color: #fe5966;

        &>div {
          font-size: 14px;
          font-weight: 400;
          margin-bottom: 8px;
        }
      }

      .btn {
        padding: 16px 0;
        text-align: center;

        .elbtn {
          background-color: #053b6a;
          box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
          width: 95px;
          height: 33px;
        }
纪泽龙's avatar
纪泽龙 committed
404
      }
405 406
    }
  }
yaqizhang's avatar
yaqizhang committed
407 408 409 410 411 412 413 414

  .wrapperEditorPage {}

  .display-default {
    display: flex;
    justify-content: space-between;
  }
</style>