index.vue 40.1 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2
<template>
  <div>
3 4 5 6
    <div
      :style="{ height: `${boxHeight}px`, width: `${boxWidth}px` }"
      id="container"
    ></div>
纪泽龙's avatar
纪泽龙 committed
7 8 9 10 11
    <div class="btn-wrapper">
      <div class="myBtn">
        <div
          class="el-btn"
          :class="{ active: targetNum == 1 }"
纪泽龙's avatar
纪泽龙 committed
12
          @click.stop="addDevice"
纪泽龙's avatar
纪泽龙 committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
        >
          <template v-if="iconClass == 'icon-create'">
            <span class="left">
              <i class="iconfont" :class="iconClass" />
            </span>
            <span class="right">{{ createLabel }}</span>
          </template>
          <template v-else>
            <span class="newLetf">{{ createLabel }}</span>
            <span class="newRight">
              <i class="iconfont" :class="iconClass" />
            </span>
          </template>
        </div>
        <div
          class="el-btn"
          :class="{ active: targetNum == 2 }"
纪泽龙's avatar
纪泽龙 committed
30
          @click.stop="editDevice"
纪泽龙's avatar
纪泽龙 committed
31 32 33 34 35 36 37 38 39
        >
          <span class="left">
            <i class="iconfont icon-compile" />
          </span>
          <span class="right">编辑</span>
        </div>
        <div
          class="el-btn"
          :class="{ active: targetNum == 3 }"
纪泽龙's avatar
纪泽龙 committed
40
          @click.stop="deleteDevice"
纪泽龙's avatar
纪泽龙 committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
        >
          <span class="left">
            <i class="iconfont icon-delete" />
          </span>
          <span class="right">删除</span>
        </div>
      </div>

      <div class="animate">
        <el-collapse-transition>
          <div v-show="deviceType">
            <div v-for="item in changeBtnData" :key="item.value" class="option">
              <div
                class="op-btn"
                :class="{ active: item.value == createValue }"
纪泽龙's avatar
纪泽龙 committed
56
                @click.stop="createChange($event, item)"
纪泽龙's avatar
纪泽龙 committed
57 58 59 60 61 62 63 64 65 66 67 68
              >
                <span class="left">
                  <i class="iconfont" :class="item.icon" />
                </span>
                <span class="right">{{ item.label }}</span>
              </div>
            </div>
          </div>
        </el-collapse-transition>
      </div>
    </div>

69
    <!-- <el-input
纪泽龙's avatar
纪泽龙 committed
70 71 72 73 74
      v-model="keyWord"
      placeholder="点击输入"
      id="tipinput"
      class="search-input"
    />
纪泽龙's avatar
1  
纪泽龙 committed
75
    <el-button icon="el-icon-search" class="search-but" @click="search()"
纪泽龙's avatar
纪泽龙 committed
76 77
      >搜索</el-button
    >
纪泽龙's avatar
1  
纪泽龙 committed
78 79
    <el-button icon="el-icon-refresh" class="refresh-but" @click="refreshMap()"
      >重置</el-button
80
    > -->
纪泽龙's avatar
纪泽龙 committed
81

82
    <!-- <div class="leftBar-wrapper">
纪泽龙's avatar
纪泽龙 committed
83 84 85 86
      <div
        v-for="item in changeBtnData"
        :key="item.value"
        class="box"
纪泽龙's avatar
纪泽龙 committed
87
        :class="{ active: leftBarNum.indexOf(item.value) >= 0 }"
纪泽龙's avatar
纪泽龙 committed
88 89 90 91 92 93 94 95
        @click="leftBarChange(item)"
      >
        <div class="left">
          <i class="iconfont" :class="item.icon"></i>
        </div>
        <div class="right">
          {{ item.label }}
        </div>
纪泽龙's avatar
纪泽龙 committed
96
        <i class="el-icon-check"></i>
纪泽龙's avatar
纪泽龙 committed
97
      </div>
98 99
    </div> -->

纪泽龙's avatar
纪泽龙 committed
100 101 102 103
    <div
      ref="drawer"
      class="drawer"
      :class="{ back: backFlag, opacity: drawerOpacity }"
104
      @click.stop="drawerdrawer"
纪泽龙's avatar
纪泽龙 committed
105
    >
106 107 108 109 110
      <div class="mapChange">
        <div :class="{ active: !mapStyle }" @click="mapChange(1)">卫星地图</div>
        <div :class="{ active: mapStyle }" @click="mapChange(2)">全景地图</div>
      </div>

111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
      <div class="pipePressure">
        <!-- <div>管道压力</div> -->
        <div class="hasColorBox" :style="{ color: lineColor[`1`] }">
          <div :style="{ backgroundColor: lineColor[`1`] }"></div>
          低压
        </div>
        <div class="hasColorBox" :style="{ color: lineColor[`2`] }">
          <div :style="{ backgroundColor: lineColor[`2`] }"></div>
          中压
        </div>
        <div class="hasColorBox" :style="{ color: lineColor[`3`] }">
          <div :style="{ backgroundColor: lineColor[`3`] }"></div>
          次高压
        </div>
        <div class="hasColorBox" :style="{ color: lineColor[`4`] }">
          <div :style="{ backgroundColor: lineColor[`4`] }"></div>
          高压
        </div>
      </div>

131 132 133 134 135 136 137 138
      <div class="switch" @click="backFlag = !backFlag">
        <img v-if="!backFlag" src="@/assets/images/l.png" alt="" />
        <img v-else src="@/assets/images/r.png" alt="" />
      </div>
      <!-- 只能动态传入内嵌盒子的高 -->
      <div class="scroll" :style="{ height: `${boxHeight}px` }">
        <el-input
          v-model="keyWord"
纪泽龙's avatar
纪泽龙 committed
139
          placeholder="点击输入设备名称"
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
          id="tipinput"
          class="search-input"
        >
          <template slot="suffix">
            <div @click="search()">
              <i class="iconfont icon-search"></i>
            </div>
          </template>
        </el-input>
        <!-- <el-button class="search-but" @click="search()">搜索</el-button> -->
        <el-button class="refresh-but" @click="refreshMap()">
          <i class="iconfont icon-reset"></i>
        </el-button>

        <div class="leftBar-wrapper">
          <div
            class="box-wrapper"
            v-for="(item, index) in changeBtnData"
            :key="item.value"
          >
            <div
              class="box"
              :class="{
                active: leftBarNum.indexOf(item.value) >= 0,
                firstbox: index == 0,
              }"
              @click.stop="arrowRightChange(item)"
            >
              <span class="upPic"> 上图 </span>
              <div class="left">
                <i class="iconfont" :class="item.icon"></i>
              </div>
              <div class="right">
                {{ item.label }}
              </div>
              <i
                @click.stop="leftBarChange(item)"
                class="el-icon-check bingo"
              ></i>
              <i class="ju"></i>
              <i
                class="arrow-right el-icon-arrow-right"
                :class="{ active: arrowRightNum.indexOf(item.value) >= 0 }"
              ></i>
            </div>
            <el-collapse-transition>
              <div
                class="animate"
                v-show="arrowRightNum.indexOf(item.value) >= 0"
              >
                <!-- 有数据 -->
                <template v-if="item.list.length > 0">
                  <!-- 设备以及管道 展示内容是一样的 -->
                  <template v-if="item.value != 9">
                    <div class="list-wrapper">
                      <div class="thead">
