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

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

        <div>
54
          <span>设备所在地址:</span>
55
          <span>{{ data.pipeAddr ? data.pipeAddr : "-" }}</span>
56 57 58
        </div>
        <div>
          <span>备注信息:</span>
59
          <span>{{ data.remarks ? data.remarks : "-" }} </span>
60 61 62 63
        </div>
      </div>
    </div>

纪泽龙's avatar
纪泽龙 committed
64 65 66 67 68 69
    <!-- 报警状态 -->
    <div class="warn-wrapper" v-if="true">
      <!-- <div class="warn-content">
        <div>报警状态:<span>报警</span></div>
        <div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
      </div> -->
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115

      <template v-if="data.deviceType == 1 || data.deviceType == 2">
        <div class="windowwarn-content tab" v-if="list.length > 0">
          <div class="foot">
            <div class="thead flex">
              <div class="first">设备名称</div>
              <div>设备状态</div>
              <div>设备浓度</div>
              <div>报警状态</div>
            </div>
            <template v-if="list.length > 0">
              <div
                class="tbody flex"
                v-for="deviceData in list"
                :key="deviceData.a"
              >
                <div class="first zzz">
                  {{ deviceData.a || "-" }}
                </div>
                <div class="">
                  {{ deviceData.b || "-" }}
                </div>
                <div class="">
                  {{ deviceData.c || "-" }}
                </div>
                <div class="">
                  {{ deviceData.d || "-" }}
                </div>
              </div>
            </template>
          </div>
        </div>
        <div v-else class="windowwarn-content tab nomal">暂无设备</div>
      </template>
      <!-- 流量计与压力表 -->
      <template v-if="data.deviceType == 3 || data.deviceType == 4">
        <div
          v-if="data.deviceType == 3"
          class="windowwarn-content"
          style="
            border-bottom: 1px solid #e2e2e2;
            padding: 10px 0 2px 22px;
            height: 150px;
            padding-bottom: 2px;
          "
        >
yaqizhang's avatar
yaqizhang committed
116 117
          <el-col :span="12">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
118
              标况累积量:<span class="standardConditionAccumulation">-</span>
yaqizhang's avatar
yaqizhang committed
119 120 121 122
            </div>
          </el-col>
          <el-col :span="11">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
123
              工况累积量:<span class="workingConditionAccumulation">-</span>
yaqizhang's avatar
yaqizhang committed
124 125 126 127
            </div>
          </el-col>
          <el-col :span="12">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
128
              剩余量:<span class="residualQuantity">-</span>
yaqizhang's avatar
yaqizhang committed
129 130 131 132
            </div>
          </el-col>
          <el-col :span="11">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
133
              标况流量:<span class="standardConditionFlow">-</span>
yaqizhang's avatar
yaqizhang committed
134 135 136 137
            </div>
          </el-col>
          <el-col :span="12">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
138
              工况流量:<span class="workingConditionFlow">-</span>
yaqizhang's avatar
yaqizhang committed
139 140 141 142
            </div>
          </el-col>
          <el-col :span="11">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
143
              温度:<span class="temperature">-</span>
yaqizhang's avatar
yaqizhang committed
144 145 146
            </div>
          </el-col>
          <el-col :span="12">
147
            <div class="windowwarn">压力:<span class="pressure">-</span></div>
yaqizhang's avatar
yaqizhang committed
148 149 150
          </el-col>
          <el-col :span="15">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
151
              上报时间:<span class="reportTime">-</span>
yaqizhang's avatar
yaqizhang committed
152 153 154
            </div>
          </el-col>
        </div>
155 156 157 158 159 160 161 162 163 164
        <div
          v-if="data.deviceType == 4"
          class="windowwarn-content"
          style="
            border-bottom: 1px solid #e2e2e2;
            padding: 10px 0 2px 22px;
            height: 70px;
            padding-bottom: 2px;
          "
        >
yaqizhang's avatar
yaqizhang committed
165
          <el-col :span="24">
166
            <div class="windowwarn">压力:<span class="pressure">-</span></div>
yaqizhang's avatar
yaqizhang committed
167 168 169
          </el-col>
          <el-col :span="24">
            <div class="windowwarn">
yaqizhang's avatar
yaqizhang committed
170
              上报时间:<span class="reportTime">-</span>
yaqizhang's avatar
yaqizhang committed
171 172 173
            </div>
          </el-col>
        </div>
174 175
      </template>

纪泽龙's avatar
纪泽龙 committed
176
      <div class="btn">
纪泽龙's avatar
纪泽龙 committed
177 178 179
        <span @mousedown.stop="deviceMore">
          <el-button class="elbtn" type="primary">设备详情</el-button>
        </span>
纪泽龙's avatar
纪泽龙 committed
180 181 182
        <!-- <el-button class="elbtn" type="primary">生成工单</el-button> -->
      </div>
    </div>
183 184 185 186
  </div>
</template>

