index.vue 54.8 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
    <div v-show="false" class="btn-wrapper">
纪泽龙's avatar
纪泽龙 committed
8 9 10 11
      <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>

纪泽龙's avatar
纪泽龙 committed
69 70 71 72 73 74
    <RightBototmData
      v-show="bottomDataShow"
      :class="{ classShow: !bottomDataShow }"
      ref="RightBototmData"
      :list="rightBototmData"
    />
纪泽龙's avatar
纪泽龙 committed
75
    <!-- 报警工单 -->
76 77 78 79 80
    <CreateWork
      ref="CreateWork"
      :open="createWorkOpen"
      @callback="CreateWorkCallBack"
    />
纪泽龙's avatar
纪泽龙 committed
81
    <!-- 隐患工单 -->
纪泽龙's avatar
纪泽龙 committed
82
    <CreateWorkTrouble
纪泽龙's avatar
纪泽龙 committed
83 84 85
      ref="CreateWorkTrouble"
      :open="createWorkTroubleOpen"
      @callback="CreateWorkTroubleCallBack"
纪泽龙's avatar
纪泽龙 committed
86
    />
纪泽龙's avatar
纪泽龙 committed
87

88 89 90 91
    <div
      ref="drawer"
      class="drawer"
      :class="{ back: backFlag, opacity: drawerOpacity }"
92
      @click.stop="drawerClick"
93
    >
纪泽龙's avatar
纪泽龙 committed
94
      <div class="switch" @click="backFlag = !backFlag">
纪泽龙's avatar
纪泽龙 committed
95 96
        <img v-if="!backFlag" src="@/assets/images/l.png" alt="" />
        <img v-else src="@/assets/images/r.png" alt="" />
纪泽龙's avatar
纪泽龙 committed
97 98 99 100 101
      </div>
      <!-- 只能动态传入内嵌盒子的高 -->
      <div class="scroll" :style="{ height: `${boxHeight}px` }">
        <el-input
          v-model="keyWord"
纪泽龙's avatar
纪泽龙 committed
102
          placeholder="点击输入设备名称"
纪泽龙's avatar
纪泽龙 committed
103 104
          id="tipinput"
          class="search-input"
105 106 107 108 109 110 111 112 113 114 115
        >
          <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>
纪泽龙's avatar
纪泽龙 committed
116 117 118 119 120 121 122 123 124 125 126 127 128

        <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,
              }"
129
              @click="arrowRightChange(item)"
纪泽龙's avatar
纪泽龙 committed
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
            >
              <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"
              >
纪泽龙's avatar
纪泽龙 committed
153 154 155
                <!-- 有数据 -->
                <template v-if="item.list.length > 0">
                  <!-- 设备以及管道 展示内容是一样的 -->
纪泽龙's avatar
纪泽龙 committed
156
                  <template v-if="item.value != 8 && item.value != 9">
157
                    <div class="list-wrapper">
纪泽龙's avatar
纪泽龙 committed
158
                      <div class="thead">
纪泽龙's avatar
纪泽龙 committed
159
                        <div class="no"></div>
纪泽龙's avatar
纪泽龙 committed
160 161 162 163 164 165
                        <div class="code">设备编号</div>
                        <div class="name">设备名称</div>
                      </div>
                      <div
                        class="deviceList"
                        v-for="(iten, index) in item.list"
166 167 168 169
                        :class="{
                          topActive: index == 0,
                          textRed: iten.alarmState == 1,
                        }"
纪泽龙's avatar
纪泽龙 committed
170
                        :key="iten.deviceId + `` + index"
171
                        @click.stop="panToo(iten, item)"
纪泽龙's avatar
纪泽龙 committed
172
                      >
173 174 175
                        <div class="no">
                          {{ iten.no + 1 }}
                        </div>
纪泽龙's avatar
纪泽龙 committed
176 177 178 179 180 181 182
                        <div :title="iten.code" class="code">
                          {{ iten.code }}
                        </div>
                        <div :title="iten.deviceName" class="name">
                          {{ iten.deviceName }}
                        </div>
                      </div>
纪泽龙's avatar
纪泽龙 committed
183
                    </div>
纪泽龙's avatar
纪泽龙 committed
184
                  </template>
纪泽龙's avatar
纪泽龙 committed
185 186 187 188
                  <!-- 隐患的展示 -->
                  <template v-else-if="item.value == 8">
                    <div class="list-wrapper">
                      <div class="thead">
纪泽龙's avatar
纪泽龙 committed
189
                        <div class="no"></div>
纪泽龙's avatar
纪泽龙 committed
190 191 192 193 194 195 196 197
                        <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"
198
                        @click.stop="panToo(iten, item)"
纪泽龙's avatar
纪泽龙 committed
199 200 201 202 203 204 205 206 207 208 209
                      >
                        <div class="no">{{ iten.no + 1 }}</div>
                        <div :title="iten.troubleLevel" class="code">
                          {{ iten.troubleLevel }}
                        </div>
                        <div :title="iten.troubleName" class="name">
                          {{ iten.troubleName }}
                        </div>
                      </div>
                    </div>
                  </template>
纪泽龙's avatar
纪泽龙 committed
210 211
                  <!-- 值班人员 展示不太一样-->
                  <template v-else-if="item.value == 9">
212
                    <div class="list-wrapper">
纪泽龙's avatar
纪泽龙 committed
213
                      <div class="thead">
纪泽龙's avatar
纪泽龙 committed
214
                        <div class="no"></div>
纪泽龙's avatar
纪泽龙 committed
215 216 217 218 219 220 221 222
                        <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"
223
                        @click.stop="panToo(iten, item)"
纪泽龙's avatar
纪泽龙 committed
224 225 226 227 228 229 230 231
                      >
                        <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>
纪泽龙's avatar
纪泽龙 committed
232 233
                      </div>
                    </div>
纪泽龙's avatar
纪泽龙 committed
234
                  </template>
纪泽龙's avatar
纪泽龙 committed
235

236
                  <!-- 翻页 -->
纪泽龙's avatar
纪泽龙 committed
237
                  <div class="goback">
238
                    <div class="btn-w">
纪泽龙's avatar
纪泽龙 committed
239
                      <el-button
240
                        class="btn backPage"
纪泽龙's avatar
纪泽龙 committed
241 242
                        type="mini"
                        :disabled="item.nowPage == 1"
纪泽龙's avatar
纪泽龙 committed
243
                        @click="pageBack(item, index)"
244 245 246
                        icon="el-icon-arrow-left"
                      />
                      <span class="btn-w-num">{{ item.nowPage }}</span>
纪泽龙's avatar
纪泽龙 committed
247
                      <el-button
248
                        class="btn goPage"
纪泽龙's avatar
纪泽龙 committed
249 250
                        type="mini"
                        :disabled="item.nowPage == item.maxPage"
纪泽龙's avatar
纪泽龙 committed
251
                        @click="pageGo(item, index)"
252 253
                        icon="el-icon-arrow-right"
                      />
纪泽龙's avatar
纪泽龙 committed
254 255
                    </div>
                  </div>
256
                </template>
纪泽龙's avatar
纪泽龙 committed
257 258 259 260
                <!-- 无数据 -->
                <template v-else>
                  <div style="padding-left: 5px">暂无数据</div>
                </template>
纪泽龙's avatar
纪泽龙 committed
261 262 263 264 265 266
              </div>
            </el-collapse-transition>
          </div>
        </div>
      </div>
    </div>
耿迪迪's avatar
耿迪迪 committed
267 268 269
  </div>
</template>
<script>
纪泽龙's avatar
纪泽龙 committed
270 271
// import  from "utils/gaodeMapView.js";
import { pipeAllInfoList, countPipeLength } from "@/api/device/pipe.js";
纪泽龙's avatar
纪泽龙 committed
272 273 274 275 276
import gaodeMap, {
  map,
  DEVICE_TYPE,
  mapOperateType,
} from "utils/gaodeMapView.js";
277

