智慧园区前端大屏
linwe
2024-11-04 6436f06c84ceb0bf2d8771dbad1c9e8e80bb587e
Merge remote-tracking branch 'origin/main'
5 files modified
193 ■■■■ changed files
src/views/layout/components/scomponents/baseMap.vue 15 ●●●●● patch | view | raw | blame | history
src/views/layout/components/scomponents/layersControl.vue 149 ●●●●● patch | view | raw | blame | history
src/views/survey/components/box/fireContent.vue 24 ●●●●● patch | view | raw | blame | history
src/views/survey/components/box/unitContent.vue 5 ●●●●● patch | view | raw | blame | history
src/views/survey/index.vue patch | view | raw | blame | history
src/views/layout/components/scomponents/baseMap.vue
@@ -289,21 +289,6 @@
    global.$viewer.setTerrain()
  }
  let layer = new DC.HtmlLayer('layer')
  global.$viewer.addLayer(layer)
        let divIcon = new DC.DivIcon(
          new DC.Position(124, 24, 100),
          `<div class="public-map-popup">
            <div class="marsBlueGradientPnl">
              <div>指挥室</div>
            </div>
          </div>`
        )
        divIcon.setStyle({
        })
        layer.addOverlay(divIcon)
</script>
<style lang="scss" scoped>
src/views/layout/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-10-31 18:16:33
 * @LastEditTime: 2024-11-04 14:27:54
 * @FilePath: \bigScreen\src\views\layout\components\scomponents\layersControl.vue
 * @Description: 
 * 
@@ -46,6 +46,8 @@
</template>
<script setup>
import { getPage } from '@/api/indParkInfo'
import { getList } from "@/api/space/space"
const { VITE_APP_BASE } = import.meta.env
import { getViewer } from 'utils/getViewer'
const globalViewer = getViewer()
@@ -58,23 +60,120 @@
const data = [
  {
    id: 1,
    label: '三维模型',
    children: [
      {
        id: 4,
        label: '倾斜摄影',
        children: [
          {
            id: 9,
            label: '化工园区',
            type: 'layer',
            subType: '3Dtile',
            url: VITE_APP_BASE + 'mx/tileset.json'
    url: VITE_APP_BASE + 'mx/tileset.json',
    layerName: 'hgyq'
          },
        ],
  {
    id: 2,
    label: '企业分布',
    type: 'layer',
    subType: 'labelPoint',
    method: getPage,
    params: {
      size: 1000
      },
    ],
    layerName: 'qyfb'
  },
  {
    id: 3,
    label: '应急空间',
    children: [
      {
        id: 3 - 1,
        label: '应急池',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 1,
          size: 1000
        },
        layerName: 'yjc'
      },
      {
        id: 3 - 2,
        label: '阀门',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 2,
          size: 1000
        },
        layerName: 'fm'
      },
      {
        id: 3 - 3,
        label: '公共管网',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 3,
          size: 1000
        },
        layerName: 'gggw'
      },
      {
        id: 3 - 4,
        label: '污水提升泵站',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 4,
          size: 1000
        },
        layerName: 'wstsbz'
      },
      {
        id: 3 - 5,
        label: '水库',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 5,
          size: 1000
        },
        layerName: 'sk'
      },
      {
        id: 3 - 6,
        label: '应急泵',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 6,
          size: 1000
        },
        layerName: 'yjb'
      },
      {
        id: 3 - 7,
        label: '消防沙',
        type: 'layer',
        subType: 'labelPoint',
        method: getList,
        params: {
          type: 7,
          size: 1000
        },
        layerName: 'xfs'
      }
    ]
  }
]
const defaultProps = {
@@ -121,6 +220,8 @@
let tileLayers = new DC.TilesetLayer('tileLayers')
globalViewer.addLayer(tileLayers)
const handleCheckChange = (data, options) => {
  collectedNodes.value = []
  collectNodesWithFlag(data)
@@ -133,13 +234,35 @@
        )
        tileLayers.addOverlay(addTileLayers[item.layerName])
        globalViewer.flyTo(addTileLayers[item.layerName])
      } else if (item.subType == 'labelPoint') {
        addTileLayers[item.layerName] = new DC.HtmlLayer('labelLayer')
        globalViewer.addLayer(addTileLayers[item.layerName])
        item.method(item.params).then(res => {
          let data = res.data.data.records
          data.filter(i => i.lng && i.lng != '' && i.lat && i.lat != '').forEach(i => {
            let divIcon = new DC.DivIcon(
              new DC.Position(i.lng, i.lat, 0),
              `<div class="public-map-popup">
                <div class="marsBlueGradientPnl">
                  <div>${i.name}</div>
                </div>
              </div>`
            )
            addTileLayers[item.layerName].addOverlay(divIcon)
          })
        })
      }
    } else {
      if (item.subType == '3Dtile') {
        tileLayers.removeOverlay(addTileLayers[item.layerName])
      } else if (item.subType == 'labelPoint') {
        globalViewer.removeLayer(addTileLayers[item.layerName])
      }
        delete addTileLayers[item.layerName]
      }
    }
  })
}
src/views/survey/components/box/fireContent.vue
@@ -1,7 +1,15 @@
<!--
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-11-04 16:32:04
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-04 16:32:58
 * @FilePath: \bigScreen\src\views\survey\components\box\fireContent.vue
 * @Description:
 *
 * Copyright (c) 2024 by shuishen, All Rights Reserved.
-->
<script setup>
// import publicContent from './publicContent.vue'
import publicContent from './publicContent.vue'
import { getRiskSourceStatistic } from '../../../../api/indParkInfo'
@@ -24,7 +32,7 @@
        res.data.data.forEach(element => {
            xaxis_data.push(element.riskLevel)
            yaxis_data.push(element.num)
        });
    })
        myEcharts.setOption({
            tooltip: {
                trigger: 'axis',
@@ -66,8 +74,8 @@
</script>
<template>
    <!-- <public-content>
        <template #content> -->
  <public-content>
    <template #content>
    <div class="fireContent-box">
        <div>
@@ -79,8 +87,8 @@
        </div>
    </div>
    <!-- </template>
    </public-content> -->
    </template>
  </public-content>
</template>
<style lang="scss" scoped>
src/views/survey/components/box/unitContent.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-03-13 14:54:26
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-01 10:08:41
 * @LastEditTime: 2024-11-04 13:58:17
 * @FilePath: \bigScreen\src\views\survey\components\box\unitContent.vue
 * @Description: 
 * 
@@ -17,7 +17,6 @@
const curEcharts = ref(null)
let myEcharts = reactive(null)
onMounted(() => {
  nextTick(() => {
@@ -37,7 +36,7 @@
        name: item.type,
        value: item.num
      })
    });
    })
    myEcharts.setOption({
      legend: {
src/views/survey/index.vue