智慧园区前端大屏
linwe
2024-12-03 769f362f3d91ca4336c6cd74a78aa02e2c9ceb33
应急空间调整
3 files modified
31 ■■■■■ changed files
src/pages/map/components/scomponents/layersControl.vue 19 ●●●●● patch | view | raw | blame | history
src/styles/base/dc-base.scss 2 ●●● patch | view | raw | blame | history
src/views/space/components/box/dataContent.vue 10 ●●●● patch | view | raw | blame | history
src/pages/map/components/scomponents/layersControl.vue
@@ -172,10 +172,11 @@
          if (!attrParams.firmName) {
            return
          }
          addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPopLayers[attrParams.name])
          addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
          window.$viewer.addLayer(addPopLayers[attrParams.id])
          let iconEl = `<div class="marsBlueGradientPnl">
            <div>${attrParams.firmName}</div>
            <div>${attrParams.mainFuncName}</div>
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
@@ -187,7 +188,7 @@
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.name].addOverlay(divIcon)
          addPopLayers[attrParams.id].addOverlay(divIcon)
        }
      },
      {
@@ -211,10 +212,11 @@
          if (!attrParams.firmName) {
            return
          }
          addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPopLayers[attrParams.name])
          addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
          window.$viewer.addLayer(addPopLayers[attrParams.id])
          let iconEl = `<div class="marsBlueGradientPnl">
                  <div>${attrParams.firmName}</div> 
            <div>${attrParams.mainFuncName}</div>
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
@@ -226,7 +228,7 @@
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.name].addOverlay(divIcon)
          addPopLayers[attrParams.id].addOverlay(divIcon)
        }
      },
@@ -387,6 +389,7 @@
          window.$viewer.addLayer(addPopLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
                  <div>${attrParams.firmName}</div>
            <div>${attrParams.mainFuncName}</div>
                </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
@@ -962,13 +965,15 @@
// 销毁
function destroyPop () {
  let arr = Object.keys(addPopLayers)
  arr.filter(i => i != 'hgyq').forEach(i => {
  if(arr.length > 0){
    arr.forEach(i => {
    addPopLayers[i] && window.$viewer && window.$viewer.removeLayer(addPopLayers[i])
    addPopLayers[i] = null
    delete addPopLayers[i]
  })
  addPopLayers = {}
}
}
onUnmounted(() => {
  let arr = Object.keys(addTileLayers)
src/styles/base/dc-base.scss
@@ -106,7 +106,7 @@
    -moz-border-radius: 5px;
    border-radius: 5px;
    // line-height: 32px;
    width: 112px;
    width: 200px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
src/views/space/components/box/dataContent.vue
@@ -86,6 +86,7 @@
// 查询分页数据
const getLists = (param = {}) => {
  destroyPupoLayers()
  tableData.value = []
  param.current = pages.page
  param.size = pages.pageSize
@@ -118,9 +119,10 @@
let addPupoLayers = {}
// 行点击
function rowClick (row, column, event) {
  EventBus.emit('destroyPop', 'destroyPop')
  if (row.lng && row.lat) {
    window.$viewer.flyToPosition(new DC.Position(row.lng, row.lat, 600, 0, -90, 0))
    if (!row.imageUrl) {
    if (!row.firmName) {
      return
    }
    // 删除
@@ -128,8 +130,8 @@
    addPupoLayers[row.name] = new DC.HtmlLayer(row.name)
    window.$viewer.addLayer(addPupoLayers[row.name])
    let iconEl = `<div class="marsBlueGradientPnl">
            <div>${row.fullName}</div>
            <img src="${row.imageUrl}" />
            <div>${row.firmName}</div>
            <div>${row.mainFuncName}</div>
                </div>`
    let divIcon = new DC.DivIcon(
      new DC.Position(row.lng, row.lat, row.ele || 64),
@@ -190,6 +192,7 @@
// 销毁
function destroyPupoLayers () {
  let arr = Object.keys(addPupoLayers)
  if (arr.length > 0) {
  arr.forEach(i => {
    addPupoLayers[i] && window.$viewer && window.$viewer.removeLayer(addPupoLayers[i])
    addPupoLayers[i] = null
@@ -197,6 +200,7 @@
  })
  addPupoLayers = {}
}
}
</script>
<template>