index.vue 40.6 KB
Newer Older
葛齐林's avatar
葛齐林 committed
1 2 3 4 5 6 7
<template lang="pug">
  <div class="ol_point">
    <el-container style='padding-left:0px;'>
      <el-aside width='333px' style='height:825px;'>
          <el-card class = "tree-container">
            <div class="ol_point_left_top">
              <div class="ol_point_left_topL">
8
                <div>资源列表</div>
葛齐林's avatar
葛齐林 committed
9
              </div>
10 11 12
              //- <div style="float:right; margin:5px 5px 0 5px">
              //-   <el-button type="text" size="mini" icon='el-icon-shoucang' @click="treeDataOffClick()"></el-button>
              //- </div>
葛齐林's avatar
葛齐林 committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
              <div class="ol_point_left_topR">
                <el-input suffix-icon="el-icon-search" size="small" v-model="searchInput" clearable></el-input>
              </div>
            </div>
            <el-tree class="dic_tree" :data="treeData" ref='tree' :accordion='true' :highlight-current='true' :props="defaultProps" :filter-node-method="filterNode" :default-expand-all='false' @node-click="handleNodeClick" :default-expanded-keys='defaultExpandedKeys' :node-key='nodeKey' >
              <span class="custom-tree-node" style='width:100%;line-height: 18px;' slot-scope="{ node, data }">
                <span v-if="node.data.level == 3" class="el-icon-zhandian  xa-icon"></span>
                <span v-if="node.data.level == 4 && node.data.iconB" class="el-icon-wq-treeIcon1  xa-icon"></span>
                <span v-if="node.data.level == 4 && !node.data.iconB" class="el-icon-wq-treeIcon  xa-icon"></span>
                <span v-if="node.data.level == 5 && node.data.name == '视频监控'" class="el-icon-shipin  xa-icon"></span>
                <span v-if="node.data.level == 5 && node.data.name == '出入口控制'" class="el-icon-churukoukongzhi  xa-icon"></span>
                <span v-if="node.data.level == 5 && node.data.name == '入侵报警'" class="el-icon-ruqinbaojing  xa-icon"></span>
                <span v-if="node.data.level == 5 && node.data.name == '安全检查'" class="el-icon-anquanjiancha  xa-icon"></span>
                <span v-if="node.data.level == 6 && node.data.isDefence" class="el-icon-fangqukuang7  xa-icon"></span>
                <span v-if="node.data.level == 6 && !node.data.isDefence" :class="node.data.icon+'7'" class='xa-icon'></span>
                <span v-if="node.data.level == 7 " :class="node.data.icon+'7'" class='xa-icon'></span>
                <span style="position: relative;" v-if="node.label.indexOf('在线') == -1 && node.label.indexOf('离线') == -1">&nbsp;{{node.label}}<span style="width:25px; height:16px; position: absolute;left: -46px;top: -3px;"></span></span>
                <span style="position: relative;" v-if="node.label.indexOf('在线') > -1">&nbsp;{{node.label.substring(0,node.label.length - 4)}}<span style='color:green;'>[在线]</span><span style="width:25px; height:16px; position: absolute;left: -46px;top: -3px;"></span></span>
                <span style="position: relative;" v-if="node.label.indexOf('离线') > -1">&nbsp;{{node.label.substring(0,node.label.length - 4)}}<span style='color:red;'>[离线]</span><span style="width:25px; height:16px; position: absolute;left: -46px;top: -3px;"></span></span>
                <span style="float:right;">
                  <el-button style="padding:0;" v-if="activeName == 2 && node.data.level == 6" type='text' icon="el-icon-delete" @click="treeDataDeleteClick(node,data)" ></el-button>
                </span>
                span(v-if=" node.data.iconB" class='el-icon-my-treeFlag')
              </span>
            </el-tree>
            <!-- <span class="el-icon-shousuo"></span> -->
          </el-card>
      </el-aside>

      <el-main style="padding:0px;height:825px;">
        <el-card>
          <div class="ol_point_right_button">
            <el-row :span="24" style='padding-top:5px;'>
                <el-col :md='14' :sm="5" class='tier-btn'>
                    <el-button type="primary" size="small" plain :class="[checkedData.tierId===item.id?'active-tier':'']" style="float:left;margin-left:10px;" v-for="item in mapList" :key='item.id' @click="changeMap(item)">{{item.name}}</el-button>
                </el-col>
                <el-col :md='10' :sm="5">
                  <div style="float:right;">
                    <div :class="item.value" style="margin:5px 5px 0 0;" :title="item.name" v-for="item in iconNameListBottom" @click="iconClick(item)"></div>
                  </div>
                </el-col>
            </el-row>
          </div>
56 57 58 59
            //-   <div class="ol_point_right_button_r">
            //-       <div :class="[transformationSta == 1?'on':'']" @click="transformation(1)">2D</div>
            //-       <div :class="[transformationSta == 2?'on':'']" @click="transformation(2)">3D</div>
            //-   </div>
葛齐林's avatar
葛齐林 committed
60 61 62 63 64 65 66
          <div v-show="transformationSta==1">
            <el-row style="padding-bottom:15px;height:780px;background:#fff;" :span="24">
              <el-col class="resource-container" :style="obj" ref="drag">
                <div id="map" class="map" ref='map'  style="width: 100%;height: 720px;position:relative;"></div>
              </el-col>
            </el-row>
          </div>
co_dengxiongwen's avatar
co_dengxiongwen committed
67
          <div class="map_right">
葛齐林's avatar
葛齐林 committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
            <div>
              <iframe :src="src" ref="iframe"></iframe>
            </div>
          </div>
        </el-card>
      </el-main>
      <query-detail v-if='queryDetailVisible' ref='queryDetail' @closeQ="closeQueryDetailVisible"></query-detail>
      <no-query-detail v-if='noQueryDetailVisible' ref='noQueryDetail' @closeQ="closeNoQueryDetailVisible"></no-query-detail>
    </el-container>
  </div>