纪泽龙's avatar
纪泽龙 committed
278
import { selectAlarmDevice } from "@/api/dataMonitoring/deviceAlarm.js";
纪泽龙's avatar
纪泽龙 committed
279
import { getAllDeviceInfo, countDeviceByType } from "@/api/device/deviceInfo";
280
import { getMapHiddenTroublelist } from "@/api/riskManagement/hiddenTrouble";
纪泽龙's avatar
纪泽龙 committed
281
import RightBototmData from "./components/RightBototmData.vue";
纪泽龙's avatar
纪泽龙 committed
282
import CreateWork from "./components/CreateWork.vue";
纪泽龙's avatar
纪泽龙 committed
283
import CreateWorkTrouble from "./components/CreateWorkTrouble.vue";
纪泽龙's avatar
纪泽龙 committed
284
import { getInspectorLocations } from "@/api/inspectorLocation/location";
纪泽龙's avatar
纪泽龙 committed
285

纪泽龙's avatar
纪泽龙 committed
286
export default {
纪泽龙's avatar
纪泽龙 committed
287 288
  components: {
    RightBototmData,
纪泽龙's avatar
纪泽龙 committed
289
    CreateWork,
纪泽龙's avatar
纪泽龙 committed
290
    CreateWorkTrouble,
纪泽龙's avatar
纪泽龙 committed
291
  },
纪泽龙's avatar
纪泽龙 committed
292 293 294 295 296 297
  data() {
    return {
      gaoMap: null,
      deviceType: false,
      value: "",
      operateType: "",
纪泽龙's avatar
纪泽龙 committed
298 299 300 301
      radio1: "",
      // 1新建,2编辑,3删除,点按钮变色
      targetNum: 0,
      // 左边的bar的active判定
纪泽龙's avatar
纪泽龙 committed
302
      leftBarNum: [1, 2, 3, 4, 7, 8, 9],
纪泽龙's avatar
纪泽龙 committed
303 304
      // 右转箭头的样式active判定
      arrowRightNum: [],
纪泽龙's avatar
纪泽龙 committed
305 306 307 308 309 310
      // 新建里的值
      iconClass: "icon-create",
      createValue: 0,
      createLabel: "新增",
      changeBtnData: [
        {
纪泽龙's avatar
纪泽龙 committed
311
          type: "0",
纪泽龙's avatar
纪泽龙 committed
312 313 314
          value: 1,
          icon: "icon-gd",
          label: "管道",
纪泽龙's avatar
纪泽龙 committed
315 316 317
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
318 319
        },
        {
纪泽龙's avatar
纪泽龙 committed
320
          type: "1",
纪泽龙's avatar
纪泽龙 committed
321 322 323
          value: 2,
          icon: "icon-tyx",
          label: "调压箱",
纪泽龙's avatar
纪泽龙 committed
324 325 326
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
327 328
        },
        {
纪泽龙's avatar
纪泽龙 committed
329
          type: "2",
纪泽龙's avatar
纪泽龙 committed
330 331 332
          value: 3,
          icon: "icon-fmj",
          label: "阀门井",
纪泽龙's avatar
纪泽龙 committed
333 334 335
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
336 337
        },
        {
纪泽龙's avatar
纪泽龙 committed
338
          type: "3",
纪泽龙's avatar
纪泽龙 committed
339 340 341
          value: 4,
          icon: "icon-llj",
          label: "流量计",
纪泽龙's avatar
纪泽龙 committed
342 343 344
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
345 346
        },
        {
纪泽龙's avatar
纪泽龙 committed
347
          type: "4",
348
          value: 7,
纪泽龙's avatar
纪泽龙 committed
349 350
          icon: "icon-ylb",
          label: "压力表",
纪泽龙's avatar
纪泽龙 committed
351 352 353
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
354
        },
纪泽龙's avatar
纪泽龙 committed
355
        {
纪泽龙's avatar
纪泽龙 committed
356
          type: "5",
纪泽龙's avatar
纪泽龙 committed
357 358 359
          value: 8,
          icon: "icon-yh",
          label: "隐患",
纪泽龙's avatar
纪泽龙 committed
360 361 362
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
363 364
        },
        {
纪泽龙's avatar
纪泽龙 committed
365
          type: "6",
纪泽龙's avatar
纪泽龙 committed
366 367 368
          value: 9,
          icon: "icon-zhibanrenyuan",
          label: "值班人员",
纪泽龙's avatar
纪泽龙 committed
369 370 371
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
372
        },
纪泽龙's avatar
纪泽龙 committed
373
      ],
纪泽龙's avatar
纪泽龙 committed
374 375
      // 这是图上所有的点
      allList: [[], [], [], [], [], [], []],
纪泽龙's avatar
纪泽龙 committed
376
      keyWord: "",
纪泽龙's avatar
纪泽龙 committed
377 378
      // 右下角的数据data
      rightBototmData: [],
纪泽龙's avatar
纪泽龙 committed
379
      bottomDataShow: true,
纪泽龙's avatar
纪泽龙 committed
380 381
      // 是否显示生成工单弹框
      createWorkOpen: false,
纪泽龙's avatar
纪泽龙 committed
382 383
      //隐患工单
      createWorkTroubleOpen: false,
纪泽龙's avatar
纪泽龙 committed
384
      // 查询用的
纪泽龙's avatar
纪泽龙 committed
385
      alarmObj: { alarmId: "", type: "" },
纪泽龙's avatar
纪泽龙 committed
386 387
      troubleObj: null,

纪泽龙's avatar
纪泽龙 committed
388 389
      //  左边抽屉 内嵌scroll盒子的高
      boxHeight: "",
390
      boxWidth: "",
391
      drawerOpacity: false,
纪泽龙's avatar
纪泽龙 committed
392 393
      //抽屉是否收回
      backFlag: true,
纪泽龙's avatar
纪泽龙 committed
394 395
    };
  },
纪泽龙's avatar
纪泽龙 committed
396 397 398
  created() {
    // 让左边的框隐藏
    this.$store.dispatch("app/toggleDevice", "mobile");
399
    console.log("sasdasdas");
纪泽龙's avatar
纪泽龙 committed
400
  },
纪泽龙's avatar
纪泽龙 committed
401

纪泽龙's avatar
纪泽龙 committed
402
  mounted() {
纪泽龙's avatar
纪泽龙 committed
403
    // this.$nextTick(() => {
404 405 406 407

    this.onResize();
    window.removeEventListener("resize", this.onResize);
    window.addEventListener("resize", this.onResize);
纪泽龙's avatar
纪泽龙 committed
408 409
    this.initMap();
    // });
纪泽龙's avatar
纪泽龙 committed
410 411
  },
  watch: {
412 413 414 415 416
    // changeBtnData: {
    //   handler(newName, oldName) {},
    //   deep: true,
    //   // immediate: true,
    // },
纪泽龙's avatar
纪泽龙 committed
417 418
  },
  methods: {
419 420 421
    onResize() {
      this.boxHeight = document.body.clientHeight - 81;
      this.boxWidth = document.body.clientWidth;
422
      console.log("挂在");
423
    },
纪泽龙's avatar
1  
纪泽龙 committed
424
    initMap() {
耿迪迪's avatar
耿迪迪 committed
425 426
      let gaoMap = new gaodeMap("石家庄");
      this.gaoMap = gaoMap;
427
      window.removeEventListener("mousedown", this.barClose);
纪泽龙's avatar
纪泽龙 committed
428
      window.addEventListener("mousedown", this.barClose);
耿迪迪's avatar
耿迪迪 committed
429 430
      gaoMap.addMouseTool();
      gaoMap.searchTips("tipinput");
纪泽龙's avatar
纪泽龙 committed
431 432
      // 获取地图上设备资源
      this.getResource();
纪泽龙's avatar
纪泽龙 committed
433 434
      // 把组件this传入类
      this.gaoMap.view = this;
纪泽龙's avatar
纪泽龙 committed
435
      // 右下角数据 跟值班人员
纪泽龙's avatar
纪泽龙 committed
436
      this.rightBottomData();
437
      // this.backFlag = false;
纪泽龙's avatar
纪泽龙 committed
438
    },
纪泽龙's avatar
纪泽龙 committed
439

纪泽龙's avatar
纪泽龙 committed
440 441 442 443 444 445 446 447 448 449 450
    // 获取地图上的资源
    getResource() {
      this.getDeviceInfo()
        .then((res) => {
          if (res == 200) {
            console.log(res);
            return this.getPipeList();
          }
        })
        .then((res) => {
          if (res == 200) {
纪泽龙's avatar
纪泽龙 committed
451 452 453 454
            // 值班人员
            return this.getInspectorLocations();
          }
        })
455 456 457 458 459 460
        .then((res) => {
          if (res == 200) {
            //隐患
            return this.getMapHiddenTroublelist();
          }
        })
纪泽龙's avatar
纪泽龙 committed
461 462 463
        .then((res) => {
          if (res == 200) {
            // 所有设备上图结束之后,左边的抽屉加载数据
464 465 466 467
            this.pipeList().then((res) => {
              console.log("开始报警准备");
              this.getSelectAlarmDevice();
            });
纪泽龙's avatar
纪泽龙 committed
468 469 470 471
            // 获取报警资源
          }
        });
    },
472
    // 设备
纪泽龙's avatar
纪泽龙 committed
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
    getDeviceInfo(queryParams) {
      this.loading = true;
      return getAllDeviceInfo(queryParams).then((response) => {
        if (response.code == 200) {
          console.log("所有设备", response.data);
          //各种苏剧分离存储
          this.deviceClassify(response.data);
          for (var i = 0; i < response.data.length; i++) {
            if ("1" == response.data[i].deviceType) {
              this.gaoMap.addMarker(
                DEVICE_TYPE.REGEULATORBOX,
                response.data[i]
              );
            }
            if ("2" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.VALUEWELL, response.data[i]);
            }
            if ("3" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.FLOWMETER, response.data[i]);
            }
            if ("4" == response.data[i].deviceType) {
              this.gaoMap.addMarker(DEVICE_TYPE.PRESSUREGAGE, response.data[i]);
            }
纪泽龙's avatar
纪泽龙 committed
496 497
          }
        }
纪泽龙's avatar
纪泽龙 committed
498 499
        this.loading = false;
        return response.code;
纪泽龙's avatar
纪泽龙 committed
500
      });
纪泽龙's avatar
纪泽龙 committed
501
    },
