index.vue 37.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 111 112 113
      <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
114
          placeholder="点击输入设备名称"
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 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
          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
171
                        <div class="no"></div>
172 173 174 175 176 177 178 179
                        <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
180
                        @click.stop="panToo(iten, item)"
181 182 183 184 185 186 187 188 189 190 191
                      >
                        <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
192

193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
                  <!-- 翻页 -->
                  <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>
                  <div style="padding-left: 5px">暂无数据</div>
                </template>
              </div>
            </el-collapse-transition>
          </div>
        </div>
      </div>
纪泽龙's avatar
纪泽龙 committed
223
    </div>
耿迪迪's avatar
耿迪迪 committed
224 225 226
  </div>
</template>
<script>
纪泽龙's avatar
纪泽龙 committed
227
import gaodeMap from "utils/gaodeMap.js";
纪泽龙's avatar
纪泽龙 committed
228
import { pipeAllInfoList } from "@/api/device/pipe.js";
纪泽龙's avatar
纪泽龙 committed
229
import { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMap.js";
纪泽龙's avatar
纪泽龙 committed
230
import { getAllDeviceInfo } from "@/api/device/deviceInfo";
纪泽龙's avatar
纪泽龙 committed
231 232 233 234 235 236 237
export default {
  data() {
    return {
      gaoMap: null,
      deviceType: false,
      value: "",
      operateType: "",
纪泽龙's avatar
纪泽龙 committed
238 239 240
      radio1: "",
      // 1新建,2编辑,3删除,点按钮变色
      targetNum: 0,
241 242 243 244

      backFlag: true,
      // 抽屉内的滚动条的高需要赋值赋值
      boxHeight: "",
245
      boxWidth: "",
纪泽龙's avatar
纪泽龙 committed
246
      drawerOpacity: false,
纪泽龙's avatar
纪泽龙 committed
247
      // 左边的bar的active判定
纪泽龙's avatar
纪泽龙 committed
248
      leftBarNum: [1, 2, 3, 4, 7],
249 250
      // 右转箭头的样式active判定
      arrowRightNum: [],
纪泽龙's avatar
纪泽龙 committed
251 252 253 254 255 256 257 258 259 260

      // 新建里的值
      iconClass: "icon-create",
      createValue: 0,
      createLabel: "新增",
      changeBtnData: [
        {
          value: 1,
          icon: "icon-gd",
          label: "管道",
纪泽龙's avatar
纪泽龙 committed
261 262
          nowPage: 1,
          maxPage: 99,
263
          list: [],
纪泽龙's avatar
纪泽龙 committed
264 265 266 267 268
        },
        {
          value: 2,
          icon: "icon-tyx",
          label: "调压箱",
纪泽龙's avatar
纪泽龙 committed
269 270
          nowPage: 1,
          maxPage: 99,
271
          list: [],
纪泽龙's avatar
纪泽龙 committed
272 273 274 275 276
        },
        {
          value: 3,
          icon: "icon-fmj",
          label: "阀门井",
纪泽龙's avatar
纪泽龙 committed
277 278
          nowPage: 1,
          maxPage: 99,
279
          list: [],
纪泽龙's avatar
纪泽龙 committed
280 281 282 283 284
        },
        {
          value: 4,
          icon: "icon-llj",
          label: "流量计",
纪泽龙's avatar
纪泽龙 committed
285 286
          nowPage: 1,
          maxPage: 99,
287
          list: [],
纪泽龙's avatar
纪泽龙 committed
288 289
        },
        {
290
          value: 7,
纪泽龙's avatar
纪泽龙 committed
291 292
          icon: "icon-ylb",
          label: "压力表",
纪泽龙's avatar
纪泽龙 committed
293 294
          nowPage: 1,
          maxPage: 99,
295
          list: [],
纪泽龙's avatar
纪泽龙 committed
296 297
        },
      ],
纪泽龙's avatar
纪泽龙 committed
298
      allList: [[], [], [], [], []],
纪泽龙's avatar
纪泽龙 committed
299
      keyWord: "",
纪泽龙's avatar
纪泽龙 committed
300 301 302
    };
  },
  mounted() {
303 304 305
    this.onResize();
    window.removeEventListener("resize", this.onResize);
    window.addEventListener("resize", this.onResize);
耿迪迪's avatar
耿迪迪 committed
306
    this.initMap();
纪泽龙's avatar
纪泽龙 committed
307 308
  },
  methods: {
309 310 311 312
    onResize() {
      this.boxHeight = document.body.clientHeight - 81;
      this.boxWidth = document.body.clientWidth - 100;
    },
纪泽龙's avatar
纪泽龙 committed
313
    async initMap() {
耿迪迪's avatar
耿迪迪 committed
314 315
      let gaoMap = new gaodeMap("石家庄");
      this.gaoMap = gaoMap;
316
      this.gaoMap.view = this;
317
      window.removeEventListener("click", this.barClose);
耿迪迪's avatar
耿迪迪 committed
318 319 320
      window.addEventListener("click", this.barClose);
      gaoMap.addMouseTool();
      gaoMap.searchTips("tipinput");
纪泽龙's avatar
纪泽龙 committed
321 322 323
      await this.getDeviceInfo();
      await this.getPipeList();
      this.pipeList();
耿迪迪's avatar
耿迪迪 committed
324
    },
纪泽龙's avatar
纪泽龙 committed
325
    // 左边的Bar修改值
纪泽龙's avatar
纪泽龙 committed
326
    leftBarChange(item) {
纪泽龙's avatar
纪泽龙 committed
327
      // this.leftBarNum= this.leftBarNum != item.value ? item.value:0;
328 329 330 331
      // 关闭infowindow
      this.gaoMap.closeInfoWindow();
      // 恢复颜色
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
332
      const index = this.leftBarNum.indexOf(item.value);
纪泽龙's avatar
纪泽龙 committed
333 334 335 336
      if (index >= 0) {
        this.leftBarNum.splice(index, 1);
      } else {
        this.leftBarNum.push(item.value);
纪泽龙's avatar
纪泽龙 committed
337
        this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
338
      }
纪泽龙's avatar
纪泽龙 committed
339 340 341 342 343
      // 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
344
      } else {
纪泽龙's avatar
纪泽龙 committed
345 346 347 348 349 350
        this.gaoMap.lineShow(false);
      }

      // console.log("marks",this.gaoMap.markers)
      // this.gaoMap.markerShow();
      if (this.leftBarNum.includes(2)) {
纪泽龙's avatar
1  
纪泽龙 committed
351 352 353
        this.gaoMap.markerShow(1, true);
      } else {
        this.gaoMap.markerShow(1, false);
纪泽龙's avatar
纪泽龙 committed
354 355 356
      }

      if (this.leftBarNum.includes(3)) {
纪泽龙's avatar
1  
纪泽龙 committed
357 358 359
        this.gaoMap.markerShow(2, true);
      } else {
        this.gaoMap.markerShow(2, false);
纪泽龙's avatar
纪泽龙 committed
360 361 362
      }

      if (this.leftBarNum.includes(4)) {
纪泽龙's avatar
1  
纪泽龙 committed
363 364 365
        this.gaoMap.markerShow(3, true);
      } else {
        this.gaoMap.markerShow(3, false);
纪泽龙's avatar
纪泽龙 committed
366 367
      }

纪泽龙's avatar
1  
纪泽龙 committed
368 369 370 371
      if (this.leftBarNum.includes(7)) {
        this.gaoMap.markerShow(4, true);
      } else {
        this.gaoMap.markerShow(4, false);
纪泽龙's avatar
纪泽龙 committed
372
      }
纪泽龙's avatar
纪泽龙 committed
373
    },
纪泽龙's avatar
纪泽龙 committed
374
    addDevice() {
纪泽龙's avatar
纪泽龙 committed
375 376 377 378 379 380
      if (this.iconClass == "icon-create") {
        this.targetNum = this.targetNum != 1 ? 1 : 0;
      } else {
        if (this.deviceType) {
          this.targetNum = 0;
          this.createReset();
纪泽龙's avatar
纪泽龙 committed
381
          this.gaoMap.newLineReset();
纪泽龙's avatar
纪泽龙 committed
382 383
        }
      }
纪泽龙's avatar
纪泽龙 committed
384 385
      if (this.targetNum == 1 && this.createValue == 1) {
        this.gaoMap.lineType = 1;
纪泽龙's avatar
纪泽龙 committed
386 387
      } else {
        this.gaoMap.lineType = 0;
纪泽龙's avatar
纪泽龙 committed
388
        this.gaoMap.mouseTool.close();
纪泽龙's avatar
纪泽龙 committed
389
      }
纪泽龙's avatar
纪泽龙 committed
390 391
      // 关闭当前的infowindow
      this.gaoMap.closeInfoWindow();
392 393
      // 清除所有线的颜色
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
394

纪泽龙's avatar
纪泽龙 committed
395
      this.deviceType = !this.deviceType;
纪泽龙's avatar
纪泽龙 committed
396 397
      this.gaoMap.mapOperateType = "add";
      this.gaoMap.removeMarkerDragg();
纪泽龙's avatar
纪泽龙 committed
398
    },
399 400

    // 选择新建项目哪个
纪泽龙's avatar
纪泽龙 committed
401 402
    createChange(e, item) {
      // e.stopPropagation();
纪泽龙's avatar
纪泽龙 committed
403 404 405 406
      this.deviceType = false;
      this.iconClass = item.icon;
      this.createValue = item.value;
      this.createLabel = item.label;
纪泽龙's avatar
1  
纪泽龙 committed
407

纪泽龙's avatar
纪泽龙 committed
408
      if (this.targetNum == 1 && this.createValue == 1) {
纪泽龙's avatar
纪泽龙 committed
409
        // 0是初始,1是新建 2是编辑 3删除
纪泽龙's avatar
纪泽龙 committed
410
        this.gaoMap.lineType = 1;
纪泽龙's avatar
纪泽龙 committed
411
        if (this.gaoMap.newLineObj == null) {
412
          console.log(this.gaoMap.newLineObj);
纪泽龙's avatar
纪泽龙 committed
413 414 415 416 417 418 419 420 421 422
          this.gaoMap.createNewLine();
        }
      } else {
        // 如果不是管道,就归位
        this.gaoMap.lineType = 0;
        // 如果不是管道了,把之前的管道清空
        this.gaoMap.newLineReset();

        // this.createReset();
        // 其他
耿迪迪's avatar
耿迪迪 committed
423
        this.gaoMap.draw(this.createValue.toString());
纪泽龙's avatar
纪泽龙 committed
424
      }
纪泽龙's avatar
纪泽龙 committed
425 426
      // 清空所有正在编辑状态的线
      this.gaoMap.linePolyEditorAllClose();
纪泽龙's avatar
纪泽龙 committed
427 428 429 430 431 432
    },
    // 新建按钮还原
    createReset() {
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
433
      this.gaoMap.closeAddMarker();
纪泽龙's avatar
纪泽龙 committed
434
    },
纪泽龙's avatar
纪泽龙 committed
435
    editDevice() {
纪泽龙's avatar
纪泽龙 committed
436
      this.targetNum = this.targetNum != 2 ? 2 : 0;
纪泽龙's avatar
纪泽龙 committed
437 438
      this.gaoMap.lineType = this.targetNum;
      if (this.targetNum != 2) {
纪泽龙's avatar
纪泽龙 committed
439
        this.gaoMap.linePolyEditorAllClose();
440 441
        this.gaoMap.removeMarkerDragg();
        this.gaoMap.mapOperateType = "normal";
纪泽龙's avatar
1  
纪泽龙 committed
442
      } else {
443 444 445 446 447 448 449
        // 如果正在新建线条,则清空
        this.gaoMap.newLineReset();
        this.deviceType = false;
        this.gaoMap.mapOperateType = "edit";
        this.gaoMap.addMarkerDragg();
        // this.gaoMap.placeSearch.clear();
        this.gaoMap.closeAddMarker();
纪泽龙's avatar
纪泽龙 committed
450
      }
纪泽龙's avatar
1  
纪泽龙 committed
451
      // 关闭当前的infowindow
纪泽龙's avatar
纪泽龙 committed
452
      this.gaoMap.closeInfoWindow();
453 454
      // 清空管道颜色
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
455
      this.createReset();
耿迪迪's avatar
耿迪迪 committed
456
    },
纪泽龙's avatar
纪泽龙 committed
457
    deleteDevice() {
纪泽龙's avatar
纪泽龙 committed
458
      this.targetNum = this.targetNum != 3 ? 3 : 0;
纪泽龙's avatar
纪泽龙 committed
459
      this.gaoMap.lineType = this.targetNum;
460 461 462
      if (this.targetNum != 3) {
        this.gaoMap.removeMarkerDragg();
        this.gaoMap.mapOperateType = "normal";
纪泽龙's avatar
1  
纪泽龙 committed
463
      } else {
464 465 466 467 468 469 470 471 472 473
        // 如果正在新建线条,则清空
        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
474
      // 关闭当前的infowindow
纪泽龙's avatar
纪泽龙 committed
475
      this.gaoMap.closeInfoWindow();
476 477
      // 清空管道颜色
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
478
      this.createReset();
耿迪迪's avatar
耿迪迪 committed
479
    },
纪泽龙's avatar
纪泽龙 committed
480
    selectDeviceType(val) {
纪泽龙's avatar
纪泽龙 committed
481 482 483
      // if("add" == this.operationType){
      this.gaoMap.draw(val);
      // }
纪泽龙's avatar
纪泽龙 committed
484 485 486 487 488 489
      this.deviceType = false;
      this.value = "";
      // 如果选择的是新建管道
      if (val == 1) {
        this.gaoMap.lineType = 1;
        this.gaoMap.createNewLine();
耿迪迪's avatar
耿迪迪 committed
490
      }
纪泽龙's avatar
纪泽龙 committed
491
    },
耿迪迪's avatar
耿迪迪 committed
492
    getDeviceInfo(queryParams) {
耿迪迪's avatar
耿迪迪 committed
493
      this.loading = true;
纪泽龙's avatar
纪泽龙 committed
494
      return getAllDeviceInfo(queryParams).then((response) => {
纪泽龙's avatar
纪泽龙 committed
495
        if (response.code == 200) {
纪泽龙's avatar
纪泽龙 committed
496
          this.deviceClassify(response.data);
纪泽龙's avatar
纪泽龙 committed
497 498 499 500 501 502
          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
503
            }
纪泽龙's avatar
纪泽龙 committed
504 505
            if ("2" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.VALUEWELL, response.data[i]);
耿迪迪's avatar
耿迪迪 committed
506
            }
纪泽龙's avatar
纪泽龙 committed
507 508
            if ("3" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.FLOWMETER, response.data[i]);
耿迪迪's avatar
耿迪迪 committed
509
            }
纪泽龙's avatar
纪泽龙 committed
510 511
            if ("4" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.PRESSUREGAGE, response.data[i]);
512
            }
耿迪迪's avatar
耿迪迪 committed
513 514 515 516
          }
        }
        this.loading = false;
      });
