index.vue 58.4 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
              >
                <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
68 69 70 71 72 73 74
    <Right
      v-show="rightDataShow"
      :class="{ classShow: !rightDataShow }"
      ref="Right"
      :list="rightBototmData"
    />
    <Bottom
纪泽龙's avatar
纪泽龙 committed
75
      v-show="bottomDataShow"
76 77 78 79
      :class="{
        classShow: !bottomDataShow,
        bottomMarginRight: bottomMarginRight,
      }"
纪泽龙's avatar
纪泽龙 committed
80
      ref="Bottom"
纪泽龙's avatar
纪泽龙 committed
81 82
      :list="rightBototmData"
    />
纪泽龙's avatar
纪泽龙 committed
83
    <!-- 报警工单 -->
84 85 86 87 88
    <CreateWork
      ref="CreateWork"
      :open="createWorkOpen"
      @callback="CreateWorkCallBack"
    />
纪泽龙's avatar
纪泽龙 committed
89
    <!-- 隐患工单 -->
纪泽龙's avatar
纪泽龙 committed
90
    <CreateWorkTrouble
纪泽龙's avatar
纪泽龙 committed
91 92 93
      ref="CreateWorkTrouble"
      :open="createWorkTroubleOpen"
      @callback="CreateWorkTroubleCallBack"
纪泽龙's avatar
纪泽龙 committed
94
    />
纪泽龙's avatar
纪泽龙 committed
95

96 97 98 99
    <div
      ref="drawer"
      class="drawer"
      :class="{ back: backFlag, opacity: drawerOpacity }"
100
      @click.stop="drawerClick"
101
    >
纪泽龙's avatar
纪泽龙 committed
102 103 104 105
      <div class="mapChange">
        <div :class="{ active: !mapStyle }" @click="mapChange(1)">卫星地图</div>
        <div :class="{ active: mapStyle }" @click="mapChange(2)">全景地图</div>
      </div>
106 107 108
      <!-- 管道压力 -->
      <div class="pipePressure">
        <!-- <div>管道压力</div> -->
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
        <div class="hasColorBox" :style="{ color: lineColor[`1`] }">
          <div :style="{ backgroundColor: lineColor[`1`] }"></div>
          低压
        </div>
        <div class="hasColorBox" :style="{ color: lineColor[`2`] }">
          <div :style="{ backgroundColor: lineColor[`2`] }"></div>
          中压
        </div>
        <div class="hasColorBox" :style="{ color: lineColor[`3`] }">
          <div :style="{ backgroundColor: lineColor[`3`] }"></div>
          次高压
        </div>
        <div class="hasColorBox" :style="{ color: lineColor[`4`] }">
          <div :style="{ backgroundColor: lineColor[`4`] }"></div>
          高压
        </div>
125
      </div>
纪泽龙's avatar
纪泽龙 committed
126
      <div class="switch" @click="backFlag = !backFlag">
纪泽龙's avatar
纪泽龙 committed
127 128
        <img v-if="!backFlag" src="@/assets/images/l.png" alt="" />
        <img v-else src="@/assets/images/r.png" alt="" />
纪泽龙's avatar
纪泽龙 committed
129 130 131 132 133
      </div>
      <!-- 只能动态传入内嵌盒子的高 -->
      <div class="scroll" :style="{ height: `${boxHeight}px` }">
        <el-input
          v-model="keyWord"
纪泽龙's avatar
纪泽龙 committed
134
          placeholder="点击输入设备名称"
纪泽龙's avatar
纪泽龙 committed
135 136
          id="tipinput"
          class="search-input"
137 138 139 140 141 142 143 144 145 146 147
        >
          <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
148 149 150 151 152 153 154 155 156 157 158 159 160

        <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,
              }"
161
              @click="arrowRightChange(item)"
纪泽龙's avatar
纪泽龙 committed
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
            >
              <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
185 186 187
                <!-- 有数据 -->
                <template v-if="item.list.length > 0">
                  <!-- 设备以及管道 展示内容是一样的 -->
纪泽龙's avatar
纪泽龙 committed
188
                  <template v-if="item.value != 8 && item.value != 9">
189
                    <div class="list-wrapper">
纪泽龙's avatar
纪泽龙 committed
190
                      <div class="thead">
纪泽龙's avatar
纪泽龙 committed
191
                        <div class="no"></div>
纪泽龙's avatar
纪泽龙 committed
192 193 194 195 196 197
                        <div class="code">设备编号</div>
                        <div class="name">设备名称</div>
                      </div>
                      <div
                        class="deviceList"
                        v-for="(iten, index) in item.list"
198 199 200 201
                        :class="{
                          topActive: index == 0,
                          textRed: iten.alarmState == 1,
                        }"
纪泽龙's avatar
纪泽龙 committed
202
                        :key="iten.deviceId + `` + index"
203
                        @click.stop="panToo(iten, item)"
纪泽龙's avatar
纪泽龙 committed
204
                      >
205 206 207
                        <div class="no">
                          {{ iten.no + 1 }}
                        </div>
纪泽龙's avatar
纪泽龙 committed
208 209 210 211 212 213 214
                        <div :title="iten.code" class="code">
                          {{ iten.code }}
                        </div>
                        <div :title="iten.deviceName" class="name">
                          {{ iten.deviceName }}
                        </div>
                      </div>
纪泽龙's avatar
纪泽龙 committed
215
                    </div>
纪泽龙's avatar
纪泽龙 committed
216
                  </template>
纪泽龙's avatar
纪泽龙 committed
217 218 219 220
                  <!-- 隐患的展示 -->
                  <template v-else-if="item.value == 8">
                    <div class="list-wrapper">
                      <div class="thead">
纪泽龙's avatar
纪泽龙 committed
221
                        <div class="no"></div>
纪泽龙's avatar
纪泽龙 committed
222 223 224 225 226 227 228 229
                        <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"
230
                        @click.stop="panToo(iten, item)"
纪泽龙's avatar
纪泽龙 committed
231 232 233 234 235 236 237 238 239 240 241
                      >
                        <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
242 243
                  <!-- 值班人员 展示不太一样-->
                  <template v-else-if="item.value == 9">
244
                    <div class="list-wrapper">
纪泽龙's avatar
纪泽龙 committed
245
                      <div class="thead">
纪泽龙's avatar
纪泽龙 committed
246
                        <div class="no"></div>
纪泽龙's avatar
纪泽龙 committed
247 248 249 250 251 252 253 254
                        <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"
255
                        @click.stop="panToo(iten, item)"
纪泽龙's avatar
纪泽龙 committed
256 257 258 259 260 261 262 263
                      >
                        <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
264 265
                      </div>
                    </div>
纪泽龙's avatar
纪泽龙 committed
266
                  </template>
纪泽龙's avatar
纪泽龙 committed
267

268
                  <!-- 翻页 -->
纪泽龙's avatar
纪泽龙 committed
269
                  <div class="goback">
270
                    <div class="btn-w">
纪泽龙's avatar
纪泽龙 committed
271
                      <el-button
272
                        class="btn backPage"
纪泽龙's avatar
纪泽龙 committed
273 274
                        type="mini"
                        :disabled="item.nowPage == 1"
纪泽龙's avatar
纪泽龙 committed
275
                        @click="pageBack(item, index)"
276 277 278
                        icon="el-icon-arrow-left"
                      />
                      <span class="btn-w-num">{{ item.nowPage }}</span>
纪泽龙's avatar
纪泽龙 committed
279
                      <el-button
280
                        class="btn goPage"
纪泽龙's avatar
纪泽龙 committed
281 282
                        type="mini"
                        :disabled="item.nowPage == item.maxPage"
纪泽龙's avatar
纪泽龙 committed
283
                        @click="pageGo(item, index)"
284 285
                        icon="el-icon-arrow-right"
                      />
纪泽龙's avatar
纪泽龙 committed
286 287
                    </div>
                  </div>
288
                </template>
纪泽龙's avatar
纪泽龙 committed
289 290
                <!-- 无数据 -->
                <template v-else>
