智慧园区前端大屏
shuishen
2024-11-12 c4aaf9b67de6da80d9c4eda55379a057f60e1f47
src/pages/layout/components/scomponents/layersControl.vue
@@ -2,8 +2,8 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-10-31 10:47:29
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-11 18:27:15
 * @FilePath: \bigScreen\src\views\layout\components\scomponents\layersControl.vue
 * @LastEditTime: 2024-11-12 13:29:29
 * @FilePath: \bigScreen\src\pages\layout\components\scomponents\layersControl.vue
 * @Description:
 *
 * Copyright (c) 2024 by shuishen, All Rights Reserved.
@@ -43,12 +43,17 @@
      </div>
    </template>
  </public-box>
  <panorama v-show="panoramaShow" :title="panoramaTitle" :url="panoramaUrl" @closePanoramaPopup="closePanoramaPopup">
  </panorama>
</template>
<script setup>
import panorama from './popup/panorama.vue'
import { getPage } from '@/api/indParkInfo'
import { getList } from "@/api/space/space"
import { getList as getRiskList } from "@/api/riskSource/riskSource"
import { getPanoramaList } from "@/api/panorama/"
import yqfw from "@/assets/json/yqfw"
import gsgw from "@/assets/json/gsgw"
import rqgw from "@/assets/json/rqgw"
@@ -64,6 +69,14 @@
const treeProps = {
  indent: 16,
  showLabelLine: true,
}
// 全景相关
const panoramaShow = ref(false)
const panoramaTitle = ref('')
const panoramaUrl = ref('')
const closePanoramaPopup = () => {
  panoramaShow.value = false
}
const data = [
@@ -267,6 +280,36 @@
    ]
  },
  {
    id: '7',
    label: '地图全景点位分布',
    type: 'layer',
    subType: 'labelPoint',
    method: getPanoramaList,
    params: {
      size: 1000
    },
    backgroundIcon: VITE_APP_BASE + 'img/mapicon/qj.png',
    showPanel: false,
    layerName: 'dtqjdwfb',
    incident: (e) => {
      const { attrParams } = e.overlay
      panoramaTitle.value = attrParams.name
      if (
        attrParams.url.indexOf("http://vr.jxpskj.com:180") != -1
      ) {
        attrParams.url = attrParams.url.replace(
          "http://vr.jxpskj.com:180",
          "/panorama/url"
        )
      }
      panoramaUrl.value = attrParams.url
      panoramaShow.value = true
    }
  },
]
const defaultProps = {
@@ -315,8 +358,6 @@
const handleCheckChange = (data) => {
  let options = treeRef.value?.getCheckedNodes()
  console.log(options, 12111212)
  collectedNodes.value = []
  collectNodesWithFlag(data)
@@ -340,7 +381,7 @@
        window.$viewer.flyTo(addTileLayers[item.layerName][0])
      } else if (item.subType == 'labelPoint') {
        if (!addTileLayers[item.layerName]) {
          addTileLayers[item.layerName] = new DC.HtmlLayer(addTileLayers[item.layerName])
          addTileLayers[item.layerName] = new DC.HtmlLayer(item.layerName)
          window.$viewer.addLayer(addTileLayers[item.layerName])
          item.method(item.params).then(res => {
@@ -370,6 +411,14 @@
                    ${iconEl}
                  </div>`
              )
              divIcon.attrParams = i
              let incident = () => { }
              if (item.incident) incident = item.incident
              divIcon.on(DC.MouseEventType.CLICK, incident)
              addTileLayers[item.layerName].addOverlay(divIcon)
            })
@@ -403,7 +452,7 @@
          addTileLayers[item.layerName] = new DC.VectorLayer(item.layerName)
          window.$viewer.addLayer(addTileLayers[item.layerName])
          function computeCircle(radius) {
          function computeCircle (radius) {
            var positions = []
            for (var i = 0; i < 1080; i++) {
              var radians = DC.Math.toRadians(i)