智慧园区前端大屏
shuishen
2024-12-24 722f87fb9221542588a9593855bb3cbcc6d55f74
图层配置调整
2 files modified
4 files added
249 ■■■■■ changed files
public/img/mapicon/kt.png patch | view | raw | blame | history
public/img/mapicon/ql.png patch | view | raw | blame | history
public/img/mapicon/wd.png patch | view | raw | blame | history
public/img/mapicon/zb.png patch | view | raw | blame | history
src/pages/map/components/scomponents/layersControl.vue 185 ●●●● patch | view | raw | blame | history
src/views/space/components/leftContainer.vue 64 ●●●●● patch | view | raw | blame | history
public/img/mapicon/kt.png
public/img/mapicon/ql.png
public/img/mapicon/wd.png
public/img/mapicon/zb.png
src/pages/map/components/scomponents/layersControl.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-10-31 10:47:29
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-12-24 17:04:32
 * @LastEditTime: 2024-12-24 17:17:34
 * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue
 * @Description:
 *
@@ -269,6 +269,22 @@
      },
      {
        id: '3-4',
        label: '闸坝',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 4,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/zb.png',
        className: 'sk-box',
        showPanel: false,
        layerName: 'zb'
      },
      {
        parentId: '3',
        id: '3-5',
        label: '水库',
@@ -308,6 +324,80 @@
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        parentId: '3',
        id: '3-6',
        label: '坑塘',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 6,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/kt.png',
        className: 'sk-box',
        showPanel: false,
        layerName: 'kt',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroyPop()
          if (!attrParams.firmName) {
            return
          }
          addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          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),
            `<div class="public-map-popup-two">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        id: '3-7',
        label: '洼地',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 7,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/wd.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'wd'
      },
      {
        id: '3-8',
        label: '桥梁',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 8,
          size: 1000
        },
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/ql.png',
        className: 'xfs-box',
        showPanel: false,
        layerName: 'ql'
      },
    ]
  },
@@ -396,46 +486,47 @@
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      },
      {
        parentId: '4',
        id: '4-9',
        label: '暂定',
        type: 'layer',
        subType: 'labelPoint',
        method: getRiskList,
        params: {
          riskLevel: 9,
          size: 1000
        },
        showParams: 'category',
        className: 'fxy-zd',
        backgroundIcon: VITE_APP_BASE + 'img/mapicon/fxy-zd.png',
        showPanel: false,
        layerName: 'fxyZdLarger',
        incident: (e) => {
          const { attrParams } = e.overlay
          // 删除
          destroyPop()
          addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
          window.$viewer.addLayer(addPopLayers[attrParams.name])
          let iconEl = `<div class="marsBlueGradientPnl">
            <li>${attrParams.firmName || ''}</li>
            <li>${attrParams.name || ''}</li>
            <li>${attrParams.riskLevelName || ''}</li>
            </div>`
          let divIcon = new DC.DivIcon(
            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
            `<div class="public-map-popup-three">
                    ${iconEl}
                  </div>`
          )
          let incident = () => {
            destroyPop()
          }
          divIcon.on(DC.MouseEventType.CLICK, incident)
          addPopLayers[attrParams.name].addOverlay(divIcon)
        }
      }
      // {
      //   parentId: '4',
      //   id: '4-9',
      //   label: '暂定',
      //   type: 'layer',
      //   subType: 'labelPoint',
      //   method: getRiskList,
      //   params: {
      //     riskLevel: 9,
      //     size: 1000
      //   },
      //   showParams: 'category',
      //   className: 'fxy-zd',
      //   backgroundIcon: VITE_APP_BASE + 'img/mapicon/fxy-zd.png',
      //   showPanel: false,
      //   layerName: 'fxyZdLarger',
      //   incident: (e) => {
      //     const { attrParams } = e.overlay
      //     // 删除
      //     destroyPop()
      //     addPopLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name)
      //     window.$viewer.addLayer(addPopLayers[attrParams.name])
      //     let iconEl = `<div class="marsBlueGradientPnl">
      //       <li>${attrParams.firmName || ''}</li>
      //       <li>${attrParams.name || ''}</li>
      //       <li>${attrParams.riskLevelName || ''}</li>
      //       </div>`
      //     let divIcon = new DC.DivIcon(
      //       new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
      //       `<div class="public-map-popup-three">
      //               ${iconEl}
      //             </div>`
      //     )
      //     let incident = () => {
      //       destroyPop()
      //     }
      //     divIcon.on(DC.MouseEventType.CLICK, incident)
      //     addPopLayers[attrParams.name].addOverlay(divIcon)
      //   }
      // }
    ]
  },
