index.vue 28.7 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2
<template>
  <div>
纪泽龙's avatar
纪泽龙 committed
3
    <div style="width: 100vw; height: 100vh" id="container"></div>
纪泽龙's avatar
纪泽龙 committed
4 5 6 7 8
    <div class="btn-wrapper">
      <div class="myBtn">
        <div
          class="el-btn"
          :class="{ active: targetNum == 1 }"
纪泽龙's avatar
纪泽龙 committed
9
          @click.stop="addDevice"
纪泽龙's avatar
纪泽龙 committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
        >
          <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
27
          @click.stop="editDevice"
纪泽龙's avatar
纪泽龙 committed
28 29 30 31 32 33 34 35 36
        >
          <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
37
          @click.stop="deleteDevice"
纪泽龙's avatar
纪泽龙 committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
        >
          <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
53
                @click.stop="createChange($event, item)"
纪泽龙's avatar
纪泽龙 committed
54 55 56 57 58 59 60 61 62 63 64 65
              >
                <span class="left">
                  <i class="iconfont" :class="item.icon" />
                </span>
                <span class="right">{{ item.label }}</span>
              </div>
            </div>
          </div>
        </el-collapse-transition>
      </div>
    </div>

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

79
    <!-- <div class="leftBar-wrapper">
纪泽龙's avatar
纪泽龙 committed
80 81 82 83
      <div
        v-for="item in changeBtnData"
        :key="item.value"
        class="box"
纪泽龙's avatar
纪泽龙 committed
84
        :class="{ active: leftBarNum.indexOf(item.value) >= 0 }"
纪泽龙's avatar
纪泽龙 committed
85 86 87 88 89 90 91 92
        @click="leftBarChange(item)"
      >
        <div class="left">
          <i class="iconfont" :class="item.icon"></i>
        </div>
        <div class="right">
          {{ item.label }}
        </div>
纪泽龙's avatar
纪泽龙 committed
93
        <i class="el-icon-check"></i>
纪泽龙's avatar
纪泽龙 committed
94
      </div>
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 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 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 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 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
    </div> -->

    <div ref="drawer" class="drawer" :class="{ back: backFlag,opacity: drawerOpacity }">
      <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"
          placeholder="点击输入"
          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">
                        <div class="no">序号</div>
                        <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"
                        @mousedown.stop="panToo(iten, item)"
                      >
                        <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>
                  <!-- 值班人员 展示不太一样-->
                  <template v-else-if="item.value == 9">
                    <div class="list-wrapper">
                      <div class="thead">
                        <div class="no">序号</div>
                        <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"
                        @click.stop="panToo(iten, item)"
                      >
                        <div class="no">{{ iten.no + 1 }}</div>
                        <div :title="iten.userName" class="code">
                          {{ iten.userName }}
                        </div>
                        <div :title="iten.userPhone" class="name">
                          {{ iten.userPhone ? iten.userPhone : "-" }}
                        </div>
                      </div>
                    </div>
                  </template>
                  <!-- 翻页 -->
                  <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
239
    </div>
耿迪迪's avatar
耿迪迪 committed
240 241 242
  </div>