<script>
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
let closeInfoWindowTimer = null;
import { getWindowData } from "@/api/dataMonitoring/reportData";
import moment from "moment";
//line移入时的的infowindow
export default {
  props: {
    obj: { typs: Object },
    title: "",
    data: {},
    map: null,
  },
  data() {
    return {
      deviceId: "",
      alarm: {},
      list: [
纪泽龙's avatar
纪泽龙 committed
203 204 205
        { a: "我我我我我我", b: 2, c: 3, d: 4 },
        { a: "我我我我我", b: 2, c: 3, d: 4 },
        { a: "我我我我", b: 2, c: 3, d: 4 },
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
      ],
    };
  },
  mounted() {
    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);

      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);
    }
  },
  methods: {
    moment,
    deviceMore() {
      this.data.class.view.$router.push({
        // path: "/dataMonitoring/realtimedetail",
        path: "/device/deviceInfoDetail",
        query: {
          deviceId: this.data.deviceId,
          // deviceType: this.data.deviceType,
        },
      });
yaqizhang's avatar
yaqizhang committed
238
    },
239 240 241 242
    getDataid() {
      getWindowData(this.data.deviceId).then((response) => {
        this.changeValue(response.data);
      });
yaqizhang's avatar
yaqizhang committed
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
    changeValue(data) {
      const keyArr = Object.keys(data);
      keyArr.forEach((item) => {
        const dw = this.danwei(item);
        const dom = document.getElementsByClassName(item)[0];
        if (dom) {
          dom.innerHTML = data[item] + "&nbsp" + dw;
        }
      });
    },
    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 = " ";
273
      }
274
      return dw;
275
    },
276 277 278
    close() {
      this.map.clearInfoWindow();
      this.data.class.view.domAllShow();
279
    },
280 281
  },
};
282 283 284
</script>

<style lang="scss" scoped>
285 286 287 288 289 290 291 292 293
.windowwarn-content {
  &.tab {
    border-bottom: 1px solid #e2e2e2;
    padding: 10px 5px 2px 5px;
    max-height: 150px;
    padding-bottom: 5px;
    overflow-y: auto;
    &::-webkit-scrollbar {
      display: none; /* Chrome Safari */
294
    }
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
    .foot {
      color: #ffffff;
      .thead,
      .tbody {
        display: flex;
        border: 1px solid #cccccc;
        border-right: none;
        div {
          font-size: 12px !important;
          flex: 1;
          text-align: left;
          border-right: 1px solid #cccccc;
          box-sizing: border-box;
          padding: 0 5px;
        }
        .first {
          flex: 1;
          font-size: 12px !important;
yaqizhang's avatar
yaqizhang committed
313

314 315 316 317
        }
        .last {
          border-right: none;
        }
318
      }
319 320
      .tbody {
        border-top: none;
yaqizhang's avatar
yaqizhang committed
321
      }
322 323 324
      .thead {
        div {
          background-color: rgba(255, 255, 255, 0.1);
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 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381
  }
  // 无设备的样式
  &.nomal {
    text-align: center;
    padding-bottom: 10px;
  }
  div {
    font-size: 14px;
    font-wwight: 400;
    .windowwarn {
      margin-bottom: 7px;
    }
  }
}

.wrapper {
  // width: 406px;
  width: 460px;
  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);
    }
382

383 384 385 386 387 388
    .text {
      font-weight: 600;
      font-size: 16px;
      color: #ffffff;
      line-height: 51px;
    }
yaqizhang's avatar
yaqizhang committed
389

390 391 392
    .left {
      padding-left: 22px;
    }
yaqizhang's avatar
yaqizhang committed
393

394 395
    .right {
      padding-right: 22px;
yaqizhang's avatar
yaqizhang committed
396

397 398
      img {
        cursor: pointer;
399 400
      }
    }
401
  }
yaqizhang's avatar
yaqizhang committed
402

403 404 405 406 407 408 409 410 411 412
  .content {
    position: relative;
    max-height: 300px;
    overflow: hidden;
    overflow-y: auto;
    padding-bottom: 2px;
    border-bottom: 1px solid #eeeeee;

    .eq-content {
      // min-height: 156px;
纪泽龙's avatar
纪泽龙 committed
413
      box-sizing: border-box;
414
      padding: 13px 22px 0px 22px;
yaqizhang's avatar
yaqizhang committed
415 416

      // border-bottom: 1px solid #e2e2e2;
417 418
      .text-wrapper {
        padding-top: 1px;
yaqizhang's avatar
yaqizhang committed
419

420 421
        & > div {
          margin-bottom: 6px;
yaqizhang's avatar
yaqizhang committed
422 423
        }

424
        .eq-text {
yaqizhang's avatar
yaqizhang committed
425 426
          font-size: 14px;
          font-weight: 400;
427 428 429 430 431 432 433 434 435 436 437 438 439
          // 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;
          }
yaqizhang's avatar
yaqizhang committed
440 441 442
        }
      }

443 444 445
      .pic {
        width: 180px;
        height: 103px;
yaqizhang's avatar
yaqizhang committed
446

447 448 449 450 451
        // background-color: black;
        img {
          width: 100%;
          height: 100%;
          // cursor: pointer;
yaqizhang's avatar
yaqizhang committed
452
        }
纪泽龙's avatar
纪泽龙 committed
453
      }
454 455
    }
  }
yaqizhang's avatar
yaqizhang committed
456

457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
  .maintain-content {
    width: 100%;
    max-height: 119px;
    padding-left: 22px;
    // padding-right: 22px;
    // padding-bottom: 10px;
    // padding-top: 16px;
    box-sizing: border-box;

    // border-bottom: 1px solid #e2e2e2;
    & > div {
      margin-bottom: 8px;
      font-size: 14px;
      font-weight: 400;

      span {
        vertical-align: top;
        display: inline-block;
        word-break: break-all;
        max-width: 280px;
      }
    }
  }

  .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;
yaqizhang's avatar
yaqizhang committed
498

499 500 501 502 503 504 505
      .elbtn {
        background-color: #053b6a;
        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
        width: 95px;
        height: 33px;
      }
    }
yaqizhang's avatar
yaqizhang committed
506
  }
507 508 509 510 511 512 513 514 515
}

.wrapperEditorPage {
}

.display-default {
  display: flex;
  justify-content: space-between;
}
yaqizhang's avatar
yaqizhang committed
516
</style>