291
                  <div style="padding-left: 5px; color: #fff">暂无数据</div>
纪泽龙's avatar
纪泽龙 committed
292
                </template>
纪泽龙's avatar
纪泽龙 committed
293 294 295 296 297 298
              </div>
            </el-collapse-transition>
          </div>
        </div>
      </div>
    </div>
耿迪迪's avatar
耿迪迪 committed
299 300 301
  </div>
</template>
<script>
纪泽龙's avatar
纪泽龙 committed
302 303
// import  from "utils/gaodeMapView.js";
import { pipeAllInfoList, countPipeLength } from "@/api/device/pipe.js";
纪泽龙's avatar
纪泽龙 committed
304 305 306 307 308
import gaodeMap, {
  map,
  DEVICE_TYPE,
  mapOperateType,
} from "utils/gaodeMapView.js";
309

纪泽龙's avatar
纪泽龙 committed
310
import { selectAlarmDevice } from "@/api/dataMonitoring/deviceAlarm.js";
纪泽龙's avatar
纪泽龙 committed
311
import { getAllDeviceInfo, countDeviceByType } from "@/api/device/deviceInfo";
312
import { getMapHiddenTroublelist } from "@/api/riskManagement/hiddenTrouble";
纪泽龙's avatar
纪泽龙 committed
313 314
import Bottom from "./components/Bottom.vue";
import Right from "./components/Right.vue";
纪泽龙's avatar
纪泽龙 committed
315
import CreateWork from "./components/CreateWork.vue";
纪泽龙's avatar
纪泽龙 committed
316
import CreateWorkTrouble from "./components/CreateWorkTrouble.vue";
纪泽龙's avatar
纪泽龙 committed
317
import { getInspectorLocations } from "@/api/inspectorLocation/location";
318
import { lineColor } from "@/utils/mapCommon.js";
纪泽龙's avatar
纪泽龙 committed
319

纪泽龙's avatar
纪泽龙 committed
320
export default {
纪泽龙's avatar
纪泽龙 committed
321
  components: {
纪泽龙's avatar
纪泽龙 committed
322
    Bottom,
纪泽龙's avatar
纪泽龙 committed
323
    CreateWork,
纪泽龙's avatar
纪泽龙 committed
324
    CreateWorkTrouble,
纪泽龙's avatar
纪泽龙 committed
325
    Right,
纪泽龙's avatar
纪泽龙 committed
326
  },
纪泽龙's avatar
纪泽龙 committed
327 328
  data() {
    return {
329
      lineColor,
纪泽龙's avatar
纪泽龙 committed
330 331 332 333
      gaoMap: null,
      deviceType: false,
      value: "",
      operateType: "",
纪泽龙's avatar
纪泽龙 committed
334 335 336 337
      radio1: "",
      // 1新建,2编辑,3删除,点按钮变色
      targetNum: 0,
      // 左边的bar的active判定
纪泽龙's avatar
纪泽龙 committed
338
      leftBarNum: [1, 2, 3, 4, 7, 8, 9],
纪泽龙's avatar
纪泽龙 committed
339 340
      // 右转箭头的样式active判定
      arrowRightNum: [],
纪泽龙's avatar
纪泽龙 committed
341 342 343 344 345 346
      // 新建里的值
      iconClass: "icon-create",
      createValue: 0,
      createLabel: "新增",
      changeBtnData: [
        {
纪泽龙's avatar
纪泽龙 committed
347
          type: "0",
纪泽龙's avatar
纪泽龙 committed
348 349 350
          value: 1,
          icon: "icon-gd",
          label: "管道",
纪泽龙's avatar
纪泽龙 committed
351 352 353
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
354 355
        },
        {
纪泽龙's avatar
纪泽龙 committed
356
          type: "1",
纪泽龙's avatar
纪泽龙 committed
357 358 359
          value: 2,
          icon: "icon-tyx",
          label: "调压箱",
纪泽龙's avatar
纪泽龙 committed
360 361 362
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
363 364
        },
        {
纪泽龙's avatar
纪泽龙 committed
365
          type: "2",
纪泽龙's avatar
纪泽龙 committed
366 367 368
          value: 3,
          icon: "icon-fmj",
          label: "阀门井",
纪泽龙's avatar
纪泽龙 committed
369 370 371
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
372 373
        },
        {
纪泽龙's avatar
纪泽龙 committed
374
          type: "3",
纪泽龙's avatar
纪泽龙 committed
375 376 377
          value: 4,
          icon: "icon-llj",
          label: "流量计",
纪泽龙's avatar
纪泽龙 committed
378 379 380
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
381 382
        },
        {
纪泽龙's avatar
纪泽龙 committed
383
          type: "4",
384
          value: 7,
纪泽龙's avatar
纪泽龙 committed
385 386
          icon: "icon-ylb",
          label: "压力表",
纪泽龙's avatar
纪泽龙 committed
387 388 389
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
390
        },
纪泽龙's avatar
纪泽龙 committed
391
        {
纪泽龙's avatar
纪泽龙 committed
392
          type: "5",
纪泽龙's avatar
纪泽龙 committed
393 394 395
          value: 8,
          icon: "icon-yh",
          label: "隐患",
纪泽龙's avatar
纪泽龙 committed
396 397 398
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
399 400
        },
        {
纪泽龙's avatar
纪泽龙 committed
401
          type: "6",
纪泽龙's avatar
纪泽龙 committed
402 403 404
          value: 9,
          icon: "icon-zhibanrenyuan",
          label: "值班人员",
纪泽龙's avatar
纪泽龙 committed
405 406 407
          nowPage: 1,
          maxPage: 99,
          list: [],
纪泽龙's avatar
纪泽龙 committed
408
        },
纪泽龙's avatar
纪泽龙 committed
409
      ],
纪泽龙's avatar
纪泽龙 committed
410 411
      // 这是图上所有的点
      allList: [[], [], [], [], [], [], []],
纪泽龙's avatar
纪泽龙 committed
412
      keyWord: "",
纪泽龙's avatar
纪泽龙 committed
413 414
      // 右下角的数据data
      rightBototmData: [],
纪泽龙's avatar
纪泽龙 committed
415
      bottomDataShow: true,
纪泽龙's avatar
纪泽龙 committed
416
      rightDataShow: true,
417 418
      // 如果右边与下面重叠了,bottom要往左移
      bottomMarginRight: false,
纪泽龙's avatar
纪泽龙 committed
419 420
      // 是否显示生成工单弹框
      createWorkOpen: false,
纪泽龙's avatar
纪泽龙 committed
421 422
      //隐患工单
      createWorkTroubleOpen: false,
纪泽龙's avatar
纪泽龙 committed
423
      // 查询用的
纪泽龙's avatar
纪泽龙 committed
424
      alarmObj: { alarmId: "", type: "" },
纪泽龙's avatar
纪泽龙 committed
425 426
      troubleObj: null,

纪泽龙's avatar
纪泽龙 committed
427 428
      //  左边抽屉 内嵌scroll盒子的高
      boxHeight: "",
429
      boxWidth: "",
430
      drawerOpacity: false,
纪泽龙's avatar
纪泽龙 committed
431 432
      //抽屉是否收回
      backFlag: true,
纪泽龙's avatar
纪泽龙 committed
433
      mapStyle: true,
纪泽龙's avatar
纪泽龙 committed
434 435
    };
  },
纪泽龙's avatar
纪泽龙 committed
436 437 438
  created() {
    // 让左边的框隐藏
    this.$store.dispatch("app/toggleDevice", "mobile");
439
    console.log("sasdasdas");
纪泽龙's avatar
纪泽龙 committed
440
  },
纪泽龙's avatar
纪泽龙 committed
441

纪泽龙's avatar
纪泽龙 committed
442
  mounted() {
纪泽龙's avatar
纪泽龙 committed
443
    // this.$nextTick(() => {
444 445 446 447

    this.onResize();
    window.removeEventListener("resize", this.onResize);
    window.addEventListener("resize", this.onResize);
纪泽龙's avatar
纪泽龙 committed
448
    this.initMap();
449

纪泽龙's avatar
纪泽龙 committed
450
    // });
纪泽龙's avatar
纪泽龙 committed
451 452
  },
  watch: {
453 454 455 456 457
    // changeBtnData: {
    //   handler(newName, oldName) {},
    //   deep: true,
    //   // immediate: true,
    // },
纪泽龙's avatar
纪泽龙 committed
458 459
  },
  methods: {
460
    onResize() {
纪泽龙's avatar
纪泽龙 committed
461
      this.boxHeight = document.body.clientHeight - 80;
462
      this.boxWidth = document.body.clientWidth;
463
      console.log("挂在");
464 465 466 467 468 469 470 471 472

      const {
        Bottom: { $el: pageDomBottom },
        Right: { $el: pageDomRight },
      } = this.$refs;
      // 右边的底
      const RightBottom = pageDomRight.offsetTop + pageDomRight.offsetHeight;
      // 下边的上边
      const bottomTop = pageDomBottom.offsetTop;
473
      if (RightBottom > bottomTop) {
474
        // 重叠了,bottom右移动
475
        this.bottomMarginRight = true;
476
      }
477
    },
478

纪泽龙's avatar
1  
纪泽龙 committed
479
    initMap() {
耿迪迪's avatar
耿迪迪 committed
480 481
      let gaoMap = new gaodeMap("石家庄");
      this.gaoMap = gaoMap;
482
      window.removeEventListener("mousedown", this.barClose);
纪泽龙's avatar
纪泽龙 committed
483
      window.addEventListener("mousedown", this.barClose);
耿迪迪's avatar
耿迪迪 committed
484 485
      gaoMap.addMouseTool();
      gaoMap.searchTips("tipinput");
纪泽龙's avatar
纪泽龙 committed
486 487
      // 获取地图上设备资源
      this.getResource();
纪泽龙's avatar
纪泽龙 committed
488 489
      // 把组件this传入类
      this.gaoMap.view = this;
纪泽龙's avatar
纪泽龙 committed
490
      // 右下角数据 跟值班人员
纪泽龙's avatar
纪泽龙 committed
491
      this.rightBottomData();
492
      // this.backFlag = false;
纪泽龙's avatar
纪泽龙 committed
493
    },
纪泽龙's avatar
纪泽龙 committed
494 495 496 497 498 499 500 501 502
    // 更改卫星图
    mapChange(num) {
      if (num == 1) {
        this.mapStyle = false;
      } else {
        this.mapStyle = true;
      }
      this.gaoMap.changeMap(this.mapStyle);
    },
纪泽龙's avatar
纪泽龙 committed
503

纪泽龙's avatar
纪泽龙 committed
504 505 506 507 508 509 510 511 512 513 514
    // 获取地图上的资源
    getResource() {
      this.getDeviceInfo()
        .then((res) => {
          if (res == 200) {
            console.log(res);
            return this.getPipeList();
          }
        })
        .then((res) => {
          if (res == 200) {
纪泽龙's avatar
纪泽龙 committed
515 516 517 518
            // 值班人员
            return this.getInspectorLocations();
          }
        })
519 520 521 522 523 524
        .then((res) => {
          if (res == 200) {
            //隐患
            return this.getMapHiddenTroublelist();
          }
        })
纪泽龙's avatar
纪泽龙 committed
525 526 527
        .then((res) => {
          if (res == 200) {
            // 所有设备上图结束之后,左边的抽屉加载数据
528 529 530 531
            this.pipeList().then((res) => {
              console.log("开始报警准备");
              this.getSelectAlarmDevice();
            });
纪泽龙's avatar
纪泽龙 committed
532 533 534 535
            // 获取报警资源
          }
        });
    },
536
    // 设备
纪泽龙's avatar
纪泽龙 committed
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559
    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
560 561
          }
        }