502
    // 管道
纪泽龙's avatar
纪泽龙 committed
503 504 505
    getPipeList(queryParams) {
      return pipeAllInfoList(queryParams).then((res) => {
        console.log("管道", res);
纪泽龙's avatar
纪泽龙 committed
506
        if (res.code == 200) {
纪泽龙's avatar
纪泽龙 committed
507 508
          this.gaoMap.addPolyline(res.data);
          this.pipeClassify(res.data);
纪泽龙's avatar
纪泽龙 committed
509
        }
纪泽龙's avatar
纪泽龙 committed
510
        return res.code;
纪泽龙's avatar
纪泽龙 committed
511
      });
耿迪迪's avatar
耿迪迪 committed
512
    },
纪泽龙's avatar
纪泽龙 committed
513
    //值班人员
纪泽龙's avatar
纪泽龙 committed
514 515
    getInspectorLocations(queryParams) {
      return getInspectorLocations(queryParams).then((res) => {
纪泽龙's avatar
纪泽龙 committed
516 517 518 519 520 521 522 523 524 525
        if (res.code == 200) {
          console.log(" 值班人员", res);
          // 把值班人员传进类里
          this.gaoMap.workerManArr = res.data;
          this.workerManClassify(res.data);
          for (var i = 0; i < res.data.length; i++) {
            let options = res.data[i];
            options.type = 9;
            this.gaoMap.addMarker(DEVICE_TYPE.INSPECTOR, options);
          }
纪泽龙's avatar
纪泽龙 committed
526
        }
纪泽龙's avatar
纪泽龙 committed
527 528
        return res.code;
      });
纪泽龙's avatar
纪泽龙 committed
529
    },
530 531
    // 隐患
    getMapHiddenTroublelist(queryParams) {
纪泽龙's avatar
纪泽龙 committed
532
      return getMapHiddenTroublelist(queryParams).then((res) => {
533
        console.log(res);
534
        if (res.code == 200) {
纪泽龙's avatar
纪泽龙 committed
535
          this.troubleClassify(res.data);
536 537 538 539 540 541 542 543
          res.data.forEach((item) => {
            console.log("隐患", item);
            this.gaoMap.addMarker(DEVICE_TYPE.TROUBLE, item);
          });
          return res.code;
        }
      });
    },
纪泽龙's avatar
纪泽龙 committed
544 545
    // 获取报警资源,并且改变图上的状态
    getSelectAlarmDevice() {
546
      return selectAlarmDevice().then((res) => {
纪泽龙's avatar
纪泽龙 committed
547 548
        if (res.length > 0) {
        }
纪泽龙's avatar
纪泽龙 committed
549 550
        console.log("报警设备", res);
        this.statusChange(res);
纪泽龙's avatar
纪泽龙 committed
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
      });
    },
    // 遍历设备改变状态 polyLines markers
    statusChange(list) {
      // 过滤报警管道
      const polyLineArr = list.filter((item) => {
        return item.deviceType == "0";
      });
      // 过滤报警的其它设备
      const deviceArr = list.filter((item) => {
        return item.deviceType != "0";
      });
      // 管道
      if (polyLineArr.length > 0) {
        polyLineArr.forEach((item) => {
          // 获取循报警设备的id
567 568
          const { deviceId, orderId, alarmId, alarmType, alarmValue, endTime } =
            item;
纪泽龙's avatar
纪泽龙 committed
569
          console.log("endTime", endTime);
纪泽龙's avatar
纪泽龙 committed
570 571 572 573 574
          // 获取polyLine
          const polyline = this.gaoMap.polyLines.filter((item) => {
            const pipeId = item.getExtData().lineData.pipeId;
            return deviceId == pipeId;
          })[0];
575

纪泽龙's avatar
纪泽龙 committed
576 577
          if (polyline) {
            let options = polyline.getExtData();
578

纪泽龙's avatar
纪泽龙 committed
579 580 581 582 583 584
            // 增加一个报警状态
            // 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
            options.lineData.view = this;
            options.lineData.alarmId = alarmId;
            options.lineData.orderId = orderId;
            if (endTime) {
585
              polyline.setOptions({ strokeColor: "#2EE7E7" });
纪泽龙's avatar
纪泽龙 committed
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601
              options.lineData.alarmState = 0;
              // 报警类型
              options.lineData.alarmType = null;
              // 报警信息
              options.lineData.alarmValue = null;
              console.log("管道回复");
            } else {
              polyline.setOptions({ strokeColor: "#ff0000" });
              options.lineData.alarmState = 1;
              // 报警类型
              options.lineData.alarmType = alarmType;
              // 报警信息
              options.lineData.alarmValue = alarmValue;
              console.log("管道报警");
            }
            polyline.setExtData(options);
602 603 604 605 606 607 608 609 610
            const myP = this.allList[0].filter((item) => {
              console.log(item.selfData.alarmState);
              return item.selfData.alarmState;
            })[0];

            // console.log("this.allList[0]", this.allList[0]);
            // console.log("myP", myP);
            // 改变左侧列表的状态(1报警,0,正常)
            myP.alarmState = options.lineData.alarmState;
纪泽龙's avatar
纪泽龙 committed
611 612 613 614
          }
        });
      }

615
      console.log("deviceArr", deviceArr);
纪泽龙's avatar
纪泽龙 committed
616 617 618 619
      // 其他设备
      if (deviceArr.length > 0) {
        deviceArr.forEach((item) => {
          // 获取循报警设备的id
620 621
          const { deviceId, alarmId, alarmType, alarmValue, endTime, orderId } =
            item;
纪泽龙's avatar
纪泽龙 committed
622 623
          // 获取polyLine
          const device = this.gaoMap.markers.filter((item) => {
624 625 626
            const { deviceId: id, troubleId } = item.getExtData();
            // 因为隐患也有 deviceId,为了防止隐患直接遍成报警状态,所以要排除隐患,没有troubleId的就不是隐患
            return !troubleId && deviceId == id;
纪泽龙's avatar
纪泽龙 committed
627
          })[0];
纪泽龙's avatar
纪泽龙 committed
628 629 630 631 632 633 634
          if (device) {
            const options = device.getExtData();
            // 增加一个报警状态
            // 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
            options.view = this;
            options.alarmId = alarmId;
            options.orderId = orderId;
纪泽龙's avatar
纪泽龙 committed
635
            if (endTime) {
纪泽龙's avatar
纪泽龙 committed
636 637 638 639 640
              options.alarmState = 0;
              // 报警类型
              options.alarmType = null;
              // 报警信息
              options.alarmValue = null;
纪泽龙's avatar
纪泽龙 committed
641
            } else {
纪泽龙's avatar
纪泽龙 committed
642 643 644 645 646
              options.alarmState = 1;
              // 报警类型
              options.alarmType = alarmType;
              // 报警信息
              options.alarmValue = alarmValue;
纪泽龙's avatar
纪泽龙 committed
647
            }
纪泽龙's avatar
纪泽龙 committed
648
            device.setExtData(options);
649 650 651 652 653 654 655 656 657 658 659 660 661

            // 找到是列表里的哪个,改变它的状态,让列表里的这个设备变成红色
            const myDevice = this.allList.filter((item) => {
              for (let i = 0; i < item.length; i++) {
                const iten = item[i];
                // 不是隐患也不是值班人员
                if (!iten.troubleId && !iten.userId) {
                  return iten.deviceId == device.getExtData().deviceId;
                }
              }
            })[0][0];
            // console.log("myDevice", myDevice);
            myDevice.alarmState = options.alarmState;
纪泽龙's avatar
纪泽龙 committed
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
            // const imageName = device.getExtData()
            // console.log(imageName)

            // 3是流量计 4是压力表
            if (device.getExtData().deviceType == 3) {
              // 如果有endtime说明已经维护好了
              if (endTime) {
                this.gaoMap.changeMarkIcon(
                  device,
                  require(`@/assets/images/liuliangji.png`)
                );
              } else {
                this.gaoMap.changeMarkIcon(
                  device,
                  require(`@/assets/images/llj.gif`)
                );
              }
            } else if (device.getExtData().deviceType == 4) {
              if (endTime) {
                this.gaoMap.changeMarkIcon(
                  device,
                  require(`@/assets/images/yalibiao.png`)
                );
              } else {
                this.gaoMap.changeMarkIcon(
                  device,
                  require(`@/assets/images/ylb.gif`)
                );
              }
纪泽龙's avatar
纪泽龙 committed
691
            }
纪泽龙's avatar
纪泽龙 committed
692 693 694
          }
        });
      }
纪泽龙's avatar
纪泽龙 committed
695
      if (this.ws) return;
纪泽龙's avatar
纪泽龙 committed
696 697
      this.socket();
    },