纪泽龙's avatar
纪泽龙 committed
196
                        <div class="no"></div>
197 198 199 200 201 202 203 204
                        <div class="code">设备编号</div>
                        <div class="name">设备名称</div>
                      </div>
                      <div
                        class="deviceList"
                        :class="{ topActive: index == 0 }"
                        v-for="(iten, index) in item.list"
                        :key="iten.deviceId + `` + index"
纪泽龙's avatar
纪泽龙 committed
205
                        @click.stop="panToo(iten, item)"
206 207 208 209 210 211 212 213 214 215 216
                      >
                        <div class="no">{{ iten.no + 1 }}</div>
                        <div :title="iten.code" class="code">
                          {{ iten.code }}
                        </div>
                        <div :title="iten.deviceName" class="name">
                          {{ iten.deviceName }}
                        </div>
                      </div>
                    </div>
                  </template>
纪泽龙's avatar
纪泽龙 committed
217

218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
                  <!-- 翻页 -->
                  <div class="goback">
                    <div class="btn-w">
                      <el-button
                        class="btn backPage"
                        type="mini"
                        :disabled="item.nowPage == 1"
                        @click.stop="pageBack(item, index)"
                        icon="el-icon-arrow-left"
                      />
                      <span class="btn-w-num">{{ item.nowPage }}</span>
                      <el-button
                        class="btn goPage"
                        type="mini"
                        :disabled="item.nowPage == item.maxPage"
                        @click.stop="pageGo(item, index)"
                        icon="el-icon-arrow-right"
                      />
                    </div>
                  </div>
                </template>
                <!-- 无数据 -->
                <template v-else>
241
                  <div style="padding-left: 5px; color: #fff">暂无数据</div>
242 243 244 245 246 247
                </template>
              </div>
            </el-collapse-transition>
          </div>
        </div>
      </div>
纪泽龙's avatar
纪泽龙 committed
248
    </div>
耿迪迪's avatar
耿迪迪 committed
249 250 251
  </div>