纪泽龙's avatar
纪泽龙 committed
562 563
        this.loading = false;
        return response.code;
纪泽龙's avatar
纪泽龙 committed
564
      });
纪泽龙's avatar
纪泽龙 committed
565
    },
566
    // 管道
纪泽龙's avatar
纪泽龙 committed
567 568 569
    getPipeList(queryParams) {
      return pipeAllInfoList(queryParams).then((res) => {
        console.log("管道", res);
纪泽龙's avatar
纪泽龙 committed
570
        if (res.code == 200) {
纪泽龙's avatar
纪泽龙 committed
571 572
          this.gaoMap.addPolyline(res.data);
          this.pipeClassify(res.data);
纪泽龙's avatar
纪泽龙 committed
573
        }
纪泽龙's avatar
纪泽龙 committed
574
        return res.code;
纪泽龙's avatar
纪泽龙 committed
575
      });
耿迪迪's avatar
耿迪迪 committed
576
    },
纪泽龙's avatar
纪泽龙 committed
577
    //值班人员
纪泽龙's avatar
纪泽龙 committed
578 579
    getInspectorLocations(queryParams) {
      return getInspectorLocations(queryParams).then((res) => {
纪泽龙's avatar
纪泽龙 committed
580 581 582 583 584 585 586 587 588 589
        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
590
        }
纪泽龙's avatar
纪泽龙 committed
591 592
        return res.code;
      });
纪泽龙's avatar
纪泽龙 committed
593
    },
594 595
    // 隐患
    getMapHiddenTroublelist(queryParams) {
纪泽龙's avatar
纪泽龙 committed
596
      return getMapHiddenTroublelist(queryParams).then((res) => {
597
        console.log(res);
598
        if (res.code == 200) {
纪泽龙's avatar
纪泽龙 committed
599
          this.troubleClassify(res.data);
600 601 602 603 604 605 606 607
          res.data.forEach((item) => {
            console.log("隐患", item);
            this.gaoMap.addMarker(DEVICE_TYPE.TROUBLE, item);
          });
          return res.code;
        }
      });
    },
纪泽龙's avatar
纪泽龙 committed
608 609
    // 获取报警资源,并且改变图上的状态
    getSelectAlarmDevice() {
610
      return selectAlarmDevice().then((res) => {
纪泽龙's avatar
纪泽龙 committed
611 612
        if (res.length > 0) {
        }
纪泽龙's avatar
纪泽龙 committed
613 614
        console.log("报警设备", res);
        this.statusChange(res);
纪泽龙's avatar
纪泽龙 committed
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
      });
    },
    // 遍历设备改变状态 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
631 632
          const { deviceId, orderId, alarmId, alarmType, alarmValue, endTime } =
            item;
纪泽龙's avatar
纪泽龙 committed
633
          console.log("endTime", endTime);
纪泽龙's avatar
纪泽龙 committed
634 635 636 637 638
          // 获取polyLine
          const polyline = this.gaoMap.polyLines.filter((item) => {
            const pipeId = item.getExtData().lineData.pipeId;
            return deviceId == pipeId;
          })[0];
639

纪泽龙's avatar
纪泽龙 committed
640 641
          if (polyline) {
            let options = polyline.getExtData();
642

纪泽龙's avatar
纪泽龙 committed
643 644 645 646 647 648
            // 增加一个报警状态
            // 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
            options.lineData.view = this;
            options.lineData.alarmId = alarmId;
            options.lineData.orderId = orderId;
            if (endTime) {
649
              polyline.setOptions({ strokeColor: "#2EE7E7" });
纪泽龙's avatar
纪泽龙 committed
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665
              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);
666 667 668 669 670 671 672 673 674
            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
675 676 677 678
          }
        });
      }

679
      console.log("deviceArr", deviceArr);