纪泽龙's avatar
纪泽龙 committed
698 699 700
    socket() {
      console.log("socket执行");
      this.ws = new WebSocket(
701
        "ws://36.148.23.59:8901/gassafety/websocketServer"
纪泽龙's avatar
纪泽龙 committed
702
      );
703 704 705
      // this.ws = new WebSocket(
      //   "ws://192.168.2.23:8903/gassafety/websocketServer"
      // );
纪泽龙's avatar
纪泽龙 committed
706
      this.ws.onopen = (evt) => {
707
        console.log("WebSockets开启");
纪泽龙's avatar
纪泽龙 committed
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722
      };
      this.ws.onmessage = (evt) => {
        console.log("推送", evt);
        // console.log("Received Message: " + evt.data);
        // ws.close();
        const obj = JSON.parse(evt.data);
        this.statusChange([obj]);
      };
      this.ws.onclose = () => {
        console.log("ws协议关闭");
      };
    },

    // 右下角数据
    async rightBottomData() {
723
      this.rightBototmData = [];
纪泽龙's avatar
纪泽龙 committed
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
      await countPipeLength().then((res) => {
        // console.log("管道管道管道管道管道管道", res);
        if (res.code == 200) {
          let obj;
          if (res.data > 0) {
            obj = { number: res.data, type: "99" };
          } else {
            obj = { number: 0, type: "99" };
          }
          this.rightBototmData.push(obj);
        }
      });
      await countDeviceByType().then((res) => {
        if (res.code == 200) {
          let obj = [
            {
              number: 0,
              type: "1",
            },
            {
              number: 0,
              type: "2",
            },
            {
              number: 0,
              type: "3",
            },
            {
              number: 0,
              type: "4",
            },
          ];
          res.data.forEach((item, index) => {
            for (let i = 0; i < obj.length; i++) {
              let objItem = obj[i];
              if (item.type == objItem.type) {
                objItem.number = item.number;
              }
            }
          });
          this.rightBototmData.push(...obj);
        }
      });
    },

    // 左边的Bar修改值 左边抽屉
    leftBarChange(item) {
      // this.leftBarNum= this.leftBarNum != item.value ? item.value:0;
纪泽龙's avatar
纪泽龙 committed
772 773
      this.gaoMap.closeInfoWindow();
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
774 775 776 777 778
      const index = this.leftBarNum.indexOf(item.value);
      if (index >= 0) {
        this.leftBarNum.splice(index, 1);
      } else {
        this.leftBarNum.push(item.value);
779
        this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
780 781
      }
      // 1,2,3,4,7分别对应数据库type5,1,2,3,4
782
      // console.log(this.leftBarNum);
纪泽龙's avatar
纪泽龙 committed
783 784
      if (this.leftBarNum.includes(1)) {
        this.gaoMap.lineShow(true);
785
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
786 787 788 789 790 791 792 793
      } else {
        this.gaoMap.lineShow(false);
      }

      // console.log("marks",this.gaoMap.markers)
      // this.gaoMap.markerShow();
      if (this.leftBarNum.includes(2)) {
        this.gaoMap.markerShow(1, true);
794
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
795 796 797 798 799 800
      } else {
        this.gaoMap.markerShow(1, false);
      }

      if (this.leftBarNum.includes(3)) {
        this.gaoMap.markerShow(2, true);
801
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
802 803 804 805 806 807
      } else {
        this.gaoMap.markerShow(2, false);
      }

      if (this.leftBarNum.includes(4)) {
        this.gaoMap.markerShow(3, true);
808
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
809 810 811 812 813 814
      } else {
        this.gaoMap.markerShow(3, false);
      }

      if (this.leftBarNum.includes(7)) {
        this.gaoMap.markerShow(4, true);
815
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
816 817 818
      } else {
        this.gaoMap.markerShow(4, false);
      }
纪泽龙's avatar
纪泽龙 committed
819 820 821 822 823 824 825
      // 隐患
      if (this.leftBarNum.includes(8)) {
        this.gaoMap.markerShow(8, true);
        // this.panTo(item);
      } else {
        this.gaoMap.markerShow(8, false);
      }
纪泽龙's avatar
纪泽龙 committed
826 827 828

      if (this.leftBarNum.includes(9)) {
        this.gaoMap.markerShow(9, true);
829
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
830 831 832 833
      } else {
        this.gaoMap.markerShow(9, false);
      }
    },