</template>
<script>
纪泽龙's avatar
纪泽龙 committed
252
import gaodeMap from "utils/gaodeMap.js";
纪泽龙's avatar
纪泽龙 committed
253
import { pipeAllInfoList } from "@/api/device/pipe.js";
纪泽龙's avatar
纪泽龙 committed
254
import { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMap.js";
纪泽龙's avatar
纪泽龙 committed
255
import { getAllDeviceInfo } from "@/api/device/deviceInfo";
256 257
import { lineColor } from "@/utils/mapCommon.js";

纪泽龙's avatar
纪泽龙 committed
258 259 260 261 262 263 264
export default {
  data() {
    return {
      gaoMap: null,
      deviceType: false,
      value: "",
      operateType: "",
纪泽龙's avatar
纪泽龙 committed
265 266 267
      radio1: "",
      // 1新建,2编辑,3删除,点按钮变色
      targetNum: 0,
268
      lineColor,
269 270

      backFlag: true,
271 272
      // 卫星与全景地图的切换
      mapStyle: true,
273 274
      // 抽屉内的滚动条的高需要赋值赋值
      boxHeight: "",
275
      boxWidth: "",
纪泽龙's avatar
纪泽龙 committed
276
      drawerOpacity: false,
纪泽龙's avatar
纪泽龙 committed
277
      // 左边的bar的active判定
纪泽龙's avatar
纪泽龙 committed
278
      leftBarNum: [1, 2, 3, 4, 7],
279 280
      // 右转箭头的样式active判定
      arrowRightNum: [],
纪泽龙's avatar
纪泽龙 committed
281 282 283 284 285 286 287 288 289 290

      // 新建里的值
      iconClass: "icon-create",
      createValue: 0,
      createLabel: "新增",
      changeBtnData: [
        {
          value: 1,
          icon: "icon-gd",
          label: "管道",
纪泽龙's avatar
纪泽龙 committed
291 292
          nowPage: 1,
          maxPage: 99,
293
          list: [],
纪泽龙's avatar
纪泽龙 committed
294 295 296 297 298
        },
        {
          value: 2,
          icon: "icon-tyx",
          label: "调压箱",
纪泽龙's avatar
纪泽龙 committed
299 300
          nowPage: 1,
          maxPage: 99,
301
          list: [],
纪泽龙's avatar
纪泽龙 committed
302 303 304 305 306
        },
        {
          value: 3,
          icon: "icon-fmj",
          label: "阀门井",
纪泽龙's avatar
纪泽龙 committed
307 308
          nowPage: 1,
          maxPage: 99,
309
          list: [],
纪泽龙's avatar
纪泽龙 committed
310 311 312 313 314
        },
        {
          value: 4,
          icon: "icon-llj",
          label: "流量计",
纪泽龙's avatar
纪泽龙 committed
315 316
          nowPage: 1,
          maxPage: 99,
317
          list: [],
纪泽龙's avatar
纪泽龙 committed
318 319
        },
        {
320
          value: 7,
纪泽龙's avatar
纪泽龙 committed
321 322
          icon: "icon-ylb",
          label: "压力表",
纪泽龙's avatar
纪泽龙 committed
323 324
          nowPage: 1,
          maxPage: 99,
325
          list: [],
纪泽龙's avatar
纪泽龙 committed
326 327
        },
      ],
纪泽龙's avatar
纪泽龙 committed
328
      allList: [[], [], [], [], []],
纪泽龙's avatar
纪泽龙 committed
329
      keyWord: "",
纪泽龙's avatar
纪泽龙 committed
330 331 332
    };
  },
  mounted() {
333 334 335
    this.onResize();
    window.removeEventListener("resize", this.onResize);
    window.addEventListener("resize", this.onResize);
耿迪迪's avatar
耿迪迪 committed
336
    this.initMap();
纪泽龙's avatar
纪泽龙 committed
337 338
  },
  methods: {
339
    onResize() {
340
      this.boxHeight = document.body.clientHeight - 80;
341 342
      this.boxWidth = document.body.clientWidth - 100;
    },
纪泽龙's avatar
纪泽龙 committed
343
    async initMap() {
344
      let gaoMap = new gaodeMap(process.env.VUE_APP_MAP_CENTER);
耿迪迪's avatar
耿迪迪 committed
345
      this.gaoMap = gaoMap;
346
      this.gaoMap.view = this;
347
      window.removeEventListener("click", this.barClose);
耿迪迪's avatar
耿迪迪 committed
348 349 350
      window.addEventListener("click", this.barClose);
      gaoMap.addMouseTool();
      gaoMap.searchTips("tipinput");
纪泽龙's avatar
纪泽龙 committed
351 352 353
      await this.getDeviceInfo();
      await this.getPipeList();
      this.pipeList();
耿迪迪's avatar
耿迪迪 committed
354
    },
纪泽龙's avatar
纪泽龙 committed
355
    // 左边的Bar修改值
纪泽龙's avatar
纪泽龙 committed
356
    leftBarChange(item) {
纪泽龙's avatar
纪泽龙 committed
357
      // this.leftBarNum= this.leftBarNum != item.value ? item.value:0;
358 359 360 361
      // 关闭infowindow
      this.gaoMap.closeInfoWindow();
      // 恢复颜色
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
362
      const index = this.leftBarNum.indexOf(item.value);
纪泽龙's avatar
纪泽龙 committed
363 364 365 366
      if (index >= 0) {
        this.leftBarNum.splice(index, 1);
      } else {
        this.leftBarNum.push(item.value);
纪泽龙's avatar
纪泽龙 committed
367
        this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
368
      }
纪泽龙's avatar
纪泽龙 committed
369 370 371 372 373
      // 1,2,3,4,7分别对应数据库type5,1,2,3,4
      console.log(this.leftBarNum);

      if (this.leftBarNum.includes(1)) {
        this.gaoMap.lineShow(true);
纪泽龙's avatar
1  
纪泽龙 committed
374
      } else {
纪泽龙's avatar
纪泽龙 committed
375 376 377 378 379 380
        this.gaoMap.lineShow(false);
      }

      // console.log("marks",this.gaoMap.markers)
      // this.gaoMap.markerShow();
      if (this.leftBarNum.includes(2)) {
纪泽龙's avatar
1  
纪泽龙 committed
381 382 383
        this.gaoMap.markerShow(1, true);
      } else {
        this.gaoMap.markerShow(1, false);
纪泽龙's avatar
纪泽龙 committed
384 385 386
      }

      if (this.leftBarNum.includes(3)) {
纪泽龙's avatar
1  
纪泽龙 committed
387 388 389
        this.gaoMap.markerShow(2, true);
      } else {
        this.gaoMap.markerShow(2, false);
纪泽龙's avatar
纪泽龙 committed
390 391 392
      }

      if (this.leftBarNum.includes(4)) {
纪泽龙's avatar
1  
纪泽龙 committed
393 394 395
        this.gaoMap.markerShow(3, true);
      } else {
        this.gaoMap.markerShow(3, false);
纪泽龙's avatar
纪泽龙 committed
396 397
      }

纪泽龙's avatar
1  
纪泽龙 committed
398 399 400 401
      if (this.leftBarNum.includes(7)) {
        this.gaoMap.markerShow(4, true);
      } else {
        this.gaoMap.markerShow(4, false);
纪泽龙's avatar
纪泽龙 committed
402
      }
纪泽龙's avatar
纪泽龙 committed
403
    },
404 405 406 407 408 409 410 411 412
    // 卫星地图与全景地图的切换
    mapChange(num) {
      if (num == 1) {
        this.mapStyle = false;
      } else {
        this.mapStyle = true;
      }
      this.gaoMap.changeMap(this.mapStyle);
    },
纪泽龙's avatar
纪泽龙 committed
413
    addDevice() {
纪泽龙's avatar
纪泽龙 committed
414 415 416 417 418 419
      if (this.iconClass == "icon-create") {
        this.targetNum = this.targetNum != 1 ? 1 : 0;
      } else {
        if (this.deviceType) {
          this.targetNum = 0;
          this.createReset();
纪泽龙's avatar
纪泽龙 committed
420
          this.gaoMap.newLineReset();
纪泽龙's avatar
纪泽龙 committed
421 422
        }
      }
纪泽龙's avatar
纪泽龙 committed
423 424
      if (this.targetNum == 1 && this.createValue == 1) {
        this.gaoMap.lineType = 1;
纪泽龙's avatar
纪泽龙 committed
425 426
      } else {
        this.gaoMap.lineType = 0;
纪泽龙's avatar
纪泽龙 committed
427
        this.gaoMap.mouseTool.close();
纪泽龙's avatar
纪泽龙 committed
428
      }
纪泽龙's avatar
纪泽龙 committed
429 430
      // 关闭当前的infowindow
      this.gaoMap.closeInfoWindow();
431 432
      // 清除所有线的颜色
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
433

纪泽龙's avatar
纪泽龙 committed
434
      this.deviceType = !this.deviceType;
纪泽龙's avatar
纪泽龙 committed
435 436
      this.gaoMap.mapOperateType = "add";
      this.gaoMap.removeMarkerDragg();
纪泽龙's avatar
纪泽龙 committed
437
    },
438 439

    // 选择新建项目哪个
纪泽龙's avatar
纪泽龙 committed
440 441
    createChange(e, item) {
      // e.stopPropagation();
纪泽龙's avatar
纪泽龙 committed
442 443 444 445
      this.deviceType = false;
      this.iconClass = item.icon;
      this.createValue = item.value;
      this.createLabel = item.label;
纪泽龙's avatar
1  
纪泽龙 committed
446

纪泽龙's avatar
纪泽龙 committed
447
      if (this.targetNum == 1 && this.createValue == 1) {
纪泽龙's avatar
纪泽龙 committed
448
        // 0是初始,1是新建 2是编辑 3删除
纪泽龙's avatar
纪泽龙 committed
449
        this.gaoMap.lineType = 1;
纪泽龙's avatar
纪泽龙 committed
450
        if (this.gaoMap.newLineObj == null) {
451
          console.log(this.gaoMap.newLineObj);
纪泽龙's avatar
纪泽龙 committed
452 453 454 455 456 457 458 459 460 461
          this.gaoMap.createNewLine();
        }
      } else {
        // 如果不是管道,就归位
        this.gaoMap.lineType = 0;
        // 如果不是管道了,把之前的管道清空
        this.gaoMap.newLineReset();

        // this.createReset();
        // 其他
耿迪迪's avatar
耿迪迪 committed
462
        this.gaoMap.draw(this.createValue.toString());
纪泽龙's avatar
纪泽龙 committed
463
      }
纪泽龙's avatar
纪泽龙 committed
464 465
      // 清空所有正在编辑状态的线
      this.gaoMap.linePolyEditorAllClose();
纪泽龙's avatar
纪泽龙 committed
466 467 468 469 470 471
    },
    // 新建按钮还原
    createReset() {
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
472
      this.gaoMap.closeAddMarker();
纪泽龙's avatar
纪泽龙 committed
473
    },
纪泽龙's avatar
纪泽龙 committed
474
    editDevice() {
纪泽龙's avatar
纪泽龙 committed
475
      this.targetNum = this.targetNum != 2 ? 2 : 0;
纪泽龙's avatar
纪泽龙 committed
476 477
      this.gaoMap.lineType = this.targetNum;
      if (this.targetNum != 2) {
纪泽龙's avatar
纪泽龙 committed
478
        this.gaoMap.linePolyEditorAllClose();
479 480
        this.gaoMap.removeMarkerDragg();
        this.gaoMap.mapOperateType = "normal";
纪泽龙's avatar
1  
纪泽龙 committed
481
      } else {
482 483 484 485 486 487 488
        // 如果正在新建线条,则清空
        this.gaoMap.newLineReset();
        this.deviceType = false;
        this.gaoMap.mapOperateType = "edit";
        this.gaoMap.addMarkerDragg();
        // this.gaoMap.placeSearch.clear();
        this.gaoMap.closeAddMarker();
纪泽龙's avatar
纪泽龙 committed
489
      }
纪泽龙's avatar
1  
纪泽龙 committed
490
      // 关闭当前的infowindow
纪泽龙's avatar
纪泽龙 committed
491
      this.gaoMap.closeInfoWindow();
492 493
      // 清空管道颜色
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
494
      this.createReset();
耿迪迪's avatar
耿迪迪 committed
495
    },
纪泽龙's avatar
纪泽龙 committed
496
    deleteDevice() {
纪泽龙's avatar
纪泽龙 committed
497
      this.targetNum = this.targetNum != 3 ? 3 : 0;
纪泽龙's avatar
纪泽龙 committed
498
      this.gaoMap.lineType = this.targetNum;
499 500 501
      if (this.targetNum != 3) {
        this.gaoMap.removeMarkerDragg();
        this.gaoMap.mapOperateType = "normal";
纪泽龙's avatar
1  
纪泽龙 committed
502
      } else {
503 504 505 506 507 508 509 510 511 512
        // 如果正在新建线条,则清空
        this.gaoMap.newLineReset();
        // 清空所有正在编辑状态的线
        this.gaoMap.linePolyEditorAllClose();
        this.deviceType = false;
        this.gaoMap.mapOperateType = "delete";
        this.gaoMap.removeMarkerDragg();
        //this.gaoMap.placeSearch.clear();
        this.gaoMap.closeAddMarker();
      }
纪泽龙's avatar
1  
纪泽龙 committed
513
      // 关闭当前的infowindow
纪泽龙's avatar
纪泽龙 committed
514
      this.gaoMap.closeInfoWindow();
515 516
      // 清空管道颜色
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
517
      this.createReset();
耿迪迪's avatar
耿迪迪 committed
518
    },
纪泽龙's avatar
纪泽龙 committed
519
    selectDeviceType(val) {
纪泽龙's avatar
纪泽龙 committed
520 521 522
      // if("add" == this.operationType){
      this.gaoMap.draw(val);
      // }
纪泽龙's avatar
纪泽龙 committed
523 524 525 526 527 528
      this.deviceType = false;
      this.value = "";
      // 如果选择的是新建管道
      if (val == 1) {
        this.gaoMap.lineType = 1;
        this.gaoMap.createNewLine();
耿迪迪's avatar
耿迪迪 committed
529
      }
纪泽龙's avatar
纪泽龙 committed
530
    },
耿迪迪's avatar
耿迪迪 committed
531
    getDeviceInfo(queryParams) {
耿迪迪's avatar
耿迪迪 committed
532
      this.loading = true;
纪泽龙's avatar
纪泽龙 committed
533
      return getAllDeviceInfo(queryParams).then((response) => {
纪泽龙's avatar
纪泽龙 committed
534
        if (response.code == 200) {
纪泽龙's avatar
纪泽龙 committed
535
          this.deviceClassify(response.data);
纪泽龙's avatar
纪泽龙 committed
536 537 538 539 540 541
          for (var i = 0; i < response.data.length; i++) {
            if ("1" == response.data[i].deviceType) {
              this.gaoMap.addMarker(
                DEVICE_TYPE.REGEULATORBOX,
                response.data[i]
              );
耿迪迪's avatar
耿迪迪 committed
542
            }
纪泽龙's avatar
纪泽龙 committed
543 544
            if ("2" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.VALUEWELL, response.data[i]);
耿迪迪's avatar
耿迪迪 committed
545
            }
纪泽龙's avatar
纪泽龙 committed
546 547
            if ("3" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.FLOWMETER, response.data[i]);
耿迪迪's avatar
耿迪迪 committed
548
            }
纪泽龙's avatar
纪泽龙 committed
549 550
            if ("4" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.PRESSUREGAGE, response.data[i]);
551
            }
耿迪迪's avatar
耿迪迪 committed
552 553 554 555
          }
        }
        this.loading = false;
      });
556
    },