</template>
<script>
纪泽龙's avatar
纪泽龙 committed
243
import gaodeMap from "utils/gaodeMap.js";
纪泽龙's avatar
纪泽龙 committed
244
import { pipeAllInfoList } from "@/api/device/pipe.js";
纪泽龙's avatar
纪泽龙 committed
245
import { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMap.js";
纪泽龙's avatar
纪泽龙 committed
246
import { getAllDeviceInfo } from "@/api/device/deviceInfo";
纪泽龙's avatar
纪泽龙 committed
247 248 249 250 251 252 253
export default {
  data() {
    return {
      gaoMap: null,
      deviceType: false,
      value: "",
      operateType: "",
纪泽龙's avatar
纪泽龙 committed
254 255 256
      radio1: "",
      // 1新建,2编辑,3删除,点按钮变色
      targetNum: 0,
257 258 259 260 261

      backFlag: true,
      // 抽屉内的滚动条的高需要赋值赋值
      boxHeight: "",
      drawerOpacity:false,
纪泽龙's avatar
纪泽龙 committed
262
      // 左边的bar的active判定
纪泽龙's avatar
纪泽龙 committed
263
      leftBarNum: [1, 2, 3, 4, 7],
264 265
      // 右转箭头的样式active判定
      arrowRightNum: [],
纪泽龙's avatar
纪泽龙 committed
266 267 268 269 270 271 272 273 274 275

      // 新建里的值
      iconClass: "icon-create",
      createValue: 0,
      createLabel: "新增",
      changeBtnData: [
        {
          value: 1,
          icon: "icon-gd",
          label: "管道",
276
          list: [],
纪泽龙's avatar
纪泽龙 committed
277 278 279 280 281
        },
        {
          value: 2,
          icon: "icon-tyx",
          label: "调压箱",
282
          list: [],
纪泽龙's avatar
纪泽龙 committed
283 284 285 286 287
        },
        {
          value: 3,
          icon: "icon-fmj",
          label: "阀门井",
288
          list: [],
纪泽龙's avatar
纪泽龙 committed
289 290 291 292 293
        },
        {
          value: 4,
          icon: "icon-llj",
          label: "流量计",
294
          list: [],
纪泽龙's avatar
纪泽龙 committed
295 296
        },
        {
297
          value: 7,
纪泽龙's avatar
纪泽龙 committed
298 299
          icon: "icon-ylb",
          label: "压力表",
300
          list: [],
纪泽龙's avatar
纪泽龙 committed
301 302
        },
      ],
纪泽龙's avatar
纪泽龙 committed
303
      keyWord: "",
纪泽龙's avatar
纪泽龙 committed
304 305 306
    };
  },
  mounted() {
耿迪迪's avatar
耿迪迪 committed
307
    this.initMap();
308
    this.boxHeight = document.body.clientHeight - 81;
纪泽龙's avatar
纪泽龙 committed
309 310
  },
  methods: {
纪泽龙's avatar
1  
纪泽龙 committed
311
    initMap() {
耿迪迪's avatar
耿迪迪 committed
312 313
      let gaoMap = new gaodeMap("石家庄");
      this.gaoMap = gaoMap;
314
      this.gaoMap.view = this;
耿迪迪's avatar
耿迪迪 committed
315 316 317 318 319 320
      window.addEventListener("click", this.barClose);
      gaoMap.addMouseTool();
      gaoMap.searchTips("tipinput");
      this.getDeviceInfo();
      this.getPipeList();
    },
纪泽龙's avatar
纪泽龙 committed
321
    // 左边的Bar修改值
纪泽龙's avatar
纪泽龙 committed
322
    leftBarChange(item) {
纪泽龙's avatar
纪泽龙 committed
323
      // this.leftBarNum= this.leftBarNum != item.value ? item.value:0;
纪泽龙's avatar
1  
纪泽龙 committed
324

纪泽龙's avatar
纪泽龙 committed
325
      const index = this.leftBarNum.indexOf(item.value);
纪泽龙's avatar
纪泽龙 committed
326 327 328 329
      if (index >= 0) {
        this.leftBarNum.splice(index, 1);
      } else {
        this.leftBarNum.push(item.value);
纪泽龙's avatar
纪泽龙 committed
330
      }
纪泽龙's avatar
纪泽龙 committed
331 332 333 334 335
      // 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
336
      } else {
纪泽龙's avatar
纪泽龙 committed
337 338 339 340 341 342
        this.gaoMap.lineShow(false);
      }

      // console.log("marks",this.gaoMap.markers)
      // this.gaoMap.markerShow();
      if (this.leftBarNum.includes(2)) {
纪泽龙's avatar
1  
纪泽龙 committed
343 344 345
        this.gaoMap.markerShow(1, true);
      } else {
        this.gaoMap.markerShow(1, false);
纪泽龙's avatar
纪泽龙 committed
346 347 348
      }

      if (this.leftBarNum.includes(3)) {
纪泽龙's avatar
1  
纪泽龙 committed
349 350 351
        this.gaoMap.markerShow(2, true);
      } else {
        this.gaoMap.markerShow(2, false);
纪泽龙's avatar
纪泽龙 committed
352 353 354
      }

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

纪泽龙's avatar
1  
纪泽龙 committed
360 361 362 363
      if (this.leftBarNum.includes(7)) {
        this.gaoMap.markerShow(4, true);
      } else {
        this.gaoMap.markerShow(4, false);
纪泽龙's avatar
纪泽龙 committed
364
      }
纪泽龙's avatar
纪泽龙 committed
365
    },
纪泽龙's avatar
纪泽龙 committed
366
    addDevice() {
纪泽龙's avatar
纪泽龙 committed
367 368 369 370 371 372
      if (this.iconClass == "icon-create") {
        this.targetNum = this.targetNum != 1 ? 1 : 0;
      } else {
        if (this.deviceType) {
          this.targetNum = 0;
          this.createReset();
纪泽龙's avatar
纪泽龙 committed
373
          this.gaoMap.newLineReset();
纪泽龙's avatar
纪泽龙 committed
374 375
        }
      }
纪泽龙's avatar
纪泽龙 committed
376 377
      if (this.targetNum == 1 && this.createValue == 1) {
        this.gaoMap.lineType = 1;
纪泽龙's avatar
纪泽龙 committed
378 379
      } else {
        this.gaoMap.lineType = 0;
纪泽龙's avatar
纪泽龙 committed
380
        this.gaoMap.mouseTool.close();
纪泽龙's avatar
纪泽龙 committed
381
      }
纪泽龙's avatar
纪泽龙 committed
382 383
      // 关闭当前的infowindow
      this.gaoMap.closeInfoWindow();
纪泽龙's avatar
纪泽龙 committed
384

纪泽龙's avatar
纪泽龙 committed
385
      this.deviceType = !this.deviceType;
纪泽龙's avatar
纪泽龙 committed
386 387
      this.gaoMap.mapOperateType = "add";
      this.gaoMap.removeMarkerDragg();
纪泽龙's avatar
纪泽龙 committed
388
    },
389 390

    // 选择新建项目哪个
纪泽龙's avatar
纪泽龙 committed
391 392
    createChange(e, item) {
      // e.stopPropagation();
纪泽龙's avatar
纪泽龙 committed
393 394 395 396
      this.deviceType = false;
      this.iconClass = item.icon;
      this.createValue = item.value;
      this.createLabel = item.label;
纪泽龙's avatar
1  
纪泽龙 committed
397

纪泽龙's avatar
纪泽龙 committed
398
      if (this.targetNum == 1 && this.createValue == 1) {
纪泽龙's avatar
纪泽龙 committed
399
        // 0是初始,1是新建 2是编辑 3删除
纪泽龙's avatar
纪泽龙 committed
400
        this.gaoMap.lineType = 1;
纪泽龙's avatar
纪泽龙 committed
401 402 403 404 405 406 407 408 409 410 411
        if (this.gaoMap.newLineObj == null) {
          this.gaoMap.createNewLine();
        }
      } else {
        // 如果不是管道,就归位
        this.gaoMap.lineType = 0;
        // 如果不是管道了,把之前的管道清空
        this.gaoMap.newLineReset();

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

    // 向右的箭头的动画
    arrowRightChange(item) {
      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
578
    },
纪泽龙's avatar
纪泽龙 committed
579 580 581 582 583
  },

  beforeDestroy() {
    console.log("移除window事件");
    window.removeEventListener("click", this.barClose);
纪泽龙's avatar
纪泽龙 committed
584 585
  },
};
耿迪迪's avatar
耿迪迪 committed
586
</script>
纪泽龙's avatar
纪泽龙 committed
587 588


耿迪迪's avatar
耿迪迪 committed
589
<style lang="scss" scoped>
590
// 解决地图下拉框
591
#container {
592 593
  position: fixed;
  top: 80px;
594
  bottom: 0;
595 596
  width: 100%;
}
纪泽龙's avatar
纪泽龙 committed
597
// 左边的bar
598

599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 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
// .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
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 740

.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
741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759
.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
760

纪泽龙's avatar
纪泽龙 committed
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805
.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;
}
.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
806