834
    panTo(item, bool) {
纪泽龙's avatar
纪泽龙 committed
835
      this.gaoMap.myMap.setZoom(12);
836 837
      if (item.list.length > 0) {
        if (this.leftBarNum.includes(item.value)) {
纪泽龙's avatar
纪泽龙 committed
838 839 840 841 842 843 844 845 846
          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;
纪泽龙's avatar
纪泽龙 committed
847
            path = [a, b - 0.08];
纪泽龙's avatar
纪泽龙 committed
848
          } else {
纪泽龙's avatar
纪泽龙 committed
849
            path = [item.list[0].path[0], item.list[0].path[1] - 0.08];
纪泽龙's avatar
纪泽龙 committed
850 851
          }
          this.gaoMap.panTo(path);
852 853 854 855 856
        }
      }
    },
    panToo(iten, item) {
      // 如果没打对勾,就啥也不干
纪泽龙's avatar
纪泽龙 committed
857
      if (!this.leftBarNum.includes(item.value)) return;
858 859
      // 点击的时候允许infowindow消失
      this.gaoMap.leftListClick = true;
860
      // 如果地图太大了就吸纳是不出来infowindow了,所以要固定缩放比例
纪泽龙's avatar
纪泽龙 committed
861 862
      // 所有线条颜色还原
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
863
      this.gaoMap.myMap.setZoom(12);
864 865
      if (item.list.length > 0) {
        if (this.leftBarNum.includes(item.value)) {
纪泽龙's avatar
纪泽龙 committed
866 867 868 869 870
          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
871
            path = [a, b - 0.08];
纪泽龙's avatar
纪泽龙 committed
872
            // 线条infowindow显示中间,保留六位转换字符串,否则有时候会出现一些问题
纪泽龙's avatar
纪泽龙 committed
873 874 875
            iten.infoPath = [a.toFixed(6), b.toFixed(6)];
            console.log(path);
          } else {
纪泽龙's avatar
纪泽龙 committed
876
            path = [iten.path[0], iten.path[1] - 0.08];
纪泽龙's avatar
纪泽龙 committed
877 878 879 880 881
          }
          // const path =
          //   item.value == 1
          //     ? [iten.lnglat[0], iten.lnglat[1] - 0.1]
          //     : [iten.path[0], iten.path[1] - 0.1];
882
          this.gaoMap.panTo(path);
883 884 885 886 887 888 889 890 891
        }
      }
      // 当前地图中心点
      const { lat, lng } = this.gaoMap.myMap.getCenter();
      // 管道是这个方法,因为管道比较特殊
      if (item.value == 1) {
        this.polylineInfoWindowShow(iten, lat, lng);
      } else if (item.value == 9) {
        // 工作人员
纪泽龙's avatar
纪泽龙 committed
892
        this.workerManInfoWindowShow(iten, lat, lng);
纪泽龙's avatar
纪泽龙 committed
893
      } else if (item.value == 8) {
纪泽龙's avatar
纪泽龙 committed
894
        this.trouleInfoWindowShow(iten, lat, lng);
895 896 897 898 899
      } else {
        // 其他设备
        this.diveceInfoWindowShow(iten, lat, lng);
      }
    },
纪泽龙's avatar
纪泽龙 committed
900
    // 如果是线条飞过去出现infowindow
901 902 903 904 905 906 907
    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,
纪泽龙's avatar
纪泽龙 committed
908
        lnglat: iten.infoPath,
909
      };
纪泽龙's avatar
纪泽龙 committed
910
      // console.log(target.getOptions());
911 912
      console.log(iten.infoPath[0] - lng, iten.infoPath[1] - (lat + 0.1));

913
      // 如果是原地不动,就直接执行
914 915
      // if (iten.infoPath[0] == lng && iten.infoPath[1] == lat + 0.1) {
      if (
916
        iten.infoPath[0] - lng >= -0.00001 &&
917
        iten.infoPath[0] - lng <= 0.00001 &&
纪泽龙's avatar
纪泽龙 committed
918 919
        iten.infoPath[1] - (lat + 0.08) >= -0.00001 &&
        iten.infoPath[1] - (lat + 0.08) <= 0.00001
920
      ) {
921
        this.gaoMap.leftListClick = false;
922
        this.gaoMap.polylineMouseOver(e);
纪泽龙's avatar
纪泽龙 committed
923
        target.setOptions({ strokeColor: "#F7FE38" });
924 925
        return;
      }
纪泽龙's avatar
纪泽龙 committed
926

927 928 929
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.polylineMouseOver(e);
纪泽龙's avatar
纪泽龙 committed
930
        target.setOptions({ strokeColor: "#F7FE38" });
931 932 933 934 935 936 937 938 939 940 941 942 943
      };
    },
    // 这个是其他设备的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,
      };
      // 如果是原地不动,就直接执行
纪泽龙's avatar
纪泽龙 committed
944 945
      // if (iten.path[0] == lng && iten.path[1] == lat + 0.08) {
      if (iten.path[0] == lng && iten.path[1] >= lat + 0.08 - 0.000001) {
946
        this.gaoMap.leftListClick = false;
947 948 949 950 951 952 953 954
        this.gaoMap.infoOpen(e);
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.infoOpen(e);
      };
    },
纪泽龙's avatar
纪泽龙 committed
955 956 957 958 959 960 961 962 963 964 965
    // 隐患infowindow
    trouleInfoWindowShow(iten, lat, lng) {
      const target = this.gaoMap.markers.filter((item) => {
        return item.getExtData().troubleId == iten.troubleId;
      })[0];
      console.log("target", target);
      const e = {
        target,
        lnglat: iten.path,
      };
      // 如果是原地不动,就直接执行
纪泽龙's avatar
纪泽龙 committed
966 967
      // if (iten.path[0] == lng && iten.path[1] == lat + 0.08) {
      if (iten.path[0] == lng && iten.path[1] >= lat + 0.08 - 0.000001) {
968
        this.gaoMap.leftListClick = false;
纪泽龙's avatar
纪泽龙 committed
969 970 971 972 973 974 975 976
        this.gaoMap.troubleOpen(e);
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.troubleOpen(e);
      };
    },
纪泽龙's avatar
纪泽龙 committed
977 978 979 980 981 982 983 984 985 986 987 988
    // workerMan,值班人员飞过去后侠士infowindow
    workerManInfoWindowShow(iten, lat, lng) {
      // console.log("iten",iten.userId)
      const target = this.gaoMap.markers.filter((item) => {
        return item.getExtData().userId == iten.userId;
      })[0];
      console.log("target", target);
      const e = {
        target,
        lnglat: iten.path,
      };
      // 如果是原地不动,就直接执行
纪泽龙's avatar
纪泽龙 committed
989 990 991
      // if (iten.path[0] == lng && iten.path[1] == lat + 0.08) {
      // console.log(iten.path[0] , iten.path[1] ,lat+0.06,lng)
      if (iten.path[0] == lng && iten.path[1] >= lat + 0.08 - 0.000001) {
992
        this.gaoMap.leftListClick = false;
纪泽龙's avatar
纪泽龙 committed
993 994 995 996 997 998 999 1000 1001 1002
        this.gaoMap.wokerManOpen(e);
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.wokerManOpen(e);
      };
    },

    // 向右的箭头的动画
纪泽龙's avatar
纪泽龙 committed
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014
    arrowRightChange(item) {
      const index = this.arrowRightNum.indexOf(item.value);
      if (index >= 0) {
        this.arrowRightNum.splice(index, 1);
      } else {
        this.arrowRightNum.push(item.value);
      }
    },

    // 管道储存
    pipeClassify(pipeData) {
      const pipeArr = pipeData.map((item, index) => {
1015
        // console.log( '管道路径',eval(item.coordinates )[0])
纪泽龙's avatar
纪泽龙 committed
1016
        return {
1017 1018
          lnglat: eval(item.coordinates)[0],
          path: eval(item.coordinates)[1],
纪泽龙's avatar
纪泽龙 committed
1019 1020 1021 1022 1023
          no: index,
          deviceId: item.pipeId,
          deviceType: "0",
          deviceName: item.pipeName,
          code: item.pipeCode,
1024 1025
          alarmState: item.alarmState ? item.alarmState : "0",
          selfData: item,
纪泽龙's avatar
纪泽龙 committed
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
        };
      });
      this.allList[0] = pipeArr;
      console.log("管道", pipeArr);
    },
    // 设备分类存储
    deviceClassify(data) {
      // 所有调压箱数据
      const tyxArr = data
        .filter((item) => {
          return item.deviceType == 1;
        })
        .map((item, index) => {
          return {
1040
            path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1041 1042 1043 1044 1045
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
1046 1047
            alarmState: item.alarmState ? item.alarmState : "0",
            selfData: item,
纪泽龙's avatar
纪泽龙 committed
1048 1049 1050 1051 1052 1053 1054 1055 1056
          };
        });
      // 所有阀门井数据
      const fmjArr = data
        .filter((item) => {
          return item.deviceType == 2;
        })
        .map((item, index) => {
          return {
1057
            path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1058 1059 1060 1061 1062
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
1063 1064
            alarmState: item.alarmState ? item.alarmState : "0",
            selfData: item,
纪泽龙's avatar
纪泽龙 committed
1065 1066 1067 1068 1069 1070 1071 1072 1073
          };
        });
      // 所有流量计数据
      const lljArr = data
        .filter((item) => {
          return item.deviceType == 3;
        })
        .map((item, index) => {
          return {
1074
            path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1075 1076 1077 1078 1079
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
1080 1081
            alarmState: item.alarmState ? item.alarmState : "0",
            selfData: item,
纪泽龙's avatar
纪泽龙 committed
1082 1083 1084 1085 1086 1087 1088 1089 1090
          };
        });
      // 所有压力表数据
      const ylbArr = data
        .filter((item) => {
          return item.deviceType == 4;
        })
        .map((item, index) => {
          return {
1091
            path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1092 1093 1094 1095 1096
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
1097 1098
            alarmState: item.alarmState ? item.alarmState : "0",
            selfData: item,
纪泽龙's avatar
纪泽龙 committed
1099 1100
          };
        });
1101
      // console.log("设备", tyxArr, fmjArr, lljArr, ylbArr);
纪泽龙's avatar
纪泽龙 committed
1102 1103 1104 1105 1106
      this.allList[1] = tyxArr;
      this.allList[2] = fmjArr;
      this.allList[3] = lljArr;
      this.allList[4] = ylbArr;
    },