耿迪迪's avatar
耿迪迪 committed
557
    getPipeList(queryParams) {
纪泽龙's avatar
纪泽龙 committed
558
      return pipeAllInfoList(queryParams).then((res) => {
纪泽龙's avatar
1  
纪泽龙 committed
559 560
        console.log("管道", res);
        if (res.code == 200) {
纪泽龙's avatar
纪泽龙 committed
561
          this.pipeClassify(res.data);
纪泽龙's avatar
1  
纪泽龙 committed
562 563
          this.gaoMap.addPolyline(res.data);
        }
纪泽龙's avatar
纪泽龙 committed
564 565
      });
    },
纪泽龙's avatar
1  
纪泽龙 committed
566 567 568 569 570 571 572 573 574 575 576
    searchClear() {
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
      this.targetNum = 0;
      this.gaoMap.lineType = 0;
      this.gaoMap.newLineReset();
      this.gaoMap.linePolyEditorAllClose();
      this.gaoMap.closeAddMarker();
      this.gaoMap.removeMarkerDragg();
      this.gaoMap.mapOperateType = "normal";
577
      this.leftBarNum = [1, 2, 3, 4, 7];
纪泽龙's avatar
z  
纪泽龙 committed
578
      // map.remove(this.gaodeMap.markerOverlays);
纪泽龙's avatar
1  
纪泽龙 committed
579
    },