@@ -476,7 +567,8 @@
      panoramaShow.value = true
    }
  },
  {
  /* {
    id: '8',
    label: '地面全景分布',
    type: 'layer',
@@ -503,7 +595,7 @@
      panoramaUrl.value = attrParams.url
      panoramaShow.value = true
    }
  },
  }, */
]
// let modellayer = new DC.VectorLayer("modellayer").addTo(window.$viewer)
@@ -871,16 +963,13 @@
  EventBus.emit('restHandleDelChange', `2`)
  EventBus.emit('restHandleDelChange', `3-1`)
  EventBus.emit('restHandleDelChange', `3-2`)
  // EventBus.emit('restHandleDelChange', `3-3-1`)
  EventBus.emit('restHandleDelChange', `3-3-2`)
  // EventBus.emit('restHandleDelChange', `3-3-3`)
  EventBus.emit('restHandleDelChange', `3-3-4`)
  EventBus.emit('restHandleDelChange', `3-3`)
  EventBus.emit('restHandleDelChange', `3-4`)
  EventBus.emit('restHandleDelChange', `3-5`)
  EventBus.emit('restHandleDelChange', `3-6`)
  EventBus.emit('restHandleDelChange', `3-7`)
  EventBus.emit('restHandleDelChange', `3-8`)
  // EventBus.emit('restHandleDelChange', `3-9`)
  EventBus.emit('restHandleDelChange', `4-1`)
  EventBus.emit('restHandleDelChange', `4-2`)
  EventBus.emit('restHandleDelChange', `4-9`)
src/views/space/components/leftContainer.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-03-10 15:27:59
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-28 11:35:07
 * @LastEditTime: 2024-12-24 17:12:17
 * @FilePath: \bigScreen\src\views\space\components\leftContainer.vue
 * @Description:
 *
@@ -17,18 +17,6 @@
  data: []
})
const gawList = ref([
  {
    label: '污水管网',
    value: "3-3-2",
    select: true
  },
  {
    label: '雨水管网',
    value: "3-3-4",
    select: false
  },
])
const curSelect = ref('')
// 获取下拉字典
@@ -37,7 +25,7 @@
    code: code,
  }
  getDictionary(param).then((res) => {
    resData.data = res.data.data.filter(i => i.dictKey != 7 && i.dictKey != 9 && i.dictKey != 11).map(item => {
    resData.data = res.data.data.map(item => {
      return {
        label: item.dictValue,
        value: item.dictKey
@@ -51,41 +39,14 @@
const tabClick = (item) => {
  EventBus.emit('destroyPop', 'destroyPop')
  if (curSelect.value) {
    if (curSelect.value == '3') {
      EventBus.emit('restHandleDelChange', `3-3`)
      EventBus.emit('restHandleDelChange', `3-3-1`)
      EventBus.emit('restHandleDelChange', `3-3-2`)
      EventBus.emit('restHandleDelChange', `3-3-3`)
      EventBus.emit('restHandleDelChange', `3-3-4`)
    } else {
      gawList.value.forEach(element => {
        if (element.value == `3-3-2`) {
          element.select = true
        } else {
          element.select = false
        }
      });
      EventBus.emit('restHandleDelChange', `3-${curSelect.value}`)
    }
    EventBus.emit('restHandleDelChange', `3-${curSelect.value}`)
  }
  curSelect.value = item.value
  if (item.value == '3') {
    EventBus.emit('restHandleCheckChange', `3-3-2`)
  } else {
    EventBus.emit('restHandleCheckChange', `3-${item.value}`)
  }
  EventBus.emit('restHandleCheckChange', `3-${item.value}`)
  EventBus.emit('spaceTabChange', item.value)
  EventBus.emit('flyToyqfw', 'flyToyqfw')
}
const tabClickGW = (item) => {
  if (item.select) {
    EventBus.emit('restHandleDelChange', item.value)
    item.select = false
  } else {
    EventBus.emit('restHandleCheckChange', item.value)
    item.select = true
  }
}
const showOn = computed(() => (item) => {
@@ -118,19 +79,6 @@
        </div>
      </div>
    </div>
    <div v-if="curSelect == '3'">
      <div class="cur-container-title">
        <div class="tablist">
          <div class="cursor-p" :class="{ on: item.select }" v-for="item, index in gawList" :key="index"
            @click="tabClickGW(item)">
            <div class="label-box">
              {{ item.label }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>