纪泽龙's avatar
纪泽龙 committed
680 681 682 683
      // 其他设备
      if (deviceArr.length > 0) {
        deviceArr.forEach((item) => {
          // 获取循报警设备的id
684 685
          const { deviceId, alarmId, alarmType, alarmValue, endTime, orderId } =
            item;
纪泽龙's avatar
纪泽龙 committed
686 687
          // 获取polyLine
          const device = this.gaoMap.markers.filter((item) => {
688 689 690
            const { deviceId: id, troubleId } = item.getExtData();
            // 因为隐患也有 deviceId,为了防止隐患直接遍成报警状态,所以要排除隐患,没有troubleId的就不是隐患
            return !troubleId && deviceId == id;
纪泽龙's avatar
纪泽龙 committed
691
          })[0];
纪泽龙's avatar
纪泽龙 committed
692 693 694 695 696 697 698
          if (device) {
            const options = device.getExtData();
            // 增加一个报警状态
            // 如果有endtime说明状态已经不是报警状态了,要归位,所有东西都要变回来
            options.view = this;
            options.alarmId = alarmId;
            options.orderId = orderId;
纪泽龙's avatar
纪泽龙 committed
699
            if (endTime) {
纪泽龙's avatar
纪泽龙 committed
700 701 702 703 704
              options.alarmState = 0;
              // 报警类型
              options.alarmType = null;
              // 报警信息
              options.alarmValue = null;
纪泽龙's avatar
纪泽龙 committed
705
            } else {
纪泽龙's avatar
纪泽龙 committed
706 707 708 709 710
              options.alarmState = 1;
              // 报警类型
              options.alarmType = alarmType;
              // 报警信息
              options.alarmValue = alarmValue;
纪泽龙's avatar
纪泽龙 committed
711
            }
纪泽龙's avatar
纪泽龙 committed
712
            device.setExtData(options);
713 714 715 716 717 718 719 720 721 722 723 724 725

            // 找到是列表里的哪个,改变它的状态,让列表里的这个设备变成红色
            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
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
            // 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
755
            }
纪泽龙's avatar
纪泽龙 committed
756 757 758
          }
        });
      }
纪泽龙's avatar
纪泽龙 committed
759
      if (this.ws) return;
纪泽龙's avatar
纪泽龙 committed
760 761
      this.socket();
    },
纪泽龙's avatar
纪泽龙 committed
762 763 764
    socket() {
      console.log("socket执行");
      this.ws = new WebSocket(
765
        "ws://36.148.23.59:8901/gassafety/websocketServer"
纪泽龙's avatar
纪泽龙 committed
766
      );
767 768 769
      // this.ws = new WebSocket(
      //   "ws://192.168.2.23:8903/gassafety/websocketServer"
      // );
纪泽龙's avatar
纪泽龙 committed
770
      this.ws.onopen = (evt) => {
771
        console.log("WebSockets开启");
纪泽龙's avatar
纪泽龙 committed
772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
      };
      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() {
787
      this.rightBototmData = [];
纪泽龙's avatar
纪泽龙 committed
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835
      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
836
      this.gaoMap.closeInfoWindow();
837 838
      this.domAllShow();

纪泽龙's avatar
纪泽龙 committed
839
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
840 841 842 843 844
      const index = this.leftBarNum.indexOf(item.value);
      if (index >= 0) {
        this.leftBarNum.splice(index, 1);
      } else {
        this.leftBarNum.push(item.value);
845
        this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
846 847
      }
      // 1,2,3,4,7分别对应数据库type5,1,2,3,4
848
      // console.log(this.leftBarNum);
纪泽龙's avatar
纪泽龙 committed
849 850
      if (this.leftBarNum.includes(1)) {
        this.gaoMap.lineShow(true);
851
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
852 853 854 855 856 857 858 859
      } else {
        this.gaoMap.lineShow(false);
      }

      // console.log("marks",this.gaoMap.markers)
      // this.gaoMap.markerShow();
      if (this.leftBarNum.includes(2)) {
        this.gaoMap.markerShow(1, true);
860
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
861 862 863 864 865 866
      } else {
        this.gaoMap.markerShow(1, false);
      }

      if (this.leftBarNum.includes(3)) {
        this.gaoMap.markerShow(2, true);
867
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
868 869 870 871 872 873
      } else {
        this.gaoMap.markerShow(2, false);
      }

      if (this.leftBarNum.includes(4)) {
        this.gaoMap.markerShow(3, true);
874
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
875 876 877 878 879 880
      } else {
        this.gaoMap.markerShow(3, false);
      }

      if (this.leftBarNum.includes(7)) {
        this.gaoMap.markerShow(4, true);
881
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
882 883 884
      } else {
        this.gaoMap.markerShow(4, false);
      }
纪泽龙's avatar
纪泽龙 committed
885 886 887 888 889 890 891
      // 隐患
      if (this.leftBarNum.includes(8)) {
        this.gaoMap.markerShow(8, true);
        // this.panTo(item);
      } else {
        this.gaoMap.markerShow(8, false);
      }
纪泽龙's avatar
纪泽龙 committed
892 893 894

      if (this.leftBarNum.includes(9)) {
        this.gaoMap.markerShow(9, true);
895
        // this.panTo(item);
纪泽龙's avatar
纪泽龙 committed
896 897 898 899
      } else {
        this.gaoMap.markerShow(9, false);
      }
    },
900
    panTo(item, bool) {
纪泽龙's avatar
纪泽龙 committed
901
      this.gaoMap.myMap.setZoom(12);
902 903
      if (item.list.length > 0) {
        if (this.leftBarNum.includes(item.value)) {
纪泽龙's avatar
纪泽龙 committed
904 905 906 907 908 909 910 911 912
          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
913
            path = [a, b - 0.08];
纪泽龙's avatar
纪泽龙 committed
914
          } else {
纪泽龙's avatar
纪泽龙 committed
915
            path = [item.list[0].path[0], item.list[0].path[1] - 0.08];
纪泽龙's avatar
纪泽龙 committed
916 917
          }
          this.gaoMap.panTo(path);
918 919 920 921
        }
      }
    },
    panToo(iten, item) {
922
      this.domAllShow();
923
      // 如果没打对勾,就啥也不干
纪泽龙's avatar
纪泽龙 committed
924
      if (!this.leftBarNum.includes(item.value)) return;
925 926
      // 点击的时候允许infowindow消失
      this.gaoMap.leftListClick = true;
927
      // 如果地图太大了就吸纳是不出来infowindow了,所以要固定缩放比例
纪泽龙's avatar
纪泽龙 committed
928 929
      // 所有线条颜色还原
      this.gaoMap.polyLinesColorClear();
纪泽龙's avatar
纪泽龙 committed
930
      this.gaoMap.myMap.setZoom(12);
931 932
      if (item.list.length > 0) {
        if (this.leftBarNum.includes(item.value)) {
纪泽龙's avatar
纪泽龙 committed
933 934 935 936 937
          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
938
            path = [a, b - 0.08];
纪泽龙's avatar
纪泽龙 committed
939
            // 线条infowindow显示中间,保留六位转换字符串,否则有时候会出现一些问题
纪泽龙's avatar
纪泽龙 committed
940 941 942
            iten.infoPath = [a.toFixed(6), b.toFixed(6)];
            console.log(path);
          } else {
纪泽龙's avatar
纪泽龙 committed
943
            path = [iten.path[0], iten.path[1] - 0.08];
纪泽龙's avatar
纪泽龙 committed
944 945 946 947 948
          }
          // const path =
          //   item.value == 1
          //     ? [iten.lnglat[0], iten.lnglat[1] - 0.1]
          //     : [iten.path[0], iten.path[1] - 0.1];
949
          this.gaoMap.panTo(path);
950 951 952 953 954 955 956 957 958
        }
      }
      // 当前地图中心点
      const { lat, lng } = this.gaoMap.myMap.getCenter();
      // 管道是这个方法,因为管道比较特殊
      if (item.value == 1) {
        this.polylineInfoWindowShow(iten, lat, lng);
      } else if (item.value == 9) {
        // 工作人员
纪泽龙's avatar
纪泽龙 committed
959
        this.workerManInfoWindowShow(iten, lat, lng);
纪泽龙's avatar
纪泽龙 committed
960
      } else if (item.value == 8) {
纪泽龙's avatar
纪泽龙 committed
961
        this.trouleInfoWindowShow(iten, lat, lng);
962 963 964 965 966
      } else {
        // 其他设备
        this.diveceInfoWindowShow(iten, lat, lng);
      }
    },