纪泽龙's avatar
纪泽龙 committed
580
    async search() {
纪泽龙's avatar
1  
纪泽龙 committed
581
      this.searchClear();
耿迪迪's avatar
耿迪迪 committed
582
      map.clearMap();
583
      this.gaoMap.placeSearch.clear();
纪泽龙's avatar
1  
纪泽龙 committed
584
      if (!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)) {
耿迪迪's avatar
耿迪迪 committed
585 586
        this.gaoMap.placeSearch.setCity(this.gaoMap.searchSelectAdcode);
        this.gaoMap.placeSearch.search(this.gaoMap.searchSelectName);
纪泽龙's avatar
纪泽龙 committed
587 588
        this.gaoMap.markers = [];
        await this.getDeviceInfo({ deviceName: this.gaoMap.searchSelectName });
耿迪迪's avatar
耿迪迪 committed
589
        this.gaoMap.polyLines = [];
纪泽龙's avatar
纪泽龙 committed
590
        await this.getPipeList({ pipeName: this.gaoMap.searchSelectName });
耿迪迪's avatar
耿迪迪 committed
591 592
        this.gaoMap.searchSelectAdcode = undefined;
        this.gaoMap.searchSelectName = undefined;
纪泽龙's avatar
1  
纪泽龙 committed
593
      } else {
耿迪迪's avatar
耿迪迪 committed
594
        this.gaoMap.placeSearch.search(this.keyWord);
纪泽龙's avatar
纪泽龙 committed
595 596
        this.gaoMap.markers = [];
        await this.getDeviceInfo({ deviceName: this.keyWord });
耿迪迪's avatar
耿迪迪 committed
597
        this.gaoMap.polyLines = [];
纪泽龙's avatar
纪泽龙 committed
598
        await this.getPipeList({ pipeName: this.keyWord });
耿迪迪's avatar
耿迪迪 committed
599
      }
纪泽龙's avatar
纪泽龙 committed
600 601 602 603
      this.changeBtnData.forEach((item) => {
        item.nowPage = 1;
      });
      this.pipeList();
纪泽龙's avatar
纪泽龙 committed
604
    },
纪泽龙's avatar
纪泽龙 committed
605
    // 新建下拉列表关闭 window点击事件
纪泽龙's avatar
纪泽龙 committed
606 607 608
    barClose() {
      console.log("window");
      this.deviceType = false;
纪泽龙's avatar
纪泽龙 committed
609
      // 关闭当前线条的infowindow
610 611 612 613
      // 如果当前状态只有是编辑跟删除状态才会关闭
      if (this.targetNum == 2 || this.targetNum == 3) {
        this.gaoMap.closeInfoWindow();
      }
纪泽龙's avatar
纪泽龙 committed
614
      // 如果没有选择的时候点window 则高亮消失
615
      console.log(this.targetNum);
纪泽龙's avatar
纪泽龙 committed
616 617 618 619
      if (this.targetNum == 1 && this.iconClass == "icon-create") {
        this.targetNum = 0;
      }
      // 辅助新建重新画线
纪泽龙's avatar
纪泽龙 committed
620 621
      // if (!this.gaoMap.lineFlag || this.gaoMap.lineType != 1) return;
      console.log("利用window把lineFlagh恢复");
纪泽龙's avatar
纪泽龙 committed
622
      this.gaoMap.lineFlag = false;
纪泽龙's avatar
纪泽龙 committed
623
      // this.gaoMap.createNewLine();
纪泽龙's avatar
纪泽龙 committed
624
    },
纪泽龙's avatar
1  
纪泽龙 committed
625 626 627 628 629
    refreshMap() {
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
      this.targetNum = 0;
纪泽龙's avatar
纪泽龙 committed
630

耿迪迪's avatar
耿迪迪 committed
631
      map.clearMap();
632
      this.keyWord = "";
纪泽龙's avatar
纪泽龙 committed
633 634 635 636 637 638
      this.arrowRightNum = [];
      this.leftBarNum = [1, 2, 3, 4, 7];
      this.changeBtnData.forEach((item) => {
        item.nowPage = 1;
      });
      this.initMap();
639
    },
640 641 642 643 644 645
    drawerdrawer() {
      // 关闭infowindow
      this.gaoMap.closeInfoWindow();
      // 恢复颜色
      this.gaoMap.polyLinesColorClear();
    },
646 647
    // 向右的箭头的动画
    arrowRightChange(item) {
648 649 650 651
      // 关闭infowindow
      this.gaoMap.closeInfoWindow();
      // 恢复颜色
      this.gaoMap.polyLinesColorClear();
652 653 654 655 656 657
      const index = this.arrowRightNum.indexOf(item.value);
      if (index >= 0) {
        this.arrowRightNum.splice(index, 1);
      } else {
        this.arrowRightNum.push(item.value);
      }
纪泽龙's avatar
1  
纪泽龙 committed
658
    },