纪泽龙's avatar
纪泽龙 committed
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120
    // 隐患存储
    troubleClassify(troubleData) {
      const workManArr = troubleData.map((item, index) => {
        return {
          path: [item.longitude, item.latitude],
          no: index,
          troubleId: item.troubleId,
          troubleName: item.troubleName,
          troubleLevel: item.troubleLevel,
        };
      });
      console.log("值班人员", workManArr);
      this.allList[5] = workManArr;
    },
纪泽龙's avatar
纪泽龙 committed
1121
    // 值班人员
纪泽龙's avatar
纪泽龙 committed
1122 1123 1124
    workerManClassify(workManData) {
      const workManArr = workManData.map((item, index) => {
        return {
1125
          path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1126 1127 1128
          no: index,
          userId: item.userId,
          userName: item.userName,
1129
          userPhone: item.phonenumber,
纪泽龙's avatar
纪泽龙 committed
1130 1131 1132 1133 1134 1135
        };
      });
      console.log("值班人员", workManArr);
      this.allList[6] = workManArr;
    },
    // 左边设备翻页
1136
    async pipeList(pageNum) {
纪泽龙's avatar
纪泽龙 committed
1137 1138 1139 1140 1141 1142 1143
      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]);
      this.changeBtnData.forEach((item, index) => {
1144
        // console.log("=======", index, this.allList[index]);
纪泽龙's avatar
纪泽龙 committed
1145 1146 1147 1148 1149 1150 1151
        if (this.allList[index]?.length > 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);
1152
        } else {
纪泽龙's avatar
纪泽龙 committed
1153
          // 如果为空,就直接把item.list写成[];
1154
          item.list = [];
纪泽龙's avatar
纪泽龙 committed
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
        }
      });
    },
    pageBack(item) {
      item.nowPage--;
      this.pipeList();
    },
    pageGo(item) {
      item.nowPage++;
      this.pipeList();
    },
    addDevice() {
      if (this.iconClass == "icon-create") {
        this.targetNum = this.targetNum != 1 ? 1 : 0;
      } else {
        if (this.deviceType) {
          this.targetNum = 0;
          this.createReset();
          this.gaoMap.newLineReset();
        }
      }
      if (this.targetNum == 1 && this.createValue == 1) {
        this.gaoMap.lineType = 1;
      } else {
        this.gaoMap.lineType = 0;
        this.gaoMap.mouseTool.close();
      }
      // 关闭当前的infowindow
      this.gaoMap.closeInfoWindow();
纪泽龙's avatar
纪泽龙 committed
1184

纪泽龙's avatar
纪泽龙 committed
1185 1186 1187
      this.deviceType = !this.deviceType;
      this.gaoMap.mapOperateType = "add";
      this.gaoMap.removeMarkerDragg();
纪泽龙's avatar
纪泽龙 committed
1188
    },
1189 1190

    // 选择新建项目哪个
纪泽龙's avatar
纪泽龙 committed
1191 1192
    createChange(e, item) {
      // e.stopPropagation();
纪泽龙's avatar
纪泽龙 committed
1193 1194 1195 1196
      this.deviceType = false;
      this.iconClass = item.icon;
      this.createValue = item.value;
      this.createLabel = item.label;
纪泽龙's avatar
1  
纪泽龙 committed
1197

纪泽龙's avatar
纪泽龙 committed
1198
      if (this.targetNum == 1 && this.createValue == 1) {
纪泽龙's avatar
纪泽龙 committed
1199
        // 0是初始,1是新建 2是编辑 3删除
纪泽龙's avatar
纪泽龙 committed
1200
        this.gaoMap.lineType = 1;
纪泽龙's avatar
纪泽龙 committed
1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211
        if (this.gaoMap.newLineObj == null) {
          this.gaoMap.createNewLine();
        }
      } else {
        // 如果不是管道,就归位
        this.gaoMap.lineType = 0;
        // 如果不是管道了,把之前的管道清空
        this.gaoMap.newLineReset();

        // this.createReset();
        // 其他
耿迪迪's avatar
耿迪迪 committed
1212
        this.gaoMap.draw(this.createValue.toString());
纪泽龙's avatar
纪泽龙 committed
1213
      }
纪泽龙's avatar
纪泽龙 committed
1214 1215
      // 清空所有正在编辑状态的线
      this.gaoMap.linePolyEditorAllClose();
纪泽龙's avatar
纪泽龙 committed
1216
    },
纪泽龙's avatar
纪泽龙 committed
1217

纪泽龙's avatar
纪泽龙 committed
1218 1219 1220 1221 1222
    // 新建按钮还原
    createReset() {
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
1223
      this.gaoMap.closeAddMarker();
纪泽龙's avatar
纪泽龙 committed
1224
    },
纪泽龙's avatar
纪泽龙 committed
1225
    editDevice() {
纪泽龙's avatar
纪泽龙 committed
1226
      this.targetNum = this.targetNum != 2 ? 2 : 0;
纪泽龙's avatar
纪泽龙 committed
1227 1228
      this.gaoMap.lineType = this.targetNum;
      if (this.targetNum != 2) {
纪泽龙's avatar
纪泽龙 committed
1229
        this.gaoMap.linePolyEditorAllClose();
1230 1231
        this.gaoMap.removeMarkerDragg();
        this.gaoMap.mapOperateType = "normal";
纪泽龙's avatar
1  
纪泽龙 committed
1232
      } else {
1233 1234 1235 1236 1237 1238 1239
        // 如果正在新建线条,则清空
        this.gaoMap.newLineReset();
        this.deviceType = false;
        this.gaoMap.mapOperateType = "edit";
        this.gaoMap.addMarkerDragg();
        // this.gaoMap.placeSearch.clear();
        this.gaoMap.closeAddMarker();
纪泽龙's avatar
纪泽龙 committed
1240
      }
纪泽龙's avatar
1  
纪泽龙 committed
1241
      // 关闭当前的infowindow
纪泽龙's avatar
纪泽龙 committed
1242
      this.gaoMap.closeInfoWindow();
纪泽龙's avatar
纪泽龙 committed
1243
      this.createReset();
耿迪迪's avatar
耿迪迪 committed
1244
    },