517
    },
耿迪迪's avatar
耿迪迪 committed
518
    getPipeList(queryParams) {
纪泽龙's avatar
纪泽龙 committed
519
      return pipeAllInfoList(queryParams).then((res) => {
纪泽龙's avatar
1  
纪泽龙 committed
520 521
        console.log("管道", res);
        if (res.code == 200) {
纪泽龙's avatar
纪泽龙 committed
522
          this.pipeClassify(res.data);
纪泽龙's avatar
1  
纪泽龙 committed
523 524
          this.gaoMap.addPolyline(res.data);
        }
纪泽龙's avatar
纪泽龙 committed
525 526
      });
    },
纪泽龙's avatar
1  
纪泽龙 committed
527 528 529 530 531 532 533 534 535 536 537
    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";
538
      this.leftBarNum = [1, 2, 3, 4, 7];
纪泽龙's avatar
z  
纪泽龙 committed
539
      // map.remove(this.gaodeMap.markerOverlays);
纪泽龙's avatar
1  
纪泽龙 committed
540
    },
纪泽龙's avatar
纪泽龙 committed
541
    async search() {
纪泽龙's avatar
1  
纪泽龙 committed
542
      this.searchClear();
耿迪迪's avatar
耿迪迪 committed
543
      map.clearMap();
544
      this.gaoMap.placeSearch.clear();
纪泽龙's avatar
1  
纪泽龙 committed
545
      if (!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)) {
耿迪迪's avatar
耿迪迪 committed
546 547
        this.gaoMap.placeSearch.setCity(this.gaoMap.searchSelectAdcode);
        this.gaoMap.placeSearch.search(this.gaoMap.searchSelectName);
纪泽龙's avatar
纪泽龙 committed
548 549
        this.gaoMap.markers = [];
        await this.getDeviceInfo({ deviceName: this.gaoMap.searchSelectName });
耿迪迪's avatar
耿迪迪 committed
550
        this.gaoMap.polyLines = [];
纪泽龙's avatar
纪泽龙 committed
551
        await this.getPipeList({ pipeName: this.gaoMap.searchSelectName });
耿迪迪's avatar
耿迪迪 committed
552 553
        this.gaoMap.searchSelectAdcode = undefined;
        this.gaoMap.searchSelectName = undefined;
纪泽龙's avatar
1  
纪泽龙 committed
554
      } else {
耿迪迪's avatar
耿迪迪 committed
555
        this.gaoMap.placeSearch.search(this.keyWord);
纪泽龙's avatar
纪泽龙 committed
556 557
        this.gaoMap.markers = [];
        await this.getDeviceInfo({ deviceName: this.keyWord });
耿迪迪's avatar
耿迪迪 committed
558
        this.gaoMap.polyLines = [];
纪泽龙's avatar
纪泽龙 committed
559
        await this.getPipeList({ pipeName: this.keyWord });
耿迪迪's avatar
耿迪迪 committed
560
      }