纪泽龙's avatar
纪泽龙 committed
659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778

    // 管道储存
    pipeClassify(pipeData) {
      const pipeArr = pipeData.map((item, index) => {
        // console.log( '管道路径',eval(item.coordinates )[0])
        return {
          lnglat: eval(item.coordinates)[0],
          path: eval(item.coordinates)[1],
          no: index,
          deviceId: item.pipeId,
          deviceType: "0",
          deviceName: item.pipeName,
          code: item.pipeCode,
        };
      });
      this.allList[0] = pipeArr;
      console.log("管道管道管道管道", pipeArr);
    },
    // 设备分类存储
    deviceClassify(data) {
      // 所有调压箱数据
      const tyxArr = data
        .filter((item) => {
          return item.deviceType == 1;
        })
        .map((item, index) => {
          return {
            path: [item.longitude, item.latitude],
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
          };
        });
      // 所有阀门井数据
      const fmjArr = data
        .filter((item) => {
          return item.deviceType == 2;
        })
        .map((item, index) => {
          return {
            path: [item.longitude, item.latitude],
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
          };
        });
      // 所有流量计数据
      const lljArr = data
        .filter((item) => {
          return item.deviceType == 3;
        })
        .map((item, index) => {
          return {
            path: [item.longitude, item.latitude],
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
          };
        });
      // 所有压力表数据
      const ylbArr = data
        .filter((item) => {
          return item.deviceType == 4;
        })
        .map((item, index) => {
          return {
            path: [item.longitude, item.latitude],
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
          };
        });
      // console.log("设备", tyxArr, fmjArr, lljArr, ylbArr);
      this.allList[1] = tyxArr;
      this.allList[2] = fmjArr;
      this.allList[3] = lljArr;
      this.allList[4] = ylbArr;
    },
    // 左边设备翻页
    pipeList(pageNum) {
      const num = pageNum ? pageNum : 10;
      // const { nowPage } = this.changeBtnData[0];
      // this.changeBtnData[0].list = this.allList[0].filter((item, index) => {
      //   return index >= (nowPage - 1) * num && index < nowPage * num;
      // });
      // console.log(this.changeBtnData[0], this.allList[0]);
      console.log("this.allList[0]", this.allList[0]);
      this.changeBtnData.forEach((item, index) => {
        // console.log("=======", index, this.allList[index]);
        if (this.allList[index]?.length > 0) {
          console.log("大于0");
          item.list = this.allList[index].filter((item2, index2) => {
            return (
              index2 >= (item.nowPage - 1) * num && index2 < item.nowPage * num
            );
          });
          item.maxPage = Math.ceil(this.allList[index].length / num);
        } else {
          // 如果为空,就直接把item.list写成[];
          item.list = [];
        }
      });
    },
    pageBack(item) {
      item.nowPage--;
      this.pipeList();
    },
    pageGo(item) {
      item.nowPage++;
      this.pipeList();
    },
    panTo(item, bool) {
纪泽龙's avatar
纪泽龙 committed
779
      this.gaoMap.myMap.setZoom(12);
纪泽龙's avatar
纪泽龙 committed
780 781
      if (item.list.length > 0) {
        if (this.leftBarNum.includes(item.value)) {
纪泽龙's avatar
纪泽龙 committed
782 783 784 785 786 787 788 789 790 791 792 793 794 795
          let path;
          // 线条
          if (item.value == 1) {
            const a =
              (Number(item.list[0].lnglat[0]) + Number(item.list[0].path[0])) /
              2;
            const b =
              (Number(item.list[0].lnglat[1]) + Number(item.list[0].path[1])) /
              2;
            path = [a, b - 0.06];
          } else {
            path = [item.list[0].path[0], item.list[0].path[1] - 0.06];
          }
          this.gaoMap.panTo(path);
纪泽龙's avatar
纪泽龙 committed
796 797 798 799 800 801 802
        }
      }
    },
    panToo(iten, item) {
      // 如果没打对勾,就啥也不干
      if (!this.leftBarNum.includes(item.value)) return;
      // 如果地图太大了就吸纳是不出来infowindow了,所以要固定缩放比例
803 804 805
      // 所有线条颜色还原
      this.gaoMap.leftListClick = true;
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
806
      this.gaoMap.myMap.setZoom(12);
纪泽龙's avatar
纪泽龙 committed
807 808
      if (item.list.length > 0) {
        if (this.leftBarNum.includes(item.value)) {
809 810 811 812 813
          let path;
          if (item.value == 1) {
            const a = (Number(iten.lnglat[0]) + Number(iten.path[0])) / 2;
            const b = (Number(iten.lnglat[1]) + Number(iten.path[1])) / 2;
            //屏幕移动的位置
纪泽龙's avatar
纪泽龙 committed
814
            path = [a, b - 0.06];
815 816 817
            // 线条infowindow显示中间,保留六位转换字符串,否则有时候会出现一些问题
            iten.infoPath = [a.toFixed(6), b.toFixed(6)];
          } else {
纪泽龙's avatar
纪泽龙 committed
818
            path = [iten.path[0], iten.path[1] - 0.06];
819 820
          }
          this.gaoMap.panTo(path);
纪泽龙's avatar
纪泽龙 committed
821 822 823 824 825 826 827 828 829 830 831 832 833 834
        }
      }
      // 当前地图中心点
      const { lat, lng } = this.gaoMap.myMap.getCenter();
      // 管道是这个方法,因为管道比较特殊
      if (item.value == 1) {
        this.polylineInfoWindowShow(iten, lat, lng);
      } else if (item.value == 9) {
      } else if (item.value == 8) {
      } else {
        // 其他设备
        this.diveceInfoWindowShow(iten, lat, lng);
      }
    },
835

纪泽龙's avatar
纪泽龙 committed
836 837 838 839 840 841 842 843
    // 如果是线条飞过去出现infowindow
    polylineInfoWindowShow(iten, lat, lng) {
      const target = this.gaoMap.polyLines.filter((item) => {
        return item.getExtData().lineData.pipeId == iten.deviceId;
      })[0];
      console.log("target", target);
      const e = {
        target,
844
        lnglat: iten.infoPath,
纪泽龙's avatar
纪泽龙 committed
845
      };
846
      // console.log(target.getOptions());
纪泽龙's avatar
纪泽龙 committed
847
      // 如果是原地不动,就直接执行
848
      // console.log(iten.infoPath, lng, lat + 0.1);
纪泽龙's avatar
纪泽龙 committed
849

850 851
      // 因为计算问题,误差小于0.00001就没动
      if (
852
        iten.infoPath[0] - lng >= -0.00001 &&
853
        iten.infoPath[0] - lng <= 0.00001 &&
纪泽龙's avatar
纪泽龙 committed
854 855
        iten.infoPath[1] - (lat + 0.06) >= -0.00001 &&
        iten.infoPath[1] - (lat + 0.06) <= 0.00001
856 857
      ) {
        this.gaoMap.leftListClick = false;
858
        target.setOptions({ strokeColor: "#F7FE38" });
859
        this.gaoMap.polylineMouseOver(e);
纪泽龙's avatar
纪泽龙 committed
860 861 862 863 864
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.polylineMouseOver(e);
865
        target.setOptions({ strokeColor: "#F7FE38" });
纪泽龙's avatar
纪泽龙 committed
866 867 868 869 870 871 872 873 874 875 876 877 878
      };
    },
    // 这个是其他设备的infowindow
    diveceInfoWindowShow(iten, lat, lng) {
      const target = this.gaoMap.markers.filter((item) => {
        return item.getExtData().deviceId == iten.deviceId;
      })[0];
      console.log("target", target);
      const e = {
        target,
        lnglat: iten.path,
      };
      // 如果是原地不动,就直接执行
879
      if (iten.path[0] == lng && iten.path[1] >= lat + 0.06 - 0.000001) {
880
        console.log("9999999999");
纪泽龙's avatar
纪泽龙 committed
881 882 883 884 885 886 887 888
        this.gaoMap.infoOpen(e);
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.infoOpen(e);
      };
    },
纪泽龙's avatar
纪泽龙 committed
889 890 891 892 893
  },

  beforeDestroy() {
    console.log("移除window事件");
    window.removeEventListener("click", this.barClose);
894
    window.removeEventListener("resize", this.onResize);
895 896 897 898 899 900 901
    // 离开的时候清除创建的元素
    let removeElements = document.getElementsByClassName("el-dialog__wrapper");
    const arr = [...removeElements]
    for(var i =0;i<arr.length;i++){
      const item = arr[i];
      document.body.removeChild(item);
    }
纪泽龙's avatar
纪泽龙 committed
902
  },
903
  destroyed() {},
纪泽龙's avatar
纪泽龙 committed
904
};
耿迪迪's avatar
耿迪迪 committed
905
</script>
纪泽龙's avatar
纪泽龙 committed
906 907


耿迪迪's avatar
耿迪迪 committed
908
<style lang="scss" scoped>
909
// 解决地图下拉框
910
#container {
911 912
  position: fixed;
  top: 80px;
913
  bottom: 0;
914 915
  width: 100%;
}
纪泽龙's avatar
纪泽龙 committed
916
// 左边的bar
917