</template>

<script>
import QueryDetail from './query-detail'
import NoQueryDetail from './no-query-detail'
import { getUUID } from '@/util'
import Vue from 'vue'

import 'ol/ol.css'
import { Map, View, layer, Markers } from 'ol'
import { Projection, Transform } from 'ol/proj'
import { getCenter } from 'ol/extent'
import overviewmap from 'ol/control/OverviewMap'
import ImageLayer from 'ol/layer/Image'
import ImageStatic from 'ol/source/ImageStatic'
import { control } from 'ol/control/Control'
import Zoom from 'ol/control/Zoom'
import { DoubleClickZoom, Select } from 'ol/interaction'
// 图上图标相关
import OlFeature from 'ol/Feature'
import OlGeomPoint from 'ol/geom/Point'
import OlLayerVector from 'ol/layer/Vector'
import OlSourceVector from 'ol/source/Vector'
import OlStyleStyle from 'ol/style/Style'
import OlStyleIcon from 'ol/style/Icon'
import LineString from 'ol/geom/LineString'
import Polygon from 'ol/geom/Polygon'

// 用来添加相关文字描述的
import { Text, Fill, Stroke, Circle, Style } from 'ol/style'

co_dengxiongwen's avatar
co_dengxiongwen committed
110 111
import { mapState, mapGetters, mapActions } from 'vuex'