纪泽龙's avatar
纪泽龙 committed
561 562 563 564
      this.changeBtnData.forEach((item) => {
        item.nowPage = 1;
      });
      this.pipeList();
纪泽龙's avatar
纪泽龙 committed
565
    },
纪泽龙's avatar
纪泽龙 committed
566
    // 新建下拉列表关闭 window点击事件
纪泽龙's avatar
纪泽龙 committed
567 568 569
    barClose() {
      console.log("window");
      this.deviceType = false;
纪泽龙's avatar
纪泽龙 committed
570
      // 关闭当前线条的infowindow
571 572 573 574
      // 如果当前状态只有是编辑跟删除状态才会关闭
      if (this.targetNum == 2 || this.targetNum == 3) {
        this.gaoMap.closeInfoWindow();
      }
纪泽龙's avatar
纪泽龙 committed
575
      // 如果没有选择的时候点window 则高亮消失
576
      console.log(this.targetNum);
纪泽龙's avatar
纪泽龙 committed
577 578 579 580
      if (this.targetNum == 1 && this.iconClass == "icon-create") {
        this.targetNum = 0;
      }
      // 辅助新建重新画线
纪泽龙's avatar
纪泽龙 committed
581 582
      // if (!this.gaoMap.lineFlag || this.gaoMap.lineType != 1) return;
      console.log("利用window把lineFlagh恢复");
纪泽龙's avatar
纪泽龙 committed
583
      this.gaoMap.lineFlag = false;
纪泽龙's avatar
纪泽龙 committed
584
      // this.gaoMap.createNewLine();
纪泽龙's avatar
纪泽龙 committed
585
    },