918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970
// .leftBar-wrapper {
//   position: fixed;
//   left: 100px;
//   top: 150px;
//   .box {
//     width: 180px;
//     height: 48px;
//     display: flex;
//     background-color: #ffffff;
//     box-sizing: border-box;
//     border: 1px solid rgba(0, 0, 0, 0.1);
//     border-top: none;
//     cursor: pointer;
//     position: relative;
//     > i {
//       position: absolute;
//       line-height: 48px;
//       right: 20px;
//       color: #fff;
//     }
//     &:hover {
//       // background-color: #053b6a;
//       // color: #ffffff;
//       // > i {
//       //   color:#fff;
//       // }
//     }
//     &:hover .left,
//     &:hover .right {
//       // color: #ffffff;
//     }
//     &.active {
//       // background-color: #053b6a;
//       .left,
//       .right {
//         color: #053b6a;
//       }
//       > i {
//         color: #053b6a;
//       }
//     }
//     .left {
//       color: #053b6a;
//       line-height: 48px;
//       margin-left: 40px;
//     }
//     .right {
//       color: #1d1d1d;
//       line-height: 48px;
//       margin-left: 20px;
//     }
//   }
// }
纪泽龙's avatar
纪泽龙 committed
971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059

.btn-wrapper {
  position: fixed;
  right: 32px;
  top: 100px;
  .myBtn {
    display: flex;
    justify-content: space-between;
    .el-btn {
      width: 144px;
      height: 44px;
      background-color: #053b6a;
      margin-right: 22px;
      border-radius: 4px;
      text-align: center;
      line-height: 44px;
      color: #fff;
      cursor: pointer;
      font-size: 18px;
      display: flex;
      justify-content: space-between;
      &.active {
        background: #31eaea;
        color: #053b6a !important;
      }
      .left {
        padding-left: 38px;
        i {
          font-size: 18px;
        }
      }
      .right {
        padding-right: 38px;
      }

      .newLetf {
        margin-left: 20px;
      }
      .newRight {
        margin-right: 20px;
        position: relative;
        i {
          position: absolute;
          right: 0px;
          top: 1px;
          font-size: 30px;
        }
      }
    }
  }
  .animate {
    .option {
      .op-btn {
        width: 144px;
        height: 38px;
        border-radius: 0;
        color: #053b6a;
        line-height: 38px;
        background-color: #fff;
        cursor: pointer;
        position: relative;
        border: 1px solid #cccccc;
        border-top: 0;
        &.active {
          background-image: url("../../../assets/images/bac1.png");
        }
        .left {
          position: relative;
          margin-right: 30px;
          margin-left: 22px;
          i {
            position: absolute;
            top: -7px;
            font-size: 20px;
          }
        }
        .right {
          display: inline-block;
          font-size: 14px;
          line-height: 38px;
        }

        &:hover {
          background-image: url("../../../assets/images/bac1.png");
        }
      }
    }
  }
}
纪泽龙's avatar
纪泽龙 committed
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078
.input-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border-radius: 0.25rem;
  width: 22rem;
  border-width: 0;
  border-radius: 0.4rem;
  box-shadow: 0 2px 6px 0 rgba(114, 124, 245, 0.5);
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  padding: 0.75rem 1.25rem;
}
耿迪迪's avatar
耿迪迪 committed
1079

纪泽龙's avatar
纪泽龙 committed
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
.input-item {
  position: relative;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -ms-flex-align: center;
  align-items: center;
  width: 100%;
  height: 2.2rem;
}
input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box;
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  padding: 0;
  margin: 0 0.5rem 0 0;
}
纪泽龙's avatar
纪泽龙 committed
1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124
// .btn {
//   display: inline-block;
//   font-weight: 400;
//   text-align: center;
//   white-space: nowrap;
//   vertical-align: middle;
//   -webkit-user-select: none;
//   -moz-user-select: none;
//   -ms-user-select: none;
//   user-select: none;
//   border: 1px solid transparent;
//   transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
//     border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
//   background-color: transparent;
//   background-image: none;
//   color: #25a5f7;
//   border-color: #25a5f7;
//   padding: 0.25rem 0.5rem;
//   line-height: 1.5;
//   border-radius: 1rem;
//   -webkit-appearance: button;
//   cursor: pointer;
//   width: 6rem;
//   margin: 0 1rem 0 2rem;
// }
耿迪迪's avatar
耿迪迪 committed
1125

纪泽龙's avatar
纪泽龙 committed
1126 1127 1128 1129 1130
// .btn:hover {
//   color: #fff;
//   background-color: #25a5f7;
//   border-color: #25a5f7;
// }
纪泽龙's avatar
纪泽龙 committed
1131 1132 1133 1134
.input-text {
  width: 4rem;
  margin-right: 1rem;
}
纪泽龙's avatar
纪泽龙 committed
1135
.search-input {
耿迪迪's avatar
耿迪迪 committed
1136
  position: fixed;
1137
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
1138
  left: 7%;
纪泽龙's avatar
纪泽龙 committed
1139
  width: 240px;
1140
}
纪泽龙's avatar
纪泽龙 committed
1141
.search-but {
耿迪迪's avatar
耿迪迪 committed
1142
  position: fixed;
纪泽龙's avatar
纪泽龙 committed
1143
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
1144
  left: 23%;
纪泽龙's avatar
纪泽龙 committed
1145 1146 1147
  width: 85px;
  color: white;
  background-color: #053b6a;
1148
}
耿迪迪's avatar
耿迪迪 committed
1149

纪泽龙's avatar
1  
纪泽龙 committed
1150
.refresh-but {
耿迪迪's avatar
耿迪迪 committed
1151
  position: fixed;
耿迪迪's avatar
耿迪迪 committed
1152
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
1153
  left: 28%;
耿迪迪's avatar
耿迪迪 committed
1154 1155 1156 1157
  width: 85px;
  color: white;
  background-color: #053b6a;
}
1158 1159 1160 1161 1162 1163 1164 1165