葛齐林's avatar
葛齐林 committed
112 113 114 115 116 117 118 119 120 121
let that
export default {
  name: 'sys-user',
  filters: {
    ellipsis(value) {
      if (!value) return ''
      if (value.length > 20) {
        return value.slice(0, 20) + '...'
      }
      return value
122
    }
葛齐林's avatar
葛齐林 committed
123 124 125 126 127 128 129 130
  },
  data() {
    return {
      imgLayerList: [],
      controlList: [],
      imgurl: '',
      transformationSta: 1,
      isCollapse: true,
co_dengxiongwen's avatar
co_dengxiongwen committed
131
      urlPath: window.CONFIG.urlPath,
葛齐林's avatar
葛齐林 committed
132 133 134 135 136 137 138 139 140 141 142 143
      dataListLoading: false,
      dataListSelections: [],
      addOrUpdateVisible: false,
      queryDetailVisible: false,
      noQueryDetailVisible: false,
      treeData: [],
      listArr: [],
      defaultExpandedKeys: [],
      iconNameListBottom: [],
      defaultProps: {
        children: 'children',
        label: 'name',
144
        level1: 'level'
葛齐林's avatar
葛齐林 committed
145 146 147 148 149 150 151 152 153 154 155 156
      },
      nodeKey: 'id',
      station: {}, //当前选择的站点
      mapList: [], //当前站点的所有层
      stationMap: {}, //当前选择的层
      clickItem: {},
      checkedData: {
        stationId: '',
        stationName: '',
        tierId: '',
        tierName: '',
        resourceId: '',
157
        sId: localStorage.getItem('stationId')
葛齐林's avatar
葛齐林 committed
158 159 160 161 162 163 164 165 166 167 168 169 170
      },
      currentNode: {},
      dragAble: false,
      list: [],
      obj: 'pointer-events:initial',
      editable: false,
      activeName: '1',
      searchInput: '',
      regionMouse: {
        x: 0,
        y: 0,
        w: 0,
        h: 0,
171
        status: false
葛齐林's avatar
葛齐林 committed
172 173 174
      },
      vectorLayer: [],
      lineVectorLayer: [],
co_dengxiongwen's avatar
co_dengxiongwen committed
175
      resolutions: [],
176
      code: ''
葛齐林's avatar
葛齐林 committed
177 178 179 180
    }
  },
  components: {
    QueryDetail,
181
    NoQueryDetail
葛齐林's avatar
葛齐林 committed
182 183 184 185
  },
  watch: {
    searchInput(val) {
      this.$refs.tree.filter(val)
186
    }
葛齐林's avatar
葛齐林 committed
187 188 189 190 191 192 193 194 195 196 197
  },
  created() {
    that = this
    this.initTreeStationMap()
    this.initResourceTypeDicList()
  },
  methods: {
    // 初始化地图
    initMap(url) {
      this.resolutions = []
      let mapList = this.mapList
198 199 200 201
      //   let mapsrcList = []
      //   if (mapList != null && mapList.length > 0) {
      //     mapsrcList = mapList.map((e) => e.readPath)
      //   }
葛齐林's avatar
葛齐林 committed
202 203 204 205 206 207 208 209
      this.imgurl = url
      // 计算静态地图映射到地图上的范围
      let extent = [-1100, 110, 1460, 820]

      let projection = new Projection({
        // 投影
        code: 'xkcd-image',
        units: 'pixels',
210
        extent: extent
葛齐林's avatar
葛齐林 committed
211 212 213 214 215 216 217 218
      })
      if (mapList.length > 0) {
        for (var i = 0; i < mapList.length; i++) {
          let layerItem = new ImageLayer({
            id: mapList[i].id,
            source: new ImageStatic({
              url: mapList[i].readPath, //这里添加静态图片的地址
              projection: projection,
219
              imageExtent: extent
葛齐林's avatar
葛齐林 committed
220
            }),
221
            visible: false
葛齐林's avatar
葛齐林 committed
222 223 224 225 226 227 228 229 230 231 232
          })
          this.imgLayerList.push(layerItem)

          let controlItem = new overviewmap({
            className: 'ol-overviewmap myOverview', //鹰眼控件样式
            // 在鹰眼中加载相同坐标系下不同数据源的图层
            layers: [
              new ImageLayer({
                source: new ImageStatic({
                  url: mapList[i].readPath, //这里添加静态图片的地址
                  projection: projection,
233 234 235
                  imageExtent: extent
                })
              })
葛齐林's avatar
葛齐林 committed
236 237 238
            ],
            collapseLabel: '\u00BB', //鹰眼控件展开时功能按钮上的标识
            label: '\u00AB', //鹰眼控件折叠时功能按钮上的标识
239
            collapsed: false //初始为展开方式
葛齐林's avatar
葛齐林 committed
240 241 242 243 244 245 246 247 248 249 250
          })
          this.controlList.push(controlItem)

          let resolutionItem = 1
          this.resolutions.push(resolutionItem)
        }
      }

      let zoomControl = new Zoom({
        delta: 0.2,
        zoomInTipLabel: '',
251
        zoomOutTipLabel: ''
葛齐林's avatar
葛齐林 committed
252 253 254 255 256 257 258 259 260 261 262 263 264
      })
      // 大图
      this.map = new Map({
        target: 'map',
        layers: this.imgLayerList,
        controls: [zoomControl],
        resolutions: this.resolutions,
        view: new View({
          projection: projection,
          center: getCenter([0, 0, 0, 0]), // 获取范围的中心坐标。
          zoom: 2.5,
          maxZoom: 5.0,
          minZoom: 1.5,
265 266
          extent: [-1100, -100, 2000, 1000] //[minX, minY, maxX, maxY] 控制拖动
        })
葛齐林's avatar
葛齐林 committed
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
      })
      // 删除默认的双击事件
      const dblClickInteraction = this.map
        .getInteractions()
        .getArray()
        .find((interaction) => {
          return interaction instanceof DoubleClickZoom
        })
      this.map.removeInteraction(dblClickInteraction)
      //将鹰眼控件加载到map中
      this.map.addControl(this.controlList[0])

      //点击事件
      this.changeVectorLayer(this.list)

co_dengxiongwen's avatar
co_dengxiongwen committed
282 283 284 285 286 287 288
      this.map.on('click', function (evt) {
        let feature = evt.map.forEachFeatureAtPixel(
          evt.pixel,
          function (feature) {
            return feature
          }
        )
葛齐林's avatar
葛齐林 committed
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
        if (feature) {
          for (let i in that.list) {
            let style = that.getPointStyle(
              that.list[i].imageSrc + '.png',
              that.list[i].name
            )
            let style2 = that.getPointStyle(
              that.list[i].imageSrc + '2.png',
              that.list[i].name,
              0.3
            )
            //获取feature对象
            let feature_ = that.vectorLayer
              .getSource()
              .getFeatureById(that.list[i].id)
            //获取红外对射或者振动光纤第二个点的feature对象
            let featureEnd = that.vectorLayer
              .getSource()
              .getFeatureById(that.list[i].key + 'end')
            if (feature_) {
              if (feature_ === feature || featureEnd === feature) {
                //修改选中样式
                feature_.setStyle(style2)
                if (featureEnd) {
                  featureEnd.setStyle(style2)
                }
                that.pointListClick(that.list[i])
              } else {
                //清除选中以外的样式
                feature_.setStyle(style)
                if (featureEnd) {
                  featureEnd.setStyle(style)
                }
              }
            }
          }
        }
      })
    },
    mapClick(feature, item, flag) {
      //默认样式
      let style = this.getPointStyle(item.imageSrc + '.png', item.name)
      //选中样式
      let style2 = this.getPointStyle(item.imageSrc + '2.png', item.name, 0.3)
      //获取feature对象
      let feature_ = this.vectorLayer.getSource().getFeatureById(item.id)
      //获取红外对射或者振动光纤第二个点的feature对象
      let featureEnd = this.vectorLayer
        .getSource()
        .getFeatureById(item.key + 'end')
      if (feature_) {
        if (feature_ === feature || featureEnd === feature) {
          //console.log(feature_)
          //修改选中样式
          feature_.setStyle(style2)
          if (featureEnd) {
            featureEnd.setStyle(style2)
          }
        } else {
          //清除选中以外的样式
          feature_.setStyle(style)
          if (featureEnd) {
            featureEnd.setStyle(style)
          }
        }
      } else {
        //获取新增的feature对象
        let newFeature = this.vectorLayer.getSource().getFeatureById(item.key)
        //获取红外对射或者振动光纤第二个点的feature对象
        let newFeatureEnd = this.vectorLayer
          .getSource()
          .getFeatureById(item.key + 'end')
        if (newFeature) {
          if (newFeature === feature || newFeatureEnd === feature) {
            newFeature.setStyle(style2)
            if (newFeatureEnd) {
              newFeatureEnd.setStyle(style2)
            }
          } else {
            //清除选中以外的样式
            newFeature.setStyle(style)
            if (newFeatureEnd) {
              newFeatureEnd.setStyle(style)
            }
          }
        }
      }
    },
    getPointStyle(src, name, zoom) {
      let style = new OlStyleStyle({
        image: new OlStyleIcon({
          anchor: [0.5, 0.5],
          scale: zoom || 0.4,
          //rotation:0 旋转度
383
          src: require('@/assets/images/' + src)
葛齐林's avatar
葛齐林 committed
384 385 386 387 388 389
        }),
        text: new Text({
          text: name, // 添加文字描述
          font: '14px font-size', // 设置字体大小
          fill: new Fill({
            // 设置字体颜色
390
            color: 'black'
葛齐林's avatar
葛齐林 committed
391
          }),
392 393
          offsetY: 30 // 设置文字偏移量
        })
葛齐林's avatar
葛齐林 committed
394 395 396
      })
      return style
    },
co_dengxiongwen's avatar
co_dengxiongwen committed
397 398 399 400 401 402 403 404 405
    clearLayer() {
      if (this.map) {
        this.map.removeLayer(this.vectorLayer)
        this.map.removeLayer(this.lineVectorLayer)
        this.map.removeInteraction(this.modify)
        return false
      } else {
        return true
      }
葛齐林's avatar
葛齐林 committed
406 407 408 409 410
    },
    changeVectorLayer(list) {
      if (list) {
        this.list = list
      } else {
co_dengxiongwen's avatar
co_dengxiongwen committed
411
        this.clearLayer()
葛齐林's avatar
葛齐林 committed
412 413 414 415
      }
      if (this.clearLayer()) return
      this.lineVectorLayer = new OlLayerVector({
        source: new OlSourceVector({
416
          features: []
葛齐林's avatar
葛齐林 committed
417 418 419 420
        }),
        style: new OlStyleStyle({
          stroke: new Stroke({
            color: '#409EFF',
421 422 423
            width: 3
          })
        })
葛齐林's avatar
葛齐林 committed
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
      })
      this.map.addLayer(this.lineVectorLayer)

      let lineLastArr = []
      let featuresArr = []
      for (let i in list) {
        if (list[i].imageSrc) {
          //振动光纤和红外线对射
          if (
            list[i].type === 'e670524ecb9e4a03b8ddbc7d91a63b1b' ||
            list[i].type === '4f69755dbc0c45e49c142857286c5669'
          ) {
            let lineFeatures = []
            lineFeatures.push([list[i].xlongit, list[i].ylat])
            lineFeatures.push([list[i].xpoint, list[i].ypoint])
            this.lineVectorLayer
              .getSource()
              .addFeature(new OlFeature(new LineString(lineFeatures)))
            lineLastArr.push(list[i])
          }
          featuresArr.push(this.getFeature(list[i].xlongit, list[i].ylat))
          let style = this.getPointStyle(
            list[i].imageSrc + '.png',
            this.list[i].name
          )
          featuresArr[i].setStyle(style)
          featuresArr[i].setId(list[i].id)
        } else {
          continue
        }
      }

      let LinefeaturesArr = []
      for (let i in lineLastArr) {
        LinefeaturesArr.push(
          this.getFeature(lineLastArr[i].xpoint, lineLastArr[i].ypoint)
        )
        let style = this.getPointStyle(
          lineLastArr[i].imageSrc + '.png',
          lineLastArr[i].name
        )
        LinefeaturesArr[i].setStyle(style)
        LinefeaturesArr[i].setId(lineLastArr[i].key + 'end')
        this.list.push(lineLastArr[i])
      }

      this.vectorLayer = new OlLayerVector({
        source: new OlSourceVector({
472 473
          features: featuresArr.concat(LinefeaturesArr)
        })
葛齐林's avatar
葛齐林 committed
474 475 476 477 478 479
      })
      this.map.addLayer(this.vectorLayer)
    },
    getFeature(x, y) {
      return new OlFeature({
        type: 'icon',
480
        geometry: new OlGeomPoint([x, y])
葛齐林's avatar
葛齐林 committed
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
      })
    },
    // 树节点过滤
    filterNode(value, data) {
      if (!value) return true
      return data.name.indexOf(value) !== -1
    },
    handleClick(tab) {
      //左侧tab切换
      if (tab) {
        this.activeName = tab
      }
      if (this.activeName == 1) {
        this.initTreeStationMap()
      } else {
        this.initTreeStationMap(true)
      }
    },
    treeDataDeleteClick(node, data) {
      this.$confirm('确认取消该收藏?', '取消收藏', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
504
        closeOnClickModal: false
co_dengxiongwen's avatar
co_dengxiongwen committed
505
      }).then(() => {
葛齐林's avatar
葛齐林 committed
506 507 508 509 510 511 512 513 514 515 516 517 518
        //左侧tree取消收藏按钮
        // console.log(node)
        // console.log(node.parent.childNodes.length, '节点长度')
        // console.log(data)
        let len = node.parent.childNodes.length
        let pid = data.pid
        let tid = data.tierId

        this.$http({
          url: this.$http.adornUrlEq('/liEnshrine/delete'),
          method: 'post',
          data: {
            resourceId: node.data.id,
519 520
            stationId: this.checkedData.sId
          }
葛齐林's avatar
葛齐林 committed
521 522
        }).then((data) => {
          if (data && data.code === 0) {
co_dengxiongwen's avatar
co_dengxiongwen committed
523
            this.$message.success('取消收藏成功1111')
葛齐林's avatar
葛齐林 committed
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548
            // this.defaultExpandedKeys = [this.treeData[0].id]
            this.initTreeStationMap(true)
            if (len > 1) {
              this.defaultExpandedKeys = [pid]
            } else {
              this.defaultExpandedKeys = [tid]
            }
          }
        })
      })
    },
    treeDataOffClick() {
      //左侧tree收藏按钮
      let node = this.$refs.tree.getCurrentNode()
      // console.log(node)
      if (node.level !== 6) {
        this.$message.warning('只能收藏资源点或防区')
        return
      }
      let dForm = {}
      if (node.isDefence && node.level == 6) {
        //如果是防区
        dForm = {
          resourceId: node.id,
          byx1: '1',
549
          stationId: this.checkedData.sId
葛齐林's avatar
葛齐林 committed
550 551 552 553
        }
      } else {
        dForm = {
          resourceId: node.id,
554
          stationId: this.checkedData.sId
葛齐林's avatar
葛齐林 committed
555 556 557 558 559
        }
      }
      this.$http({
        url: this.$http.adornUrlEq('/liEnshrine/save'),
        method: 'post',
560
        data: dForm
葛齐林's avatar
葛齐林 committed
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629
      }).then((data) => {
        if (data && data.code === 0) {
          if (data.msg === '收藏成功') {
            this.$message.success(data.msg)
          } else {
            this.$message.warning(data.msg)
          }
        }
      })
    },
    pointListClick(item) {
      //监视器列表点击
      //关闭其他窗口
      // this.closeNoQueryDetailVisible()
      if (this.transformationSta === 1) {
        if (
          item.type === 'b6af764f2a6e454490a6b1b3c9057e57' ||
          item.type === 'ece0b8b2db27411886254e81134988a3'
        ) {
          // console.log('1')
          this.queryDetail(item.id)
        } else {
          // console.log('2')
          this.noQueryDetail(item.id)
        }
        // console.log('subCode', item.subCode, typeof (item.subCode))
        // switch (item.subCode) {
        //   case '01' :
        //     //视频监控
        //     this.queryDetail01Visible = true
        //     this.$nextTick(() => {
        //       this.$refs.queryDetail01.init(item.id, this.checkedData.sId)
        //     })
        //     break
        //   case '02' :
        //     //出入口控制
        //     this.queryDetail02Visible = true
        //     this.$nextTick(() => {
        //       this.$refs.queryDetail02.init(item.id, this.checkedData.sId)
        //     })
        //     break
        //   case '03' :
        //     //入侵报警
        //     this.queryDetail03Visible = true
        //     this.$nextTick(() => {
        //       this.$refs.queryDetail03.init(item.id, this.checkedData.sId)
        //     })
        //     break
        //   case '04' :
        //     //安全检查
        //     this.queryDetail04Visible = true
        //     this.$nextTick(() => {
        //       this.$refs.queryDetail04.init(item.id, this.checkedData.sId)
        //     })
        //     break
        //   case '05' :
        //     //电子巡更
        //     this.queryDetail05Visible = true
        //     this.$nextTick(() => {
        //       this.$refs.queryDetail05.init(item.id, this.checkedData.sId)
        //     })
        //     break
        // }
      }
      this.activeChooseResourceBox(item.id)
      this.defaultExpandedKeys = [item.id]
      // this.$refs.tree.setCurrentKey(item.id)
    },
    //初始化站点下的资源点
630
    initTreeStationMap() {
葛齐林's avatar
葛齐林 committed
631
      this.$http({
632
        url: this.$http.adornUrl('/liResource/getTreeList'),
葛齐林's avatar
葛齐林 committed
633 634 635
        method: 'post',
        data: {
          stationId: this.checkedData.sId,
636 637
          name: this.searchInput
        }
葛齐林's avatar
葛齐林 committed
638 639 640
      })
        .then((data) => {
          if (data && data.code === 0) {
641 642
            this.treeData = data.tree
            console.log('data:', this.treeData)
co_dengxiongwen's avatar
co_dengxiongwen committed
643
            if (this.treeData && this.treeData.length > 0) {
葛齐林's avatar
葛齐林 committed
644 645 646 647 648 649
              Vue.set(this.treeData[0], 'iconB', true)
            }
            return data
          }
        })
        .then((data) => {
co_dengxiongwen's avatar
co_dengxiongwen committed
650 651 652 653 654
          if (
            this.checkedData.sId &&
            this.treeData &&
            this.treeData.length > 0
          ) {
xiexingan's avatar
xiexingan committed
655
            // this.defaultExpandedKeys = [data.nodes[0].id]
葛齐林's avatar
葛齐林 committed
656 657 658 659 660 661 662 663
          }
          this.initStation(this.checkedData.sId)
        })
    },
    initResourceTypeDicList() {
      this.$http({
        url: this.$http.adornUrl('/sysDictionary/getResourceTypeDicList'),
        method: 'get',
664
        params: { stationId: this.checkedData.sId }
葛齐林's avatar
葛齐林 committed
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714
      }).then((data) => {
        if (data && data.code === 0) {
          this.iconNameListBottom = JSON.parse(JSON.stringify(data.list))
          this.iconNameListBottom.forEach((res) => {
            res.value += '3'
          })
        }
      })
    },
    iconClick(item) {
      this.iconNameListBottom.forEach((res) => {
        if (res.id === item.id) {
          if (
            res.value.substring(res.value.length - 1, res.value.length) != 4
          ) {
            res.value = res.value.substring(0, res.value.length - 1) + '4'
          }
        } else {
          if (
            res.value.substring(res.value.length - 1, res.value.length) == 4
          ) {
            res.value = res.value.substring(0, res.value.length - 1) + '3'
          }
        }
      })

      if (
        this.currentNode.level == 5 ||
        (this.currentNode.level == 6 && this.currentNode.isDefence)
      ) {
        this.list = []
        this.currentNode.children.forEach((el) => {
          if (item === null || (item != null && item.id === el.type)) {
            this.list.push(el)
          }
        })

        this.list.forEach((res) => {
          Vue.set(res, 'active', false)
        })
      } else {
        this.showResourceByMapId(item)
      }
      this.clickItem = item
      this.changeVectorLayer(this.list)
    },
    initStation(id) {
      this.$http({
        url: this.$http.adornUrl(`/liStation/getId/${id}`),
        method: 'get',
715
        params: this.$http.adornParams()
葛齐林's avatar
葛齐林 committed
716 717 718 719 720
      })
        .then((data) => {
          if (data && data.code === 0) {
            this.station = data.bean
            this.mapList = data.bean.mapList
co_dengxiongwen's avatar
co_dengxiongwen committed
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740
            if (this.mapList && this.treeData) {
              this.mapList.forEach((element) => {
                element.readPath = this.urlPath + element.filePath
              })
              this.checkedData.stationId = this.station.id
              this.checkedData.stationName = this.station.stationName
              this.checkedData.tierId = !this.mapList[0]
                ? ''
                : this.mapList[0].id
              if (!this.checkedData.tierId) {
                return
              }
              this.isFlag(this.treeData, this.checkedData.tierId)
              if (this.treeData[0]) {
                this.$refs.tree.setCurrentNode(this.treeData[0].children[0])
                this.defaultExpandedKeys = [this.checkedData.tierId]
                this.checkedData.tierName = this.mapList[0].name
                this.stationMap = this.mapList[0]
              }
            }
葛齐林's avatar
葛齐林 committed
741 742 743
          }
        })
        .then(() => {
co_dengxiongwen's avatar
co_dengxiongwen committed
744 745 746 747
          if (!this.checkedData.tierId) {
            return
          }
          this.showResourceByMapId(null)
葛齐林's avatar
葛齐林 committed
748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769
          if (!this.map) {
            this.initMap()
            this.imgLayerList[0].setVisible(true) //初始第一个显示
          } else {
            this.changeVectorLayer(this.list)
          }
        })
    },
    isFlag(data, id) {
      data.forEach((res) => {
        if (res.id === id) {
          Vue.set(res, 'iconB', true)
        } else {
          Vue.set(res, 'iconB', false)
        }
        if (res.children) {
          this.isFlag(res.children, id)
        }
      })
    },
    // 改变层级和鹰眼图
    changeImgControl(id) {
770
      //   console.log('mapid', id)
葛齐林's avatar
葛齐林 committed
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785
      let srcIndex = this.imgLayerList.findIndex((e) => {
        return e.values_.id == id
      })
      this.map.removeControl(this.controlList[srcIndex])
      this.map.addControl(this.controlList[srcIndex])
      for (var k = 0; k < this.imgLayerList.length; k++) {
        if (this.imgLayerList[k].values_.id == id) {
          this.imgLayerList[k].setVisible(true)
        } else {
          this.imgLayerList[k].setVisible(false)
        }
      }
    },
    addBox(obj) {
      this.boxVectorLayer = new OlLayerVector({
co_dengxiongwen's avatar
co_dengxiongwen committed
786
        source: new OlSourceVector({
787
          features: []
co_dengxiongwen's avatar
co_dengxiongwen committed
788 789 790 791
        }),
        style: new OlStyleStyle({
          stroke: new Stroke({
            color: '#409EFF',
792
            width: 2
co_dengxiongwen's avatar
co_dengxiongwen committed
793 794
          }),
          fill: new Fill({
795 796 797
            color: 'rgba(0, 0, 255, 0.1)'
          })
        })
葛齐林's avatar
葛齐林 committed
798 799 800 801 802 803
      })
      this.map.addLayer(this.boxVectorLayer)
      //创建矩形对象
      let start = [obj.xpoint, obj.ypoint]
      let end = [obj.xlongit, obj.ylat]
      let boxFeature = new OlFeature({
co_dengxiongwen's avatar
co_dengxiongwen committed
804
        geometry: new Polygon([
805 806
          [start, [start[0], end[1]], end, [end[0], start[1]], start]
        ])
葛齐林's avatar
葛齐林 committed
807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823
      })
      boxFeature.setId(obj.id + 'box')
      this.boxVectorLayer.getSource().addFeature(boxFeature)
    },
    //线路资源点树节点点击事件
    handleNodeClick(node) {
      // console.log(node)
      this.currentNode = node
      let name = node.name
      let id = node.id
      this.isFlag(this.treeData, id)
      if (node.level !== 7) {
        this.regionMouse = {
          x: 0,
          y: 0,
          w: 0,
          h: 0,
824
          status: false
葛齐林's avatar
葛齐林 committed
825 826 827
        }
      }
      //每次选择节点都先清空资源位
co_dengxiongwen's avatar
co_dengxiongwen committed
828
      console.log('选中节点的层级', node)
葛齐林's avatar
葛齐林 committed
829 830 831 832 833 834 835 836 837 838 839 840 841
      if (node.level === 4) {
        this.map.removeLayer(this.boxVectorLayer)
        //层级
        this.checkedData.tierId = id
        this.checkedData.tierName = name
        this.checkedData.stationId = node.stationId
        this.stationMap = node
        // console.log('选中节点的层级id', this.tierId)
        this.showResourceByMapId(null)
        this.changeImgControl(id)
        this.changeVectorLayer(this.list)
      } else if (node.level === 5) {
        this.map.removeLayer(this.boxVectorLayer)
842
        //资源点类型
葛齐林's avatar
葛齐林 committed
843 844 845
        this.list = []
        if (node.children) {
          node.children.forEach((res) => {
846
            this.list.push(res)
葛齐林's avatar
葛齐林 committed
847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
          })
        }

        this.checkedData.tierId = node.tierId
        this.mapList.forEach((res) => {
          if (res.id === node.tierId) {
            this.stationMap = res
          }
        })

        this.list.forEach((res) => {
          Vue.set(res, 'active', false)
        })
        this.changeImgControl(node.tierId)
        this.changeVectorLayer(this.list)
862
      } else if (node.level === 6) {
葛齐林's avatar
葛齐林 committed
863 864
        this.map.removeLayer(this.boxVectorLayer)
        //资源点
865
        let subNode = this.$refs.tree.getNode(node.tierId + node.type).data
葛齐林's avatar
葛齐林 committed
866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904
        // console.log('当前要选中的层级节点', subNode)
        this.list = []
        subNode.children.forEach((res) => {
          this.list.push(res)
        })
        this.list.forEach((res) => {
          Vue.set(res, 'active', false)
        })
        this.changeVectorLayer(this.list)

        // 点亮对应的marker
        let feature = this.vectorLayer.getSource().getFeatureById(id)
        if (feature) {
          for (let i in this.list) {
            if (feature.id_ == that.list[i].id) {
              this.listItem = that.list[i]
            }
            //flag为ture打开详情或者编辑页面
            this.mapClick(feature, that.list[i], false)
          }
        }
        this.checkedData.resourceId = id
        this.checkedData.tierId = node.tierId

        this.activeChooseResourceBox(id)
        this.pointListClick(node)
        this.changeImgControl(node.tierId)
      }

      this.iconNameListBottom.forEach((res) => {
        if (res.id === this.clickItem.id) {
          if (
            res.value.substring(res.value.length - 1, res.value.length) == 4
          ) {
            res.value = res.value.substring(0, res.value.length - 1) + '3'
          }
        }
      })
    },
co_dengxiongwen's avatar
co_dengxiongwen committed
905 906 907 908 909 910 911 912 913 914 915
    setStyle(item) {
      //选中样式
      let style2 = this.getPointStyle(item.imageSrc + '2.png', item.name, 0.3)
      let feature_ = this.vectorLayer.getSource().getFeatureById(item.id)
      feature_.setStyle(style2)
      let featureEnd = this.vectorLayer
        .getSource()
        .getFeatureById(item.key + 'end')
      if (featureEnd) {
        featureEnd.setStyle(style2)
      }
葛齐林's avatar
葛齐林 committed
916 917 918 919 920 921 922 923 924 925 926 927 928
    },
    //激活选中资源点位节点
    activeChooseResourceBox(id, level) {
      this.list.forEach((res) => {
        if (res.id === id) {
          Vue.set(res, 'active', true)
        } else {
          Vue.set(res, 'active', false)
        }
      })
    },
    //切换层级
    changeMap(map) {
co_dengxiongwen's avatar
co_dengxiongwen committed
929 930
      this.map.removeLayer(this.boxVectorLayer)

葛齐林's avatar
葛齐林 committed
931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969
      // 切换openlayer
      // console.log(this.map)
      //图层缩放级别设置为默认
      this.map.getView().setZoom(1)
      // console.log(this.imgLayerList)
      this.changeImgControl(map.id)
      this.currentNode = this.$refs.tree.getNode(map.id).data
      // console.log('当前要选中的节点', this.currentNode)
      //将选中的层级树节点设置为选中

      this.$refs.tree.setCurrentNode(this.currentNode)
      // this.defaultExpandedKeys = [this.currentNode.id]
      this.defaultExpandedKeys = [map.id]
      this.isFlag(this.treeData, this.currentNode.id)
      // console.log('当前要选中的节点2', this.currentNode)
      this.checkedData.tierId = map.id
      this.checkedData.tierName = map.name
      this.stationMap = map

      this.iconNameListBottom.forEach((res) => {
        if (res.id === this.clickItem.id) {
          if (
            res.value.substring(res.value.length - 1, res.value.length) == 4
          ) {
            res.value = res.value.substring(0, res.value.length - 1) + '3'
          }
        }
      })
      this.showResourceByMapId(null)
      this.changeVectorLayer(this.list)
    },
    //根据层级id展示当前层级所有的资源点
    showResourceByMapId(item) {
      let tierNode = this.$refs.tree.getNode(this.checkedData.tierId).data
      // console.log('当前要选中的层级节点', tierNode.children)
      this.list = []
      //this.list = tierNode.children[0].children || []

      if (tierNode && tierNode.children) {
970 971 972 973
        tierNode.children.forEach((type) => {
          type.children.forEach((res) => {
            if (item === null || (item != null && item.id === res.type)) {
              this.list.push(res)
葛齐林's avatar
葛齐林 committed
974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005
            }
          })
        })
      }
      this.list.forEach((res) => {
        Vue.set(res, 'active', false)
      })
    },
    //详情
    queryDetail(id) {
      this.queryDetailVisible = true
      this.noQueryDetailVisible = false
      this.$nextTick(() => {
        this.$refs.queryDetail.init(id, this.checkedData.sId)
      })
    },
    noQueryDetail(id) {
      this.noQueryDetailVisible = true
      this.queryDetailVisible = false
      this.$nextTick(() => {
        this.$refs.noQueryDetail.init(id, this.checkedData.sId)
      })
    },
    closeQueryDetailVisible() {
      this.queryDetailVisible = false
    },
    closeNoQueryDetailVisible() {
      this.noQueryDetailVisible = false
    },
    transformation(now) {
      //2D3D转换
      this.transformationSta = now
co_dengxiongwen's avatar
co_dengxiongwen committed
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024
      // console.log('当前节点', this.currentNode)
      // console.log(this.mapList)

      if (now == 1) {
        if (this.currentNode.level == 6) {
          this.$nextTick(() => {
            // console.log(22222222222)
            this.changeImgControl(this.currentNode.tierId)
          })
        } else if (
          this.currentNode.level == 5 ||
          this.currentNode.level == 6 ||
          this.currentNode.level == 7
        ) {
          this.$nextTick(() => {
            // console.log(3333333333333)
            this.changeImgControl(this.currentNode.tierId)
          })
        }
葛齐林's avatar
葛齐林 committed
1025
      }
1026 1027
    }
  }