纪泽龙's avatar
纪泽龙 committed
1245
    deleteDevice() {
纪泽龙's avatar
纪泽龙 committed
1246
      this.targetNum = this.targetNum != 3 ? 3 : 0;
纪泽龙's avatar
纪泽龙 committed
1247
      this.gaoMap.lineType = this.targetNum;
1248 1249 1250
      if (this.targetNum != 3) {
        this.gaoMap.removeMarkerDragg();
        this.gaoMap.mapOperateType = "normal";
纪泽龙's avatar
1  
纪泽龙 committed
1251
      } else {
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261
        // 如果正在新建线条,则清空
        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
1262
      // 关闭当前的infowindow
纪泽龙's avatar
纪泽龙 committed
1263
      this.gaoMap.closeInfoWindow();
纪泽龙's avatar
纪泽龙 committed
1264
      this.createReset();
耿迪迪's avatar
耿迪迪 committed
1265
    },
纪泽龙's avatar
纪泽龙 committed
1266
    selectDeviceType(val) {
纪泽龙's avatar
纪泽龙 committed
1267 1268 1269
      // if("add" == this.operationType){
      this.gaoMap.draw(val);
      // }
纪泽龙's avatar
纪泽龙 committed
1270 1271 1272 1273 1274 1275
      this.deviceType = false;
      this.value = "";
      // 如果选择的是新建管道
      if (val == 1) {
        this.gaoMap.lineType = 1;
        this.gaoMap.createNewLine();
耿迪迪's avatar
耿迪迪 committed
1276
      }
纪泽龙's avatar
纪泽龙 committed
1277
    },
纪泽龙's avatar
纪泽龙 committed
1278

纪泽龙's avatar
1  
纪泽龙 committed
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
    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";
纪泽龙's avatar
z  
纪泽龙 committed
1290
      // map.remove(this.gaodeMap.markerOverlays);
纪泽龙's avatar
1  
纪泽龙 committed
1291
    },
纪泽龙's avatar
纪泽龙 committed
1292
    // 搜索
纪泽龙's avatar
纪泽龙 committed
1293
    async search() {
纪泽龙's avatar
1  
纪泽龙 committed
1294
      this.searchClear();
耿迪迪's avatar
耿迪迪 committed
1295
      map.clearMap();
1296
      this.gaoMap.placeSearch.clear();
纪泽龙's avatar
1  
纪泽龙 committed
1297
      if (!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)) {
耿迪迪's avatar
耿迪迪 committed
1298 1299
        this.gaoMap.placeSearch.setCity(this.gaoMap.searchSelectAdcode);
        this.gaoMap.placeSearch.search(this.gaoMap.searchSelectName);
纪泽龙's avatar
1  
纪泽龙 committed
1300
        this.getDeviceInfo({ deviceName: this.gaoMap.searchSelectName });
耿迪迪's avatar
耿迪迪 committed
1301
        this.gaoMap.polyLines = [];
纪泽龙's avatar
1  
纪泽龙 committed
1302
        this.getPipeList({ pipeName: this.gaoMap.searchSelectName });
耿迪迪's avatar
耿迪迪 committed
1303 1304
        this.gaoMap.searchSelectAdcode = undefined;
        this.gaoMap.searchSelectName = undefined;
纪泽龙's avatar
1  
纪泽龙 committed
1305
      } else {
纪泽龙's avatar
纪泽龙 committed
1306 1307
        // 左边全选
        this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
1308
        // this.arrowRightNum=[];
纪泽龙's avatar
纪泽龙 committed
1309
        // 右转箭头的样式active判定
纪泽龙's avatar
纪泽龙 committed
1310
        // this.arrowRightNum = [];
纪泽龙's avatar
纪泽龙 committed
1311 1312 1313
        // 清空左边列表
        // this.changeBtnDataClear();
        // this.gaoMap.placeSearch.search(this.keyWord);
1314
        this.gaoMap.markers = [];
耿迪迪's avatar
耿迪迪 committed
1315
        this.gaoMap.polyLines = [];
1316
        await this.getDeviceInfo({ deviceName: this.keyWord });
纪泽龙's avatar
纪泽龙 committed
1317
        await this.getPipeList({ pipeName: this.keyWord });
纪泽龙's avatar
纪泽龙 committed
1318
        // 值班人员
纪泽龙's avatar
纪泽龙 committed
1319
        await this.getInspectorLocations({ userName: this.keyWord });
纪泽龙's avatar
纪泽龙 committed
1320 1321
        await this.getMapHiddenTroublelist({ troubleName: this.keyWord });

纪泽龙's avatar
纪泽龙 committed
1322 1323 1324
        this.changeBtnData.forEach((item) => {
          item.nowPage = 1;
        });
1325 1326 1327 1328
        this.pipeList().then(() => {
          // 设备报警
          this.getSelectAlarmDevice();
        });
耿迪迪's avatar
耿迪迪 committed
1329
      }
纪泽龙's avatar
纪泽龙 committed
1330
    },
纪泽龙's avatar
纪泽龙 committed
1331 1332 1333 1334 1335 1336 1337 1338 1339 1340
    // 清空左边列表
    changeBtnDataClear() {
      this.allList = [];
      this.changeBtnData.forEach((item) => {
        // 清空list
        item.list = [];
        item.maxPage = 99;
        item.nowPage = 1;
      });
    },
纪泽龙's avatar
纪泽龙 committed
1341
    // 新建下拉列表关闭 window点击事件
纪泽龙's avatar
纪泽龙 committed
1342
    barClose() {
1343
      // 一点windowbottomData显示
1344
      // this.bottomDataShow = true;
纪泽龙's avatar
纪泽龙 committed
1345
      // return;
纪泽龙's avatar
纪泽龙 committed
1346
      console.log("window");
1347
      // 颜色恢复
1348

纪泽龙's avatar
纪泽龙 committed
1349
      this.deviceType = false;
纪泽龙's avatar
纪泽龙 committed
1350
      // 关闭当前线条的infowindow
1351
      // this.gaoMap.closeInfoWindow();
纪泽龙's avatar
纪泽龙 committed
1352 1353 1354 1355 1356
      // 如果没有选择的时候点window 则高亮消失
      if (this.targetNum == 1 && this.iconClass == "icon-create") {
        this.targetNum = 0;
      }
      // 辅助新建重新画线
纪泽龙's avatar
纪泽龙 committed
1357
      // if (!this.gaoMap.lineFlag || this.gaoMap.lineType != 1) return;
纪泽龙's avatar
纪泽龙 committed
1358
      // console.log("利用window把lineFlagh恢复");
纪泽龙's avatar
纪泽龙 committed
1359
      this.gaoMap.lineFlag = false;
纪泽龙's avatar
纪泽龙 committed
1360
      // this.gaoMap.createNewLine();
纪泽龙's avatar
纪泽龙 committed
1361
    },
纪泽龙's avatar
1  
纪泽龙 committed
1362
    refreshMap() {
纪泽龙's avatar
纪泽龙 committed
1363
      // this.changeBtnDataClear();
纪泽龙's avatar
纪泽龙 committed
1364 1365
      this.keyWord = "";
      this.arrowRightNum = [];
纪泽龙's avatar
1  
纪泽龙 committed
1366 1367 1368 1369
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
      this.targetNum = 0;
纪泽龙's avatar
纪泽龙 committed
1370 1371 1372
      this.changeBtnData.forEach((item) => {
        item.nowPage = 1;
      });
耿迪迪's avatar
耿迪迪 committed
1373
      map.clearMap();
1374

纪泽龙's avatar
纪泽龙 committed
1375
      this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
纪泽龙's avatar
纪泽龙 committed
1376
      this.initMap();
纪泽龙's avatar
1  
纪泽龙 committed
1377
    },
纪泽龙's avatar
纪泽龙 committed
1378 1379 1380 1381 1382 1383 1384
    // 改变工单弹框状态
    // openChange(bool) {
    //   this.createWorkOpen = bool;
    // },
    // openTroubleChange(bool) {
    //   this.createWorkTroubleOpen = bool;
    // },