纪泽龙's avatar
纪泽龙 committed
967
    // 如果是线条飞过去出现infowindow
968 969 970 971 972 973 974
    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
975
        lnglat: iten.infoPath,
976
      };
纪泽龙's avatar
纪泽龙 committed
977
      // console.log(target.getOptions());
978 979
      console.log(iten.infoPath[0] - lng, iten.infoPath[1] - (lat + 0.1));

980
      // 如果是原地不动,就直接执行
981 982
      // if (iten.infoPath[0] == lng && iten.infoPath[1] == lat + 0.1) {
      if (
983
        iten.infoPath[0] - lng >= -0.00001 &&
984
        iten.infoPath[0] - lng <= 0.00001 &&
纪泽龙's avatar
纪泽龙 committed
985 986
        iten.infoPath[1] - (lat + 0.08) >= -0.00001 &&
        iten.infoPath[1] - (lat + 0.08) <= 0.00001
987
      ) {
988
        this.gaoMap.leftListClick = false;
989
        this.gaoMap.polylineMouseOver(e);
纪泽龙's avatar
纪泽龙 committed
990
        target.setOptions({ strokeColor: "#F7FE38" });
991 992
        return;
      }
纪泽龙's avatar
纪泽龙 committed
993

994 995 996
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.polylineMouseOver(e);
纪泽龙's avatar
纪泽龙 committed
997
        target.setOptions({ strokeColor: "#F7FE38" });
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
      };
    },
    // 这个是其他设备的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
1011 1012
      // if (iten.path[0] == lng && iten.path[1] == lat + 0.08) {
      if (iten.path[0] == lng && iten.path[1] >= lat + 0.08 - 0.000001) {
1013
        this.gaoMap.leftListClick = false;
1014 1015 1016 1017 1018 1019 1020 1021
        this.gaoMap.infoOpen(e);
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.infoOpen(e);
      };
    },
纪泽龙's avatar
纪泽龙 committed
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032
    // 隐患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
1033 1034
      // if (iten.path[0] == lng && iten.path[1] == lat + 0.08) {
      if (iten.path[0] == lng && iten.path[1] >= lat + 0.08 - 0.000001) {
1035
        this.gaoMap.leftListClick = false;
纪泽龙's avatar
纪泽龙 committed
1036 1037 1038 1039 1040 1041 1042 1043
        this.gaoMap.troubleOpen(e);
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.troubleOpen(e);
      };
    },
纪泽龙's avatar
纪泽龙 committed
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
    // 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
1056 1057 1058
      // 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) {
1059
        this.gaoMap.leftListClick = false;
纪泽龙's avatar
纪泽龙 committed
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069
        this.gaoMap.wokerManOpen(e);
        return;
      }
      // 因为地图移动的时候infowindow无法显示
      this.gaoMap.handleInfoWindowOpenFunc = () => {
        this.gaoMap.wokerManOpen(e);
      };
    },

    // 向右的箭头的动画
纪泽龙's avatar
纪泽龙 committed
1070 1071 1072 1073 1074 1075 1076
    arrowRightChange(item) {
      const index = this.arrowRightNum.indexOf(item.value);
      if (index >= 0) {
        this.arrowRightNum.splice(index, 1);
      } else {
        this.arrowRightNum.push(item.value);
      }
1077
      this.domAllShow();
纪泽龙's avatar
纪泽龙 committed
1078 1079 1080 1081 1082
    },

    // 管道储存
    pipeClassify(pipeData) {
      const pipeArr = pipeData.map((item, index) => {
1083
        // console.log( '管道路径',eval(item.coordinates )[0])
纪泽龙's avatar
纪泽龙 committed
1084
        return {
1085 1086
          lnglat: eval(item.coordinates)[0],
          path: eval(item.coordinates)[1],
纪泽龙's avatar
纪泽龙 committed
1087 1088 1089 1090 1091
          no: index,
          deviceId: item.pipeId,
          deviceType: "0",
          deviceName: item.pipeName,
          code: item.pipeCode,
1092 1093
          alarmState: item.alarmState ? item.alarmState : "0",
          selfData: item,
纪泽龙's avatar
纪泽龙 committed
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107
        };
      });
      this.allList[0] = pipeArr;
      console.log("管道", pipeArr);
    },
    // 设备分类存储
    deviceClassify(data) {
      // 所有调压箱数据
      const tyxArr = data
        .filter((item) => {
          return item.deviceType == 1;
        })
        .map((item, index) => {
          return {
1108
            path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1109 1110 1111 1112 1113
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
1114 1115
            alarmState: item.alarmState ? item.alarmState : "0",
            selfData: item,
纪泽龙's avatar
纪泽龙 committed
1116 1117 1118 1119 1120 1121 1122 1123 1124
          };
        });
      // 所有阀门井数据
      const fmjArr = data
        .filter((item) => {
          return item.deviceType == 2;
        })
        .map((item, index) => {
          return {
1125
            path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1126 1127 1128 1129 1130
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
1131 1132
            alarmState: item.alarmState ? item.alarmState : "0",
            selfData: item,
纪泽龙's avatar
纪泽龙 committed
1133 1134 1135 1136 1137 1138 1139 1140 1141
          };
        });
      // 所有流量计数据
      const lljArr = data
        .filter((item) => {
          return item.deviceType == 3;
        })
        .map((item, index) => {
          return {
1142
            path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1143 1144 1145 1146 1147
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
1148 1149
            alarmState: item.alarmState ? item.alarmState : "0",
            selfData: item,
纪泽龙's avatar
纪泽龙 committed
1150 1151 1152 1153 1154 1155 1156 1157 1158
          };
        });
      // 所有压力表数据
      const ylbArr = data
        .filter((item) => {
          return item.deviceType == 4;
        })
        .map((item, index) => {
          return {
1159
            path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1160 1161 1162 1163 1164
            no: index,
            deviceId: item.deviceId,
            deviceType: item.deviceType,
            deviceName: item.deviceName,
            code: item.iotNo,
1165 1166
            alarmState: item.alarmState ? item.alarmState : "0",
            selfData: item,
纪泽龙's avatar
纪泽龙 committed
1167 1168
          };
        });
1169
      // console.log("设备", tyxArr, fmjArr, lljArr, ylbArr);
纪泽龙's avatar
纪泽龙 committed
1170 1171 1172 1173 1174
      this.allList[1] = tyxArr;
      this.allList[2] = fmjArr;
      this.allList[3] = lljArr;
      this.allList[4] = ylbArr;
    },
纪泽龙's avatar
纪泽龙 committed
1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188
    // 隐患存储
    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
1189
    // 值班人员
纪泽龙's avatar
纪泽龙 committed
1190 1191 1192
    workerManClassify(workManData) {
      const workManArr = workManData.map((item, index) => {
        return {
1193
          path: [item.longitude, item.latitude],
纪泽龙's avatar
纪泽龙 committed
1194 1195
          no: index,
          userId: item.userId,
1196
          userName: item.nickName,
1197
          userPhone: item.phonenumber,
纪泽龙's avatar
纪泽龙 committed
1198 1199 1200 1201 1202 1203
        };
      });
      console.log("值班人员", workManArr);
      this.allList[6] = workManArr;
    },
    // 左边设备翻页
1204
    async pipeList(pageNum) {
纪泽龙's avatar
纪泽龙 committed
1205 1206 1207 1208 1209 1210 1211
      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) => {
1212
        // console.log("=======", index, this.allList[index]);
纪泽龙's avatar
纪泽龙 committed
1213 1214 1215 1216 1217 1218 1219
        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);
1220
        } else {
纪泽龙's avatar
纪泽龙 committed
1221
          // 如果为空,就直接把item.list写成[];
1222
          item.list = [];
纪泽龙's avatar
纪泽龙 committed
1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251
        }
      });
    },
    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