纪泽龙's avatar
1  
纪泽龙 committed
586 587 588 589 590
    refreshMap() {
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
      this.targetNum = 0;
纪泽龙's avatar
纪泽龙 committed
591

耿迪迪's avatar
耿迪迪 committed
592
      map.clearMap();
593
      this.keyWord = "";
纪泽龙's avatar
纪泽龙 committed
594 595 596 597 598 599
      this.arrowRightNum = [];
      this.leftBarNum = [1, 2, 3, 4, 7];
      this.changeBtnData.forEach((item) => {
        item.nowPage = 1;
      });
      this.initMap();
600
    },
601 602 603 604 605 606
    drawerdrawer() {
      // 关闭infowindow
      this.gaoMap.closeInfoWindow();
      // 恢复颜色
      this.gaoMap.polyLinesColorClear();
    },
607 608
    // 向右的箭头的动画
    arrowRightChange(item) {
609 610 611 612
      // 关闭infowindow
      this.gaoMap.closeInfoWindow();
      // 恢复颜色
      this.gaoMap.polyLinesColorClear();
613 614 615 616 617 618
      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
619
    },
纪泽龙's avatar
纪泽龙 committed
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 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

    // 管道储存
    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
740
      this.gaoMap.myMap.setZoom(12);
纪泽龙's avatar
纪泽龙 committed
741 742
      if (item.list.length > 0) {
        if (this.leftBarNum.includes(item.value)) {
纪泽龙's avatar
纪泽龙 committed
743 744 745 746 747 748 749 750 751 752 753 754 755 756
          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
757 758 759 760 761 762 763
        }
      }
    },
    panToo(iten, item) {
      // 如果没打对勾,就啥也不干
      if (!this.leftBarNum.includes(item.value)) return;
      // 如果地图太大了就吸纳是不出来infowindow了,所以要固定缩放比例
764 765 766
      // 所有线条颜色还原
      this.gaoMap.leftListClick = true;
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
767
      this.gaoMap.myMap.setZoom(12);
纪泽龙's avatar
纪泽龙 committed
768 769
      if (item.list.length > 0) {
        if (this.leftBarNum.includes(item.value)) {
770 771 772 773 774
          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
775
            path = [a, b - 0.06];
776 777 778
            // 线条infowindow显示中间,保留六位转换字符串,否则有时候会出现一些问题
            iten.infoPath = [a.toFixed(6), b.toFixed(6)];
          } else {
纪泽龙's avatar
纪泽龙 committed
779
            path = [iten.path[0], iten.path[1] - 0.06];
780 781
          }
          this.gaoMap.panTo(path);
纪泽龙's avatar
纪泽龙 committed
782 783 784 785 786 787 788 789 790 791 792 793 794 795
        }
      }
      // 当前地图中心点
      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);
      }
    },