葛齐林's avatar
葛齐林 committed
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062
}
</script>
<style lang="scss" scoped>
.dic_tree {
  background: #f4f4f4;
  font-size: 14px;
  transform: translateX(-6px);
  // margin-top: 20px;
}
.dic_tree /deep/ .el-tree-node__content {
  padding-left: 0px !important;
}

.dic_tree /deep/ .el-tree-node {
  position: relative;
  padding-left: 16px;
}

.dic_tree /deep/ .el-tree-node__children {
  padding-left: 8px;
}

.dic_tree /deep/ .el-tree-node :last-child:before {
  height: 38px;
}

.dic_tree /deep/ .el-tree > .el-tree-node:before {
  border-left: none;
}

.tree-container /deep/ .el-tree > .el-tree-node:after {
  border-top: none;
}

.dic_tree /deep/ .el-tree-node:before {
co_dengxiongwen's avatar
co_dengxiongwen committed
1063
  content: '';
葛齐林's avatar
葛齐林 committed
1064 1065 1066 1067 1068 1069 1070
  left: -4px;
  position: absolute;
  right: auto;
  border-width: 1px;
}

.dic_tree /deep/ .el-tree-node:after {
co_dengxiongwen's avatar
co_dengxiongwen committed
1071
  content: '';
葛齐林's avatar
葛齐林 committed
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
  left: -4px;
  position: absolute;
  right: auto;
  border-width: 1px;
}