1252

纪泽龙's avatar
纪泽龙 committed
1253 1254 1255
      this.deviceType = !this.deviceType;
      this.gaoMap.mapOperateType = "add";
      this.gaoMap.removeMarkerDragg();
纪泽龙's avatar
纪泽龙 committed
1256
    },
1257 1258

    // 选择新建项目哪个
纪泽龙's avatar
纪泽龙 committed
1259 1260
    createChange(e, item) {
      // e.stopPropagation();
纪泽龙's avatar
纪泽龙 committed
1261 1262 1263 1264
      this.deviceType = false;
      this.iconClass = item.icon;
      this.createValue = item.value;
      this.createLabel = item.label;
纪泽龙's avatar
1  
纪泽龙 committed
1265

纪泽龙's avatar
纪泽龙 committed
1266
      if (this.targetNum == 1 && this.createValue == 1) {
纪泽龙's avatar
纪泽龙 committed
1267
        // 0是初始,1是新建 2是编辑 3删除
纪泽龙's avatar
纪泽龙 committed
1268
        this.gaoMap.lineType = 1;
纪泽龙's avatar
纪泽龙 committed
1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279
        if (this.gaoMap.newLineObj == null) {
          this.gaoMap.createNewLine();
        }
      } else {
        // 如果不是管道,就归位
        this.gaoMap.lineType = 0;
        // 如果不是管道了,把之前的管道清空
        this.gaoMap.newLineReset();

        // this.createReset();
        // 其他
耿迪迪's avatar
耿迪迪 committed
1280
        this.gaoMap.draw(this.createValue.toString());
纪泽龙's avatar
纪泽龙 committed
1281
      }
纪泽龙's avatar
纪泽龙 committed
1282 1283
      // 清空所有正在编辑状态的线
      this.gaoMap.linePolyEditorAllClose();
纪泽龙's avatar
纪泽龙 committed
1284
    },
纪泽龙's avatar
纪泽龙 committed
1285

纪泽龙's avatar
纪泽龙 committed
1286 1287 1288 1289 1290
    // 新建按钮还原
    createReset() {
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
1291
      this.gaoMap.closeAddMarker();
纪泽龙's avatar
纪泽龙 committed
1292
    },
纪泽龙's avatar
纪泽龙 committed
1293
    editDevice() {
纪泽龙's avatar
纪泽龙 committed
1294
      this.targetNum = this.targetNum != 2 ? 2 : 0;
纪泽龙's avatar
纪泽龙 committed
1295 1296
      this.gaoMap.lineType = this.targetNum;
      if (this.targetNum != 2) {
纪泽龙's avatar
纪泽龙 committed
1297
        this.gaoMap.linePolyEditorAllClose();
1298 1299
        this.gaoMap.removeMarkerDragg();
        this.gaoMap.mapOperateType = "normal";
纪泽龙's avatar
1  
纪泽龙 committed
1300
      } else {
1301 1302 1303 1304 1305 1306 1307
        // 如果正在新建线条,则清空
        this.gaoMap.newLineReset();
        this.deviceType = false;
        this.gaoMap.mapOperateType = "edit";
        this.gaoMap.addMarkerDragg();
        // this.gaoMap.placeSearch.clear();
        this.gaoMap.closeAddMarker();
纪泽龙's avatar
纪泽龙 committed
1308
      }
纪泽龙's avatar
1  
纪泽龙 committed
1309
      // 关闭当前的infowindow
纪泽龙's avatar
纪泽龙 committed
1310
      this.gaoMap.closeInfoWindow();
纪泽龙's avatar
纪泽龙 committed
1311
      this.createReset();
耿迪迪's avatar
耿迪迪 committed
1312
    },
纪泽龙's avatar
纪泽龙 committed
1313
    deleteDevice() {
纪泽龙's avatar
纪泽龙 committed
1314
      this.targetNum = this.targetNum != 3 ? 3 : 0;
纪泽龙's avatar
纪泽龙 committed
1315
      this.gaoMap.lineType = this.targetNum;
1316 1317 1318
      if (this.targetNum != 3) {
        this.gaoMap.removeMarkerDragg();
        this.gaoMap.mapOperateType = "normal";
纪泽龙's avatar
1  
纪泽龙 committed
1319
      } else {
1320 1321 1322 1323 1324 1325 1326 1327 1328 1329
        // 如果正在新建线条,则清空
        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
1330
      // 关闭当前的infowindow
纪泽龙's avatar
纪泽龙 committed
1331
      this.gaoMap.closeInfoWindow();
纪泽龙's avatar
纪泽龙 committed
1332
      this.createReset();
耿迪迪's avatar
耿迪迪 committed
1333
    },
纪泽龙's avatar
纪泽龙 committed
1334
    selectDeviceType(val) {
纪泽龙's avatar
纪泽龙 committed
1335 1336 1337
      // if("add" == this.operationType){
      this.gaoMap.draw(val);
      // }
纪泽龙's avatar
纪泽龙 committed
1338 1339 1340 1341 1342 1343
      this.deviceType = false;
      this.value = "";
      // 如果选择的是新建管道
      if (val == 1) {
        this.gaoMap.lineType = 1;
        this.gaoMap.createNewLine();
耿迪迪's avatar
耿迪迪 committed
1344
      }
纪泽龙's avatar
纪泽龙 committed
1345
    },
纪泽龙's avatar
纪泽龙 committed
1346

纪泽龙's avatar
1  
纪泽龙 committed
1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357
    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
1358
      // map.remove(this.gaodeMap.markerOverlays);
纪泽龙's avatar
1  
纪泽龙 committed
1359
    },
纪泽龙's avatar
纪泽龙 committed
1360
    // 搜索
纪泽龙's avatar
纪泽龙 committed
1361
    async search() {
纪泽龙's avatar
1  
纪泽龙 committed
1362
      this.searchClear();
耿迪迪's avatar
耿迪迪 committed
1363
      map.clearMap();
1364
      this.gaoMap.placeSearch.clear();
纪泽龙's avatar
1  
纪泽龙 committed
1365
      if (!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)) {
耿迪迪's avatar
耿迪迪 committed
1366 1367
        this.gaoMap.placeSearch.setCity(this.gaoMap.searchSelectAdcode);
        this.gaoMap.placeSearch.search(this.gaoMap.searchSelectName);
纪泽龙's avatar
1  
纪泽龙 committed
1368
        this.getDeviceInfo({ deviceName: this.gaoMap.searchSelectName });
耿迪迪's avatar
耿迪迪 committed
1369
        this.gaoMap.polyLines = [];
纪泽龙's avatar
1  
纪泽龙 committed
1370
        this.getPipeList({ pipeName: this.gaoMap.searchSelectName });
耿迪迪's avatar
耿迪迪 committed
1371 1372
        this.gaoMap.searchSelectAdcode = undefined;
        this.gaoMap.searchSelectName = undefined;
纪泽龙's avatar
1  
纪泽龙 committed
1373
      } else {
纪泽龙's avatar
纪泽龙 committed
1374 1375
        // 左边全选
        this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
1376
        // this.arrowRightNum=[];
纪泽龙's avatar
纪泽龙 committed
1377
        // 右转箭头的样式active判定
纪泽龙's avatar
纪泽龙 committed
1378
        // this.arrowRightNum = [];
纪泽龙's avatar
纪泽龙 committed
1379 1380 1381
        // 清空左边列表
        // this.changeBtnDataClear();
        // this.gaoMap.placeSearch.search(this.keyWord);
1382
        this.gaoMap.markers = [];
耿迪迪's avatar
耿迪迪 committed
1383
        this.gaoMap.polyLines = [];
1384
        await this.getDeviceInfo({ deviceName: this.keyWord });
纪泽龙's avatar
纪泽龙 committed
1385
        await this.getPipeList({ pipeName: this.keyWord });
纪泽龙's avatar
纪泽龙 committed
1386
        // 值班人员
纪泽龙's avatar
纪泽龙 committed
1387
        await this.getInspectorLocations({ userName: this.keyWord });
纪泽龙's avatar
纪泽龙 committed
1388 1389
        await this.getMapHiddenTroublelist({ troubleName: this.keyWord });

纪泽龙's avatar
纪泽龙 committed
1390 1391 1392
        this.changeBtnData.forEach((item) => {
          item.nowPage = 1;
        });
1393 1394 1395 1396
        this.pipeList().then(() => {
          // 设备报警
          this.getSelectAlarmDevice();
        });
耿迪迪's avatar
耿迪迪 committed
1397
      }