796

纪泽龙's avatar
纪泽龙 committed
797 798 799 800 801 802 803 804
    // 如果是线条飞过去出现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,
805
        lnglat: iten.infoPath,
纪泽龙's avatar
纪泽龙 committed
806
      };
807
      // console.log(target.getOptions());
纪泽龙's avatar
纪泽龙 committed
808
      // 如果是原地不动,就直接执行
809
      // console.log(iten.infoPath, lng, lat + 0.1);
纪泽龙's avatar
纪泽龙 committed
810

811 812
      // 因为计算问题,误差小于0.00001就没动
      if (
813
        iten.infoPath[0] - lng >= -0.00001 &&
814
        iten.infoPath[0] - lng <= 0.00001 &&
纪泽龙's avatar
纪泽龙 committed
815 816
        iten.infoPath[1] - (lat + 0.06) >= -0.00001 &&
        iten.infoPath[1] - (lat + 0.06) <= 0.00001
817 818
      ) {
        this.gaoMap.leftListClick = false;
819
        target.setOptions({ strokeColor: "#F7FE38" });
820
        this.gaoMap.polylineMouseOver(e);
纪泽龙's avatar
纪泽龙 committed
821 822 823 824 825
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.polylineMouseOver(e);
826
        target.setOptions({ strokeColor: "#F7FE38" });
纪泽龙's avatar
纪泽龙 committed
827 828 829 830 831 832 833 834 835 836 837 838 839
      };
    },
    // 这个是其他设备的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,
      };
      // 如果是原地不动,就直接执行