.dic_tree /deep/ .el-tree-node:before {
  border-left: 1px dashed #bfbfbf;
  bottom: 0px;
  height: 100%;
  top: -26px;
  width: 1px;
}

.dic_tree /deep/ .el-tree-node:after {
  border-top: 1px dashed #bfbfbf;
  height: 20px;
  top: 12px;
  width: 35px;
  // background: red;
co_dengxiongwen's avatar
co_dengxiongwen committed
1092 1093
  position: absolute;
  z-index: 1;
葛齐林's avatar
葛齐林 committed
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106
}
.tree-container /deep/ .el-tree > .el-tree-node:after {
  border-top: none;
}

.tree-container {
  /* 树的parent,样式自定 */
}
.dic_tree /deep/ .el-tree-node__expand-icon.expanded {
  transform: rotate(0deg);
  -webkit-transform: rotate(0deg);
}
.dic_tree /deep/ .el-icon-caret-right:before {
co_dengxiongwen's avatar
co_dengxiongwen committed
1107
  background: url('../../../assets/images/add.png');
葛齐林's avatar
葛齐林 committed
1108

co_dengxiongwen's avatar
co_dengxiongwen committed
1109
  content: '';
葛齐林's avatar
葛齐林 committed
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
  display: block;
  width: 18px;
  height: 18px;
  font-size: 18px;
  background-size: 18px;
  // background:skyblue;
}
.dic_tree
  /deep/
  .el-tree-node__expand-icon.expanded.el-icon-caret-right:before {
co_dengxiongwen's avatar
co_dengxiongwen committed
1120 1121
  background: url('../../../assets/images/sub.png');
  content: '';
葛齐林's avatar
葛齐林 committed
1122 1123 1124 1125 1126 1127 1128
  display: block;
  width: 18px;
  height: 18px;
  font-size: 18px;
  background-size: 18px;
  // background:skyblue;
}
co_dengxiongwen's avatar
co_dengxiongwen committed
1129 1130
.dic_tree /deep/.el-tree-node__content > .el-tree-node__expand-icon {
  padding: 0 2px 0 0;
葛齐林's avatar
葛齐林 committed
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177
}