纪泽龙's avatar
纪泽龙 committed
1398
    },
纪泽龙's avatar
纪泽龙 committed
1399 1400 1401 1402 1403 1404 1405 1406 1407 1408
    // 清空左边列表
    changeBtnDataClear() {
      this.allList = [];
      this.changeBtnData.forEach((item) => {
        // 清空list
        item.list = [];
        item.maxPage = 99;
        item.nowPage = 1;
      });
    },
纪泽龙's avatar
纪泽龙 committed
1409
    // 新建下拉列表关闭 window点击事件
纪泽龙's avatar
纪泽龙 committed
1410
    barClose() {
1411
      // 一点windowbottomData显示
1412
      // this.bottomDataShow = true;
纪泽龙's avatar
纪泽龙 committed
1413
      // return;
纪泽龙's avatar
纪泽龙 committed
1414
      console.log("window");
1415
      // 颜色恢复
1416

纪泽龙's avatar
纪泽龙 committed
1417
      this.deviceType = false;
纪泽龙's avatar
纪泽龙 committed
1418
      // 关闭当前线条的infowindow
1419
      // this.gaoMap.closeInfoWindow();
纪泽龙's avatar
纪泽龙 committed
1420 1421 1422 1423 1424
      // 如果没有选择的时候点window 则高亮消失
      if (this.targetNum == 1 && this.iconClass == "icon-create") {
        this.targetNum = 0;
      }
      // 辅助新建重新画线
纪泽龙's avatar
纪泽龙 committed
1425
      // if (!this.gaoMap.lineFlag || this.gaoMap.lineType != 1) return;
纪泽龙's avatar
纪泽龙 committed
1426
      // console.log("利用window把lineFlagh恢复");
纪泽龙's avatar
纪泽龙 committed
1427
      this.gaoMap.lineFlag = false;
纪泽龙's avatar
纪泽龙 committed
1428
      // this.gaoMap.createNewLine();
纪泽龙's avatar
纪泽龙 committed
1429
    },
1430 1431 1432 1433
    domAllShow() {
      this.bottomDataShow = true;
      this.rightDataShow = true;
    },
纪泽龙's avatar
1  
纪泽龙 committed
1434
    refreshMap() {
纪泽龙's avatar
纪泽龙 committed
1435
      // this.changeBtnDataClear();
纪泽龙's avatar
纪泽龙 committed
1436 1437
      this.keyWord = "";
      this.arrowRightNum = [];
纪泽龙's avatar
1  
纪泽龙 committed
1438 1439 1440 1441
      this.iconClass = "icon-create";
      this.createValue = 0;
      this.createLabel = "新建";
      this.targetNum = 0;
纪泽龙's avatar
纪泽龙 committed
1442 1443 1444
      this.changeBtnData.forEach((item) => {
        item.nowPage = 1;
      });
耿迪迪's avatar
耿迪迪 committed
1445
      map.clearMap();
1446

纪泽龙's avatar
纪泽龙 committed
1447
      this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
纪泽龙's avatar
纪泽龙 committed
1448
      this.initMap();
纪泽龙's avatar
1  
纪泽龙 committed
1449
    },
纪泽龙's avatar
纪泽龙 committed
1450 1451 1452 1453 1454 1455 1456
    // 改变工单弹框状态
    // openChange(bool) {
    //   this.createWorkOpen = bool;
    // },
    // openTroubleChange(bool) {
    //   this.createWorkTroubleOpen = bool;
    // },
纪泽龙's avatar
纪泽龙 committed
1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477
    // 生成工单的回调
    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);
      }
1478 1479
      // 工单弹框生成之后执行的方法
    },
纪泽龙's avatar
纪泽龙 committed
1480 1481 1482
    alarmObjChange(obj) {
      this.alarmObj = obj;
      console.log(this.alarmObj);
1483
    },
纪泽龙's avatar
纪泽龙 committed
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501
    // 隐患
    // 手动加入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;
    },
1502
    drawerClick() {
1503
      console.log("drawerClick");
1504
      this.gaoMap.polyLinesColorClear();
1505
      this.gaoMap.closeInfoWindow();
1506
      this.domAllShow();
1507
    },
纪泽龙's avatar
纪泽龙 committed
1508 1509 1510
  },

  beforeDestroy() {
1511
    // 让抽屉继续隐身
纪泽龙's avatar
纪泽龙 committed
1512
    console.log("移除window事件");
纪泽龙's avatar
纪泽龙 committed
1513 1514
    map.clearMap();
    window.removeEventListener("mousedown", this.barClose);
1515 1516
    window.removeEventListener("resize", this.onResize);

纪泽龙's avatar
纪泽龙 committed
1517
    // 关闭scoket
纪泽龙's avatar
纪泽龙 committed
1518
    if (this.ws) {
1519
      console.log("socket关闭了");
纪泽龙's avatar
纪泽龙 committed
1520
      this.ws.close();
纪泽龙's avatar
纪泽龙 committed
1521
      this.ws = null;
纪泽龙's avatar
纪泽龙 committed
1522
    }
纪泽龙's avatar
纪泽龙 committed
1523 1524
  },
};
耿迪迪's avatar
耿迪迪 committed
1525
</script>
纪泽龙's avatar
纪泽龙 committed
1526 1527


耿迪迪's avatar
耿迪迪 committed
1528
<style lang="scss" scoped>
纪泽龙's avatar
纪泽龙 committed
1529
#container {
纪泽龙's avatar
纪泽龙 committed
1530 1531
  position: fixed;
  top: 80px;
纪泽龙's avatar
纪泽龙 committed
1532
  bottom: 0;
纪泽龙's avatar
纪泽龙 committed
1533 1534
  width: 100%;
}
1535
// 如果right与bottom 重叠,则bottom左移动
1536
.bottomMarginRight {
1537 1538
  right: 280px;
}
1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617
// .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
1618

1619 1620 1621 1622 1623 1624 1625
//         &:hover {
//           background-image: url("../../../assets/images/bac1.png");
//         }
//       }
//     }
//   }
// }
纪泽龙's avatar
纪泽龙 committed
1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644
.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
1645

纪泽龙's avatar
纪泽龙 committed
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665
.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
1666

纪泽龙's avatar
纪泽龙 committed
1667 1668 1669 1670
.input-text {
  width: 4rem;
  margin-right: 1rem;
}
耿迪迪's avatar
耿迪迪 committed
1671