840
      if (iten.path[0] == lng && iten.path[1] >= lat + 0.06 - 0.000001) {
841
        console.log("9999999999");
纪泽龙's avatar
纪泽龙 committed
842 843 844 845 846 847 848 849
        this.gaoMap.infoOpen(e);
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.infoOpen(e);
      };
    },
纪泽龙's avatar
纪泽龙 committed
850 851 852 853 854
  },

  beforeDestroy() {
    console.log("移除window事件");
    window.removeEventListener("click", this.barClose);
855
    window.removeEventListener("resize", this.onResize);
纪泽龙's avatar
纪泽龙 committed
856 857
  },
};
耿迪迪's avatar
耿迪迪 committed
858
</script>
纪泽龙's avatar
纪泽龙 committed
859 860


耿迪迪's avatar
耿迪迪 committed
861
<style lang="scss" scoped>
862
// 解决地图下拉框
863
#container {
864 865
  position: fixed;
  top: 80px;
866
  bottom: 0;
867 868
  width: 100%;
}
纪泽龙's avatar
纪泽龙 committed
869
// 左边的bar
870

871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923
// .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
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 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

.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
1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031
.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
1032

纪泽龙's avatar
纪泽龙 committed
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052
.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
1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077
// .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
1078

纪泽龙's avatar
纪泽龙 committed
1079 1080 1081 1082 1083
// .btn:hover {
//   color: #fff;
//   background-color: #25a5f7;
//   border-color: #25a5f7;
// }
纪泽龙's avatar
纪泽龙 committed
1084 1085 1086 1087
.input-text {
  width: 4rem;
  margin-right: 1rem;
}
纪泽龙's avatar
纪泽龙 committed
1088
.search-input {
耿迪迪's avatar
耿迪迪 committed
1089
  position: fixed;
1090
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
1091
  left: 7%;
纪泽龙's avatar
纪泽龙 committed
1092
  width: 240px;
1093
}
纪泽龙's avatar
纪泽龙 committed
1094
.search-but {
耿迪迪's avatar
耿迪迪 committed
1095
  position: fixed;
纪泽龙's avatar
纪泽龙 committed
1096
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
1097
  left: 23%;
纪泽龙's avatar
纪泽龙 committed
1098 1099 1100
  width: 85px;
  color: white;
  background-color: #053b6a;
1101
}
耿迪迪's avatar
耿迪迪 committed
1102