纪泽龙's avatar
纪泽龙 committed
1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405
    // 生成工单的回调
    CreateWorkCallBack(e) {
      if (!this.alarmObj.alarmId) return;
      console.log("alarmObj", this.alarmObj);
      if (this.alarmObj.type == "pipe") {
        const polyline = this.gaoMap.polyLines.filter((item) => {
          return item.getExtData().lineData.alarmId == this.alarmObj.alarmId;
        })[0];
        let options = polyline.getExtData();
        // 暂时传值,到时候回重新刷新
        options.lineData.orderId = e;
        polyline.setExtData(options);
      } else {
        const marker = this.gaoMap.markers.filter((item) => {
          return item.getExtData().alarmId == this.alarmObj.alarmId;
        })[0];
        let options = marker.getExtData();
        // 暂时传值,到时候回重新刷新
        options.orderId = e;
        marker.setExtData(options);
      }
1406 1407
      // 工单弹框生成之后执行的方法
    },
纪泽龙's avatar
纪泽龙 committed
1408 1409 1410
    alarmObjChange(obj) {
      this.alarmObj = obj;
      console.log(this.alarmObj);
1411
    },
纪泽龙's avatar
纪泽龙 committed
1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429
    // 隐患
    // 手动加入orderId
    CreateWorkTroubleCallBack(e) {
      // console.log("隐患嘿嘿嘿")
      const trouble = this.gaoMap.troubles.filter((item) => {
        console.log(item, this.troubleObj.troubleId);
        return item.data.troubleId == this.troubleObj.troubleId;
      })[0];
      console.log("找到隐患了,是", trouble);
      let options = trouble.getExtData();
      // 暂时传值,到时候回重新刷新
      options.orderId = e;
      trouble.setExtData(options);
      trouble.data.orderId = e;
    },
    troubleObjChange(obj) {
      this.troubleObj = obj;
    },
1430
    drawerClick() {
1431
      console.log("drawerClick");
1432
      this.gaoMap.polyLinesColorClear();
1433

1434 1435
      this.gaoMap.closeInfoWindow();
    },
纪泽龙's avatar
纪泽龙 committed
1436 1437 1438
  },

  beforeDestroy() {
1439
    // 让抽屉继续隐身
纪泽龙's avatar
纪泽龙 committed
1440
    console.log("移除window事件");
纪泽龙's avatar
纪泽龙 committed
1441 1442
    map.clearMap();
    window.removeEventListener("mousedown", this.barClose);
1443 1444
    window.removeEventListener("resize", this.onResize);

纪泽龙's avatar
纪泽龙 committed
1445
    // 关闭scoket
纪泽龙's avatar
纪泽龙 committed
1446
    if (this.ws) {
1447
      console.log("socket关闭了");
纪泽龙's avatar
纪泽龙 committed
1448
      this.ws.close();
纪泽龙's avatar
纪泽龙 committed
1449
      this.ws = null;
纪泽龙's avatar
纪泽龙 committed
1450
    }
纪泽龙's avatar
纪泽龙 committed
1451 1452
  },
};
耿迪迪's avatar
耿迪迪 committed
1453
</script>
纪泽龙's avatar
纪泽龙 committed
1454 1455


耿迪迪's avatar
耿迪迪 committed
1456
<style lang="scss" scoped>
纪泽龙's avatar
纪泽龙 committed
1457
#container {
纪泽龙's avatar
纪泽龙 committed
1458 1459
  position: fixed;
  top: 80px;
纪泽龙's avatar
纪泽龙 committed
1460
  bottom: 0;
纪泽龙's avatar
纪泽龙 committed
1461 1462
  width: 100%;
}
1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541
// .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;
//         }
纪泽龙's avatar
纪泽龙 committed
1542

1543 1544 1545 1546 1547 1548 1549
//         &:hover {
//           background-image: url("../../../assets/images/bac1.png");
//         }
//       }
//     }
//   }
// }
纪泽龙's avatar
纪泽龙 committed
1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568
.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
1569

纪泽龙's avatar
纪泽龙 committed
1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589
.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
1590

纪泽龙's avatar
纪泽龙 committed
1591 1592 1593 1594
.input-text {
  width: 4rem;
  margin-right: 1rem;
}
耿迪迪's avatar
耿迪迪 committed
1595

纪泽龙's avatar
纪泽龙 committed
1596
.classShow {
1597 1598
  opacity: 0;
}
纪泽龙's avatar
纪泽龙 committed
1599 1600 1601 1602 1603
.drawer {
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 0;
1604
  width: 348px;
纪泽龙's avatar
纪泽龙 committed
1605 1606 1607
  transition: 0.2s linear;
  background: #fff;
  // background: red;
1608 1609 1610 1611 1612
  opacity: 0;
  // 优化抽屉出来回去
  &.opacity {
    opacity: 1;
  }
纪泽龙's avatar
纪泽龙 committed
1613
  &.back {
1614
    left: -348px;
纪泽龙's avatar
纪泽龙 committed
1615 1616 1617 1618 1619 1620 1621 1622 1623 1624
  }
  .scroll {
    // height: 100%;
    position: relative;
    overflow-y: scroll;
    overflow-x: hidden;

    &::-webkit-scrollbar {
      display: none;
    }
1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649
    .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;
      }
纪泽龙's avatar
纪泽龙 committed
1650 1651 1652
    }
  }

1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678
  // 左边的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;
1679
          color: #053b6a;
1680 1681 1682 1683 1684
          font-weight: 600;
        }
      }
      .deviceList {
        cursor: pointer;
1685
        margin-bottom: 10px;
纪泽龙's avatar
纪泽龙 committed
1686
        box-sizing: border-box;
1687
        border-bottom: 1px solid #053b6a00;
1688
        color: #1d1d1d;
1689 1690 1691
        &:hover {
          box-sizing: border-box;
          border-bottom: 1px solid #053b6a;
1692 1693
          color: #053b6a;
          font-weight: 600;
1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713
        }
        &.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
1714 1715
        width: 25px;
        font-weight: 700;
1716 1717 1718 1719 1720
      }
      .name {
        // border-right: none;
        flex: 1;
        text-align: center;
1721
        margin-left: 10px;
1722 1723
      }
      .code {
1724
        width: 100px;
1725
        text-align: center;
纪泽龙's avatar
纪泽龙 committed
1726
      }
1727 1728 1729 1730 1731 1732 1733 1734 1735 1736
      .textRed {
        .no,
        .name,
        .code {
          color: red;
        }
        &:hover {
          border-bottom: 1px solid red;
        }
      }
纪泽龙's avatar
纪泽龙 committed
1737
    }
1738 1739 1740 1741 1742 1743 1744 1745
    .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);
1746
      cursor: pointer;
1747 1748 1749 1750 1751 1752 1753 1754
      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);
        }
纪泽龙's avatar
纪泽龙 committed
1755
      }
1756
      &:hover {
纪泽龙's avatar
纪泽龙 committed
1757
        box-sizing: border-box;
1758 1759 1760 1761 1762
        background-color: rgba(5, 59, 106, 0.1);
        border-bottom: none !important;
      }
      .upPic {
        display: inline-block;
纪泽龙's avatar
纪泽龙 committed
1763
        margin-left: 40px;
1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796
        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);
        }
纪泽龙's avatar
纪泽龙 committed
1797 1798
      }
      &.active {
1799 1800 1801 1802 1803 1804 1805 1806
        // background-color: #053b6a;
        .left,
        .right {
          color: #053b6a;
        }
        > i {
          color: #053b6a;
        }
纪泽龙's avatar
纪泽龙 committed
1807
      }
1808
      .left {
纪泽龙's avatar
纪泽龙 committed
1809
        color: #053b6a;
1810 1811 1812 1813 1814
        line-height: 48px;
        margin-left: 28px;
        .iconfont {
          font-size: 22px;
        }
纪泽龙's avatar
纪泽龙 committed
1815
      }
1816 1817 1818 1819 1820
      .right {
        color: #1d1d1d;
        line-height: 48px;
        font-size: 16px;
        margin-left: 4px;
纪泽龙's avatar
纪泽龙 committed
1821 1822
      }
    }
1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847
    .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;
        }
      }
纪泽龙's avatar
纪泽龙 committed
1848 1849
    }
  }
1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862
  // 开关
  .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
1863 1864 1865
    }
  }
}
耿迪迪's avatar
耿迪迪 committed
1866
</style>
耿迪迪's avatar
耿迪迪 committed
1867