纪泽龙's avatar
纪泽龙 committed
1672
.classShow {
1673 1674
  opacity: 0;
}
纪泽龙's avatar
纪泽龙 committed
1675 1676 1677 1678 1679
.drawer {
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 0;
1680
  width: 348px;
纪泽龙's avatar
纪泽龙 committed
1681
  transition: 0.2s linear;
纪泽龙's avatar
纪泽龙 committed
1682
  // background: #fff;
1683
  // background: #061d3380;
纪泽龙's avatar
纪泽龙 committed
1684
  background: rgba(6, 29, 51, 0.8);
纪泽龙's avatar
纪泽龙 committed
1685
  // background: red;
1686 1687
  opacity: 0;
  // 优化抽屉出来回去
纪泽龙's avatar
纪泽龙 committed
1688
  &.opacity {
1689 1690
    opacity: 1;
  }
纪泽龙's avatar
纪泽龙 committed
1691
  &.back {
1692
    left: -348px;
纪泽龙's avatar
纪泽龙 committed
1693
  }
纪泽龙's avatar
纪泽龙 committed
1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711
  .mapChange {
    right: -178px;
    top: 10px;
    color: #fff;
    position: absolute;
    display: flex;
    div {
      padding: 4px 8px;
      border: 1px solid #fff;
      margin-left: 8px;
      cursor: pointer;
      &.active,
      &:hover {
        background-color: #053b6a;
        color: #31eaea;
      }
    }
  }
1712 1713 1714
  .pipePressure {
    position: absolute;
    color: #fff;
1715
    right: -80px;
1716
    top: 50px;
1717
    padding: 1px;
1718
    // background: rgba(6, 29, 51, 0.8);
1719 1720 1721 1722 1723 1724 1725 1726 1727
    .hasColorBox {
      // border: 1px solid #053b6a;
      padding: 2px 5px;
      margin-bottom: 5px;
      & > div {
        display: inline-block;
        width: 10px;
        height: 10px;
      }
1728 1729
    }
  }
纪泽龙's avatar
纪泽龙 committed
1730 1731 1732 1733 1734 1735 1736 1737 1738
  .scroll {
    // height: 100%;
    position: relative;
    overflow-y: scroll;
    overflow-x: hidden;

    &::-webkit-scrollbar {
      display: none;
    }
1739 1740 1741 1742 1743
    .search-input {
      position: absolute;
      top: 14px;
      left: 39px;
      width: 236px;
纪泽龙's avatar
纪泽龙 committed
1744
      // background-color: red !important;
1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764
      .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
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
  // 左边的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;
纪泽龙's avatar
纪泽龙 committed
1794 1795
          // color: #053b6a;
          color: #fff;
1796 1797 1798 1799 1800
          font-weight: 600;
        }
      }
      .deviceList {
        cursor: pointer;
1801
        margin-bottom: 10px;
纪泽龙's avatar
纪泽龙 committed
1802
        box-sizing: border-box;
1803
        border-bottom: 1px solid #053b6a00;
1804
        color: #1d1d1d;
1805 1806
        &:hover {
          box-sizing: border-box;
纪泽龙's avatar
纪泽龙 committed
1807
          border-bottom: 1px solid #7fc0f8;
1808
          font-weight: 600;
纪泽龙's avatar
纪泽龙 committed
1809 1810 1811
          > div {
            color: #7fc0f8;
          }
1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827
        }
        &.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;
纪泽龙's avatar
纪泽龙 committed
1828
          color: #fff;
1829 1830 1831 1832
          // border-right: 1px solid #cccccc;
        }
      }
      .no {
纪泽龙's avatar
纪泽龙 committed
1833 1834
        width: 25px;
        font-weight: 700;
1835 1836 1837 1838 1839
      }
      .name {
        // border-right: none;
        flex: 1;
        text-align: center;
1840
        margin-left: 10px;
1841 1842
      }
      .code {
1843
        width: 100px;
1844
        text-align: center;
纪泽龙's avatar
纪泽龙 committed
1845
      }
1846 1847 1848 1849 1850 1851 1852 1853
      .textRed {
        .no,
        .name,
        .code {
          color: red;
        }
        &:hover {
          border-bottom: 1px solid red;
纪泽龙's avatar
纪泽龙 committed
1854 1855 1856 1857 1858
          .no,
          .name,
          .code {
            color: red !important;
          }
1859 1860
        }
      }
纪泽龙's avatar
纪泽龙 committed
1861
    }
1862 1863 1864 1865 1866
    .box {
      width: 348px;
      height: 48px;
      padding-left: 20px;
      display: flex;
纪泽龙's avatar
纪泽龙 committed
1867
      // background-color: #ffffff;
1868
      box-sizing: border-box;
纪泽龙's avatar
纪泽龙 committed
1869 1870
      // border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      border-bottom: 1px solid rgba(0, 0, 0, 0.5);
1871
      cursor: pointer;
1872 1873 1874
      position: relative;
      // box-sizing: border-box;
      &.firstbox {
1875 1876 1877
        // border-top: 1px solid rgba(0, 0, 0, 0.5);
        border-top: 1px solid rgba(5, 59, 106, 0);

1878 1879 1880 1881
        // box-sizing: border-box;
        &:hover {
          border-top: 1px solid rgba(5, 59, 106, 0);
        }
纪泽龙's avatar
纪泽龙 committed
1882
      }
1883
      &:hover {
纪泽龙's avatar
纪泽龙 committed
1884
        box-sizing: border-box;
纪泽龙's avatar
纪泽龙 committed
1885 1886
        // background-color: rgba(5, 59, 106, 0.1);
        background-color: #053b6a;
1887
        border-bottom: none !important;
纪泽龙's avatar
纪泽龙 committed
1888
        .upPic {
纪泽龙's avatar
纪泽龙 committed
1889
          color: #31eaea;
纪泽龙's avatar
纪泽龙 committed
1890 1891 1892
        }
        .left,
        .right {
纪泽龙's avatar
纪泽龙 committed
1893
          color: #31eaea !important;
纪泽龙's avatar
纪泽龙 committed
1894
        }
1895 1896 1897
      }
      .upPic {
        display: inline-block;
纪泽龙's avatar
纪泽龙 committed
1898
        margin-left: 40px;
1899 1900
        line-height: 48px;
        font-size: 16px;
纪泽龙's avatar
纪泽龙 committed
1901
        color: #fff;
1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924
      }
      > 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 {
纪泽龙's avatar
纪泽龙 committed
1925
        color: #fff !important;
1926 1927 1928 1929 1930 1931 1932
        position: absolute;
        right: 32px;
        top: 16px;
        transition: 0.3s linear;
        &.active {
          transform: rotate(90deg);
        }
纪泽龙's avatar
纪泽龙 committed
1933 1934
      }
      &.active {
1935
        // background-color: #053b6a;
纪泽龙's avatar
纪泽龙 committed
1936 1937 1938 1939
        // .left,
        // .right {
        //   color: #fff;
        // }
1940
        > i {
纪泽龙's avatar
纪泽龙 committed
1941 1942
          color: #31eaea;
          font-weight: 600;
1943
        }
纪泽龙's avatar
纪泽龙 committed
1944
      }
1945
      .left {
纪泽龙's avatar
纪泽龙 committed
1946
        color: #fff;
1947 1948 1949 1950 1951
        line-height: 48px;
        margin-left: 28px;
        .iconfont {
          font-size: 22px;
        }
纪泽龙's avatar
纪泽龙 committed
1952
      }
1953
      .right {
纪泽龙's avatar
纪泽龙 committed
1954
        color: #fff;
1955 1956 1957
        line-height: 48px;
        font-size: 16px;
        margin-left: 4px;
纪泽龙's avatar
纪泽龙 committed
1958 1959
      }
    }
1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
    .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%;
纪泽龙's avatar
纪泽龙 committed
1975
          background: none;
1976 1977 1978 1979 1980 1981 1982 1983
          // width: 14px;
          // height: 14px;
          padding: 2px;
        }
        .btn-w-num {
          display: inline-block;
          font-size: 14px;
          padding: 0px 5px;
纪泽龙's avatar
纪泽龙 committed
1984
          color: #fff;
1985 1986
        }
      }
纪泽龙's avatar
纪泽龙 committed
1987 1988
    }
  }
1989 1990 1991 1992
  // 开关
  .switch {
    position: absolute;
    font-size: 30px;
纪泽龙's avatar
纪泽龙 committed
1993
    right: -30px;
1994
    top: 50%;
纪泽龙's avatar
纪泽龙 committed
1995
    margin-top: -123px;
1996 1997 1998 1999 2000 2001
    width: 40px;
    border-radius: 40%;
    overflow: hidden;
    cursor: pointer;
    i {
      background: #fff;
纪泽龙's avatar
纪泽龙 committed
2002 2003 2004
    }
  }
}
耿迪迪's avatar
耿迪迪 committed
2005
</style>
耿迪迪's avatar
耿迪迪 committed
2006