.drawer {
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 100px;
  width: 348px;
  transition: 0.2s linear;
1166 1167 1168
  // background: #fff;
  background: rgba(6, 29, 51, 0.8);

1169 1170
  // background: red;
  opacity: 0;
纪泽龙's avatar
纪泽龙 committed
1171
  &.opacity {
1172 1173 1174 1175 1176
    opacity: 1;
  }
  &.back {
    left: -248px;
  }
1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194
  .mapChange {
    right: -178px;
    top: 10px;
    color: #fff;
    position: absolute;
    display: flex;
    div {
      padding: 4px 8px;
      border: 1px solid #fff;
      margin-left: 8px;
      cursor: pointer;
      &.active,
      &:hover {
        background-color: #053b6a;
        color: #31eaea;
      }
    }
  }
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212
  .pipePressure {
    position: absolute;
    color: #fff;
    right: -80px;
    top: 50px;
    padding: 1px;
    // background: rgba(6, 29, 51, 0.8);
    .hasColorBox {
      // border: 1px solid #053b6a;
      padding: 2px 5px;
      margin-bottom: 5px;
      & > div {
        display: inline-block;
        width: 10px;
        height: 10px;
      }
    }
  }
1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275
  .scroll {
    // height: 100%;
    position: relative;
    overflow-y: scroll;
    overflow-x: hidden;

    &::-webkit-scrollbar {
      display: none;
    }
    .search-input {
      position: absolute;
      top: 14px;
      left: 39px;
      width: 236px;
      .icon-search {
        line-height: 28px;
        cursor: pointer;
        font-size: 13px;
      }
    }
    .refresh-but {
      // position: fixed;
      position: absolute;
      padding: 0px;
      height: 28px;
      width: 28px;
      top: 14px;
      left: 285px;
      // width: 85px;
      color: white;
      background-color: #053b6a;
      .icon-reset {
        font-size: 13px;
      }
    }
  }

  // 左边的bar
  .leftBar-wrapper {
    // position: fixed;
    width: 340px;
    // margin-left: 20px;
    margin-top: 60px;
    // box-sizing: border-box;
    .box-wrapper {
      width: 340px;
    }
    .animate {
      border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      border-top: none;
      width: 340px;
      .list-wrapper {
        margin-left: 22px;
        padding-top: 8px;
      }
      .thead {
        display: flex;
        font-size: 14px;
        margin-bottom: 8px;
        > div {
          // border-right: 1px solid #cccccc;
          box-sizing: border-box;
          // padding-left: 5px;
1276 1277 1278
          // color: #053b6a;
          color: #fff;

1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
          font-weight: 600;
        }
      }
      .deviceList {
        cursor: pointer;
        margin-bottom: 2px;
        box-sizing: border-box;
        border-bottom: 1px solid #053b6a00;
        color: #1d1d1d;
        &:hover {
          box-sizing: border-box;
1290 1291 1292 1293
          // border-bottom: 1px solid #053b6a;
          border-bottom: 1px solid #7fc0f8;

          // color: #053b6a;
1294
          font-weight: 600;
1295 1296 1297
          > div {
            color: #7fc0f8;
          }
1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313
        }
        &.topActive {
          // border-top: 1px solid #cccccc;
        }
        display: flex;
        // border-bottom: 1px solid #cccccc;
        // justify-content: space-between;
        > div {
          // flex: 1;
          font-size: 14px;
          // border-right: 1px solid #cccccc;
          box-sizing: border-box;
          // padding-left: 5px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
1314 1315
          color: #fff;

1316 1317 1318 1319
          // border-right: 1px solid #cccccc;
        }
      }
      .no {
纪泽龙's avatar
纪泽龙 committed
1320 1321
        width: 25px;
        font-weight: 700;
1322 1323 1324 1325 1326
      }
      .name {
        // border-right: none;
        flex: 1;
        text-align: center;
1327
        margin-left: 10px;
1328 1329
      }
      .code {
1330
        width: 100px;
1331 1332 1333 1334 1335 1336 1337 1338
        text-align: center;
      }
    }
    .box {
      width: 348px;
      height: 48px;
      padding-left: 20px;
      display: flex;
1339
      // background-color: #ffffff;
1340
      box-sizing: border-box;
1341
      border-bottom: 1px solid rgba(0, 0, 0, 0.5);
1342 1343 1344 1345
      cursor: pointer;
      position: relative;
      // box-sizing: border-box;
      &.firstbox {
1346 1347 1348
        // border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-top: 1px solid rgba(5, 59, 106, 0);

1349 1350 1351 1352 1353 1354 1355
        // box-sizing: border-box;
        &:hover {
          border-top: 1px solid rgba(5, 59, 106, 0);
        }
      }
      &:hover {
        box-sizing: border-box;
1356 1357
        // background-color: rgba(5, 59, 106, 0.1);
        background-color: #053b6a;
1358
        border-bottom: none !important;
1359 1360 1361 1362 1363 1364 1365
        .upPic {
          color: #31eaea;
        }
        .left,
        .right {
          color: #31eaea !important;
        }
1366 1367 1368
      }
      .upPic {
        display: inline-block;
纪泽龙's avatar
纪泽龙 committed
1369
        margin-left: 40px;
1370 1371
        line-height: 48px;
        font-size: 16px;
1372 1373
        // color: #053b6a;
        color: #fff;
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396
      }
      > i.ju {
        position: absolute;
        display: inline-block;
        width: 15px;
        height: 15px;
        background: #fff;
        border: 1px solid #cccccc;
        left: 45px;
        top: 16px;
        // top: ;
        z-index: 1;
        border-radius: 2px;
      }
      > i.bingo {
        z-index: 2;
        position: absolute;
        // line-height: 48px;
        left: 45px;
        top: 16px;
        color: #fff;
      }
      > i.arrow-right {
1397
        color: #fff !important;
1398 1399 1400 1401 1402 1403 1404 1405 1406 1407
        position: absolute;
        right: 32px;
        top: 16px;
        transition: 0.3s linear;
        &.active {
          transform: rotate(90deg);
        }
      }
      &.active {
        // background-color: #053b6a;
1408 1409 1410 1411 1412 1413 1414
        // .left,
        // .right {
        //   color: #053b6a;
        // }
        // > i {
        //   color: #053b6a;
        // }
1415
        > i {
1416 1417
          color: #31eaea;
          font-weight: 600;
1418 1419 1420
        }
      }
      .left {
1421 1422
        // color: #053b6a;
        color: #fff;
1423 1424 1425 1426 1427 1428 1429
        line-height: 48px;
        margin-left: 28px;
        .iconfont {
          font-size: 22px;
        }
      }
      .right {
1430 1431
        // color: #1d1d1d;
        color: #fff;
1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451
        line-height: 48px;
        font-size: 16px;
        margin-left: 4px;
      }
    }
    .goback {
      display: flex;
      justify-content: space-between;
      .minMax {
        font-size: 14px;
        line-height: 28px;
        box-sizing: border-box;
        padding-left: 3px;
      }
      .btn-w {
        width: 100%;
        text-align: center;
        padding-bottom: 2px;
        .btn {
          border-radius: 50%;
1452 1453
          background: none;

1454 1455 1456 1457 1458 1459 1460 1461
          // width: 14px;
          // height: 14px;
          padding: 2px;
        }
        .btn-w-num {
          display: inline-block;
          font-size: 14px;
          padding: 0px 5px;
1462
          color: #fff;
1463 1464 1465 1466 1467
        }
      }
    }
  }
  // 开关
1468
  .switch {
1469 1470
    position: absolute;
    font-size: 30px;
1471
    right: -30px;
1472
    top: 50%;
1473
    margin-top: -123px;
1474 1475 1476 1477 1478 1479 1480 1481 1482
    width: 40px;
    border-radius: 40%;
    overflow: hidden;
    cursor: pointer;
    i {
      background: #fff;
    }
  }
}
耿迪迪's avatar
耿迪迪 committed
1483
</style>
耿迪迪's avatar
耿迪迪 committed
1484