.dic_tree /deep/.el-tree-node__expand-icon.is-leaf::before {
  opacity: 0;
}
.dic_tree /deep/.is-leaf.el-tree-node__expand-icon.el-icon-caret-right {
  // margin-left: -15px !important;
}
</style>

<style lang="scss">
// openlayer 样式
.resource-container {
  .ol-overviewmap {
    left: 89%;
  }
}
</style>
<style lang="scss">
.resource-container {
  width: 100%;
  height: 100%;
  position: relative;
  border: 0px solid black;
  overflow: auto;
  .span-box {
    font-size: 12px;
    border-radius: 5px;
    position: absolute;
  }
}

.tier-btn {
  .active-tier {
    background-color: #409eff;
    color: #ffffff;
  }
}
.ol_point {
  .regionDiv {
    background: #35aff8;
    opacity: 0.5;
    z-index: 10;
  }
  .el-tree {
    background: #f4f4f4;
    font-size: 12px;
co_dengxiongwen's avatar
co_dengxiongwen committed
1178 1179
    overflow-y: auto;
    height: 750px;
葛齐林's avatar
葛齐林 committed
1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307
  }
  .el-card__body {
    padding: 0;
  }
  .el-card {
    height: 99%;
    background: #f4f4f4;
  }
  .el-tree {
    padding: 20px 20px 0 0px;
  }
  .el-tree--highlight-current
    .el-tree-node.is-current
    > .el-tree-node__content {
    background-color: #f4f4f4 !important;
    color: #fff !important;
    .el-button--text {
      color: #fff;
    }
    .custom-tree-node {
      background-color: #35aff8 !important;
    }
  }

  .ol_point_left_top {
    height: 50px;
    background: #e1edf4;
    padding-left: 10px;
    .ol_point_left_topL {
      height: 40px;
      padding-top: 10px;
      float: left;
      div {
        height: 40px;
        float: left;
        padding: 0 10px 0 10px;
        line-height: 40px;
        cursor: pointer;
        font-size: 14px;
        border: 1px solid transparent;

        span {
          color: #35aff8;
        }
      }
      div.on {
        background: #fff;
        border: 1px solid #c3c3c3;
        border-bottom: none;
        font-family: Microsoft YaHei;
        font-weight: 400;
      }
    }
    .ol_point_left_topR {
      float: right;
      margin-top: 10px;
      .el-input {
        width: 109px;
      }
    }
  }
  .ol_point_right_button {
    height: 50px;
    width: 100%;
    background: #e3e4e6;
    border-bottom: 1px solid #ccc;
    ol_point_right_button_l {
      margin-left: 20px;
    }
    .el-button--primary.is-plain {
      margin-top: 5px;
      background: #ced1d6;
      border: none;
      color: #656565;
    }
    .tier-btn .active-tier {
      background-color: #409eff;
      color: #ffffff;
    }
    .el-button.is-plain:hover {
      background: #fff;
      border-color: #32a5ea;
      color: #32a5ea;
    }
  }
  .ol_point_right_button_r {
    position: absolute;
    right: 20px;
    top: 60px;
    width: 95px;
    height: 26px;
    z-index: 10;
    font-size: 12px;
    line-height: 25px;
    overflow: hidden;
    border-radius: 13px;
    background: #ced1d6;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0px 1px 0px 1px rgba(255, 255, 255, 0.25),
      0px 2px 4px 0px rgba(0, 0, 0, 0.1);
    div {
      width: 46px;
      height: 24px;
      float: left;
      text-align: center;
      cursor: pointer;
    }
    div.on {
      background: #45b5f8;
      color: #fff;
      border-radius: 13px;
      border: 1px solid rgba(23, 41, 71, 0.5);
      box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.3),
        0px 2px 0px 0px rgba(255, 255, 255, 0.15);
    }
  }
  .map_right {
    margin-top: 50px;
    iframe {
      width: 1600px;
      height: 680px;
    }
  }
}
.ol-overviewmap .ol-overviewmap-map {
  height: 110px !important;
}
</style>