纪泽龙's avatar
1  
纪泽龙 committed
1103
.refresh-but {
耿迪迪's avatar
耿迪迪 committed
1104
  position: fixed;
耿迪迪's avatar
耿迪迪 committed
1105
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
1106
  left: 28%;
耿迪迪's avatar
耿迪迪 committed
1107 1108 1109 1110
  width: 85px;
  color: white;
  background-color: #053b6a;
}
1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121

.drawer {
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 100px;
  width: 348px;
  transition: 0.2s linear;
  background: #fff;
  // background: red;
  opacity: 0;
纪泽龙's avatar
纪泽龙 committed
1122
  &.opacity {
1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225
    opacity: 1;
  }
  &.back {
    left: -248px;
  }
  .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;
          color: #053b6a;
          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;
          border-bottom: 1px solid #053b6a;
          color: #053b6a;
          font-weight: 600;
        }
        &.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;
          // border-right: 1px solid #cccccc;
        }
      }
      .no {
纪泽龙's avatar
纪泽龙 committed
1226 1227
        width: 25px;
        font-weight: 700;
1228 1229 1230 1231 1232
      }
      .name {
        // border-right: none;
        flex: 1;
        text-align: center;
1233
        margin-left: 10px;
1234 1235
      }
      .code {
1236
        width: 100px;
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
        text-align: center;
      }
    }
    .box {
      width: 348px;
      height: 48px;
      padding-left: 20px;
      display: flex;
      background-color: #ffffff;
      box-sizing: border-box;
      border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      cursor: pointer;
      position: relative;
      // box-sizing: border-box;
      &.firstbox {
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        // box-sizing: border-box;
        &:hover {
          border-top: 1px solid rgba(5, 59, 106, 0);
        }
      }
      &:hover {
        box-sizing: border-box;
        background-color: rgba(5, 59, 106, 0.1);
        border-bottom: none !important;
      }
      .upPic {
        display: inline-block;
纪泽龙's avatar
纪泽龙 committed
1265
        margin-left: 40px;
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367
        line-height: 48px;
        font-size: 16px;
        color: #053b6a;
      }
      > 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 {
        position: absolute;
        right: 32px;
        top: 16px;
        transition: 0.3s linear;
        &.active {
          transform: rotate(90deg);
        }
      }
      &.active {
        // background-color: #053b6a;
        .left,
        .right {
          color: #053b6a;
        }
        > i {
          color: #053b6a;
        }
      }
      .left {
        color: #053b6a;
        line-height: 48px;
        margin-left: 28px;
        .iconfont {
          font-size: 22px;
        }
      }
      .right {
        color: #1d1d1d;
        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%;
          // width: 14px;
          // height: 14px;
          padding: 2px;
        }
        .btn-w-num {
          display: inline-block;
          font-size: 14px;
          padding: 0px 5px;
        }
      }
    }
  }
  // 开关
  .switch {
    position: absolute;
    font-size: 30px;
    right: -27px;
    top: 50%;
    margin-top: -30px;
    width: 40px;
    border-radius: 40%;
    overflow: hidden;
    cursor: pointer;
    i {
      background: #fff;
    }
  }
}
耿迪迪's avatar
耿迪迪 committed
1368
</style>
耿迪迪's avatar
耿迪迪 committed
1369