纪泽龙's avatar
纪泽龙 committed
807 808 809 810 811 812 813 814 815
.btn:hover {
  color: #fff;
  background-color: #25a5f7;
  border-color: #25a5f7;
}
.input-text {
  width: 4rem;
  margin-right: 1rem;
}
纪泽龙's avatar
纪泽龙 committed
816
.search-input {
耿迪迪's avatar
耿迪迪 committed
817
  position: fixed;
818
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
819
  left: 7%;
纪泽龙's avatar
纪泽龙 committed
820
  width: 240px;
821
}
纪泽龙's avatar
纪泽龙 committed
822
.search-but {
耿迪迪's avatar
耿迪迪 committed
823
  position: fixed;
纪泽龙's avatar
纪泽龙 committed
824
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
825
  left: 23%;
纪泽龙's avatar
纪泽龙 committed
826 827 828
  width: 85px;
  color: white;
  background-color: #053b6a;
829
}
耿迪迪's avatar
耿迪迪 committed
830

纪泽龙's avatar
1  
纪泽龙 committed
831
.refresh-but {
耿迪迪's avatar
耿迪迪 committed
832
  position: fixed;
耿迪迪's avatar
耿迪迪 committed
833
  top: 100px;
耿迪迪's avatar
耿迪迪 committed
834
  left: 28%;
耿迪迪's avatar
耿迪迪 committed
835 836 837 838
  width: 85px;
  color: white;
  background-color: #053b6a;
}
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 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 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

.drawer {
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 100px;
  width: 348px;
  transition: 0.2s linear;
  background: #fff;
  // background: red;
  opacity: 0;
  &.opacity{
    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 {
        width: 50px;
      }
      .name {
        // border-right: none;
        flex: 1;
        text-align: center;
      }
      .code {
        width: 112px;
        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
991
        margin-left: 40px;
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 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
        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
1094
</style>
耿迪迪's avatar
耿迪迪 committed
1095