智慧园区前端大屏
shuishen
2025-02-20 c76b6b7d56a681f4c0e62764fd922f90b4df03dd
src/views/pd/components/dynamicPanel.vue
@@ -2,17 +2,30 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-11-09 15:41:35
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-26 01:09:57
 * @LastEditTime: 2025-02-12 20:00:22
 * @FilePath: \bigScreen\src\views\pd\components\dynamicPanel.vue
 * @Description: 
 * 
 * Copyright (c) 2024 by shuishen, All Rights Reserved. 
-->
<script setup>
import EventBus from 'utils/bus'
const { VITE_APP_BASE } = import.meta.env
const emit = defineEmits(['closePanel'])
import { onUnmounted } from 'vue'
import { spatialAnalysisPoint } from "@/api/space/space"
import { useMap } from 'store/map'
const mapStore = useMap()
import { usePointStore } from 'store/usepoint'
const pointStore = usePointStore()
onMounted(() => {
  pointStore.updateSharedData(1)
})
let lineTime = null
let timeOne = null
@@ -20,176 +33,302 @@
let timeThree = null
let timeFour = null
let timeFive = null
let timeSix = null
const panelData = reactive({
  data: [
    {
      type: 'demo',
      key: 1,
      title: '典型案例1',
      content: '南片区松节油储罐区泄漏事故: 南片区某企业松节油储罐泄漏,如不采取措施,将造成污染事故,影响到赣江下游水质。',
      title: '典型案例',
      content: '化工园区罐区泄漏事故: 化工园区某企业储罐泄漏,如不采取措施,将造成污染事故,影响到长江下游水质。',
      oneCentent: '2024年11月11日11时,南片区某公司松节油储罐泄漏。企业关闭前置阀门切断泄漏源,向罐内适量注水,抬高液位。',
      oneCentent: '2024年11月11日11时,化工园区某企业储罐泄漏。企业关闭前置阀门切断泄漏源,向罐内适量注水,抬高液位。',
      onePointPosition: {
        lng: 115.10175740,
        lat: 27.27356477
        lng: 115.60652633,
        lat: 29.80893013,
        alt: 19
      },
      onetime: 0,
      twoContent: '应立即启动应急池的使用,将泄漏的松节油引导至应急池中。',
      twoContent: '启动应急池的使用,将泄漏的化学原料引导至应急池中。',
      twoPointPosition: {
        lng: 115.10198913,
        lat: 27.27343615
        lng: 115.6074303,
        lat: 29.80929992,
        alt: 17
      },
      twotime: 5000,
      lineCenter: {
        lng: 115.10343807,
        lat: 27.27256126
        lng: 115.60786813,
        lat: 29.80937902,
        alt: 30
      },
      linePosition: '115.10341051,27.27251643,80;115.10357817,27.27278003,80',
      lineTime: 10000,
      threeContent: '关闭绿源污水处理厂旁雨水排口,拦截污染水体。',
      threePointPosition: {
        lng: 115.10921467,
        lat: 27.27166382
      },
      threetime: 15000,
      fourContent: '启用绿源污水处理厂事故应急池,将已拦截废水泵入应急池。',
      fourPointPosition: {
        lng: 115.10814596,
        lat: 27.27257473
      },
      fourtime: 20000,
      fiveContent: '应急指挥部指导企业处理受污染废水, 监测公共应急池水质 ,确保达标后安全转运至绿源污水处理厂。',
      fivePointPosition: {
        lng: 115.10845441,
        lat: 27.27327366
      },
      fivetime: 25000,
    },
    {
      key: 2,
      title: '典型案例2',
      content: '北片区碱类腐蚀性物质泄漏事故: 北片区某企业在生产过程中操作失误,大量含碱废水泄漏,如不采取措施,将造成污染事故,影响到赣江下游水质。',
      oneCentent: '2024年09月16日14时,北片区某公司在生产过程中操作失误,大量含碱废水泄漏。企业关闭前置阀门,切断泄漏源,用砂土等筑堤堵截泄漏液体或者引流到安全地点。',
      onePointPosition: {
        lng: 115.10467136,
        lat: 27.29415383
      },
      onetime: 0,
      lineCenter: {
        lng: 115.10343807,
        lat: 27.27256126
      },
      linePosition: '115.10626847,27.29410411,80;115.10626769,27.29453267,80',
      linePosition: '115.60782622,29.80955698,30;115.60783535,29.80913790,30',
      lineTime: 5000,
      twoContent: '园区关闭北区雨水排口,拦截污染水体。',
      twoPointPosition: {
        lng: 115.10542509,
        lat: 27.29924475
      },
      twotime: 10000,
      threeContent: '园区启用北区公共应急池,将已拦截废水泵入应急池。',
      threeContent: '企业采取紧急措施后,还有部分松节油进入厂外雨水管网。',
      threePointPosition: {
        lng: 115.10418532,
        lat: 27.29444603
        lng: 115.60782622,
        lat: 29.80955698,
        alt: 30
      },
      threetime: 15000,
      fourContent: '将拦截废水从应急池中通过北区污水提升泵站转移至绿源污水处理厂进行处置。',
      fourContent: '关闭园区闸坝,拦截污染水体。',
      fourPointPosition: {
        lng: 115.10814596,
        lat: 27.27257473
        lng: 115.6269944,
        lat: 29.80695862,
        alt: 5
      },
      fourtime: 20000,
      fourtime: 15000,
      fiveContent: '排口下游展开应急监测,确保废水没有进入周边水系。',
      fiveContent: '应急指挥部指导企业处理受污染废水, 监测公共应急池水质 ,根据水质情况分批次进入生化系统处理。',
      fivePointPosition: {
        lng: 115.10921467,
        lat: 27.27166382
        lng: 115.62761928,
        lat: 29.80836521,
        alt: 7
      },
      fivetime: 25000
      fivetime: 20000,
    },
    {
      key: 3,
      title: '典型案例3',
      content: '危险化学品运输事故: 北片区某企业的危化品运输车辆发生侧翻,大量盐酸流至路面,如不采取措施,将造成污染事故,影响到赣江下游水质。',
      oneCentent: '2024年09月16日14时,北片区某公司的危化品运输车辆发生侧翻,大量盐酸流至路面。',
      onePointPosition: {
        lng: 115.10248629,
        lat: 27.28112873
      },
      onetime: 0,
      twoContent: '调度金龙水库清水,稀释污染团。',
      twoPointPosition: {
        lng: 115.10488545,
        lat: 27.27678110
      },
      twotime: 0,
      threeContent: '转输至江西粤鹏环保高新技术开发有限公司事故应急池、初期雨水池。',
      threePointPosition: {
        lng: 115.10545135,
        lat: 27.28043872
      },
      threetime: 0,
      fourContent: '转输至江西腾龙源环保科技有限公司事故应急池、初期雨水池。',
      fourPointPosition: {
        lng: 115.10332118,
        lat: 27.27831698
      },
      fourtime: 0,
      type: 'custom',
      key: 2,
      title: '自定义案例',
      content: '自定义风险源:化工园区某企业发生化学原料危害品泄漏,如不采取措施,将造成污染事故,影响到长江下游水质',
    },
  ]
})
const dynamicVectorLayer = new DC.VectorLayer('dynamicVectorLayer').addTo(window.$viewer)
const dynamicHtmlLayer = new DC.HtmlLayer('dynamicHtmlLayer').addTo(window.$viewer)
const dynamicLineVectorLayer = new DC.VectorLayer('dynamicLineVectorLayer').addTo(window.$viewer)
let dynamicVectorLayer = new DC.VectorLayer('dynamicVectorLayer').addTo(window.$viewer)
let dynamicHtmlLayer = new DC.HtmlLayer('dynamicHtmlLayer').addTo(window.$viewer)
let dynamicLineVectorLayer = new DC.VectorLayer('dynamicLineVectorLayer').addTo(window.$viewer)
const schemeStart = (item) => {
  emit('closePanel')
  clearAll()
let modelPosition = [
  {
    lng: 115.10640155,
    lat: 27.28121605
  },
  {
    lng: 115.10641953,
    lat: 27.28084006
  },
  {
    lng: 115.10641886,
    lat: 27.28026147
  },
  {
    lng: 115.10642486,
    lat: 27.27994712,
  },
  {
    lng: 115.10640964,
    lat: 27.27928393,
  },
  {
    lng: 115.10639803,
    lat: 27.27848014
  }
]
  window.$viewer.flyToPosition(new DC.Position(item.onePointPosition.lng, item.onePointPosition.lat, 400, 0, -90, 0), () => {
    let oneCenter = DC.Position.fromObject(item.onePointPosition)
    let oneCircle = new DC.Circle(oneCenter, 20)
    oneCircle.setStyle({
      material: new DC.CircleWaveMaterialProperty({
        color: DC.Color.RED.withAlpha(0.9),
        speed: 20,
        count: 5,
        gradient: 0.5
      })
let positions = modelPosition.map(i => [i.lng, i.lat, i.ele || 64].join(',')).join(';')
let tc = new DC.TrackController(window.$viewer)
let track = new DC.Track(positions, 5)
track.setModel(VITE_APP_BASE + 'gltf/car.gltf', {
  show: true,
  scale: 0.0025,
  // nodeTransformations: {
  //   rotation: window.$Cesium.Quaternion.fromHeadingPitchRoll(window.$Cesium.Math.toRadians(0), window.$Cesium.Math.toRadians(0), window.$Cesium.Math.toRadians(0)),
  // }
})
tc.addTrack(track)
let startClick = false
const synth = window.speechSynthesis
const speak = (msg, continueFun = () => { }) => {
  let u = new SpeechSynthesisUtterance()
  let voices = synth.getVoices()
  u.text = msg
  u.rate = 2
  let findObj = voices.some(voice => voice.lang == 'zh-CN')
  if (!findObj) {
    u.lang = 'zh-TW'
  }
  u.onend = () => {
    continueFun()
  }
  synth.speak(u)
}
const publicFun = (item) => {
  if (startClick) pointStore.updateSharedData(3)
  let fourCenter = DC.Position.fromObject(item.fourPointPosition)
  let fourCircle = new DC.Circle(fourCenter, 30)
  fourCircle.setStyle({
    material: new DC.CircleWaveMaterialProperty({
      color: DC.Color.fromRandom(),
      speed: 20,
      count: 5,
      gradient: 0.5
    })
    dynamicVectorLayer.addOverlay(oneCircle)
  })
  dynamicVectorLayer.addOverlay(fourCircle)
    let oneCentent = new DC.DivIcon(
      new DC.Position(item.onePointPosition.lng, item.onePointPosition.lat, 70),
      `<div class="dynamic-map-popup">
  let fourContent = new DC.DivIcon(
    new DC.Position(item.fourPointPosition.lng, item.fourPointPosition.lat, item.fourPointPosition.alt),
    `<div class="dynamic-map-popup">
                  <div class="content-wrap">
                    <div class="content">
                      <p>${item.fourContent}</p>
                    </div>
                  </div>
                  <div class="arrow"></div>
                </div>`
  )
  dynamicHtmlLayer.addOverlay(fourContent)
  window.$viewer.flyToPosition(new DC.Position(item.fourPointPosition.lng, item.fourPointPosition.lat, 400, 0, -90, 0), () => {
    speak(item.fourContent, () => {
      if (item.fivePointPosition) {
        let fiveCenter = DC.Position.fromObject(item.fivePointPosition)
        let fiveCircle = new DC.Circle(fiveCenter, 10)
        fiveCircle.setStyle({
          material: new DC.CircleWaveMaterialProperty({
            color: DC.Color.fromRandom(),
            speed: 20,
            count: 5,
            gradient: 0.5
          })
        })
        dynamicVectorLayer.addOverlay(fiveCircle)
        let fiveContent = new DC.DivIcon(
          new DC.Position(item.fivePointPosition.lng, item.fivePointPosition.lat, item.fivePointPosition.alt),
          `<div class="dynamic-event-profile-map-popup">
                      <div class="content-wrap">
                        <div class="content">
                          <p>${item.fiveContent}</p>
                        </div>
                      </div>
                      <div class="arrow"></div>
                    </div>`
        )
        dynamicHtmlLayer.addOverlay(fiveContent)
        // 执行对应的事件函数
        window.$viewer.flyToPosition(new DC.Position(item.fivePointPosition.lng, item.fivePointPosition.lat, 400, 0, -90, 0), () => {
          speak(item.fiveContent, () => {
            if (item.sixPointPosition) {
              let sixCenter = DC.Position.fromObject(item.sixPointPosition)
              let sixCircle = new DC.Circle(sixCenter, 10)
              sixCircle.setStyle({
                material: new DC.CircleWaveMaterialProperty({
                  color: DC.Color.fromRandom(),
                  speed: 20,
                  count: 5,
                  gradient: 0.5
                })
              })
              dynamicVectorLayer.addOverlay(sixCircle)
              let sixContent = new DC.DivIcon(
                new DC.Position(item.sixPointPosition.lng, item.sixPointPosition.lat, 70),
                `<div class="dynamic-map-popup">
                              <div class="content-wrap">
                                <div class="content">
                                  <p>${item.sixContent}</p>
                                </div>
                              </div>
                              <div class="arrow"></div>
                          </div>`
              )
              dynamicHtmlLayer.addOverlay(sixContent)
              // 执行对应的事件函数
              window.$viewer.flyToPosition(new DC.Position(item.sixPointPosition.lng, item.sixPointPosition.lat, 400, 0, -90, 0), () => {
                speak(item.sixContent, () => {
                  if (item.sevenPointPosition) {
                    let sevenCenter = DC.Position.fromObject(item.sevenPointPosition)
                    let sevenCircle = new DC.Circle(sevenCenter, 10)
                    sevenCircle.setStyle({
                      material: new DC.CircleWaveMaterialProperty({
                        color: DC.Color.fromRandom(),
                        speed: 20,
                        count: 5,
                        gradient: 0.5
                      })
                    })
                    dynamicVectorLayer.addOverlay(sevenCircle)
                    let sevenContent = new DC.DivIcon(
                      new DC.Position(item.sevenPointPosition.lng, item.sevenPointPosition.lat, 70),
                      `<div class="dynamic-event-profile-map-popup">
                              <div class="content-wrap">
                                <div class="content">
                                  <p>${item.sevenContent}</p>
                                </div>
                              </div>
                              <div class="arrow"></div>
                          </div>`
                    )
                    dynamicHtmlLayer.addOverlay(sevenContent)
                    // 执行对应的事件函数
                    window.$viewer.flyToPosition(new DC.Position(item.sevenPointPosition.lng, item.sevenPointPosition.lat, 400, 0, -90, 0), () => {
                      speak(item.sevenContent)
                    }, 3)
                  }
                })
              }, 3)
            }
          })
        }, 3)
      }
    })
  }, 3)
}
const twoFun = (item, cb = () => { }) => {
  if (startClick) pointStore.updateSharedData(1)
  let twoCenter = DC.Position.fromObject(item.twoPointPosition)
  let twoCircle = new DC.Circle(twoCenter, 10)
  twoCircle.setStyle({
    material: new DC.CircleWaveMaterialProperty({
      color: DC.Color.fromRandom(),
      speed: 20,
      count: 5,
      gradient: 0.5
    })
  })
  dynamicVectorLayer.addOverlay(twoCircle)
  let twoContent = new DC.DivIcon(
    new DC.Position(item.twoPointPosition.lng, item.twoPointPosition.lat, item.twoPointPosition.alt),
    `<div class="dynamic-event-profile-map-popup">
          <div class="content-wrap">
            <div class="content">
              <p>${item.oneCentent}</p>
              <p>${item.twoContent}</p>
              </div>
              </div>
              <div class="arrow"></div>
              </div>`
      // <p>特征污染物:${item.specificPollutant}</p>
    )
    dynamicHtmlLayer.addOverlay(oneCentent)
    // <p>特征污染物:${item.specificPollutant}</p>
  )
  dynamicHtmlLayer.addOverlay(twoContent)
  // 执行对应的事件函数
  window.$viewer.flyToPosition(new DC.Position(item.twoPointPosition.lng, item.twoPointPosition.lat, 400, 0, -90, 0), () => {
    speak(item.twoContent, () => {
      cb()
    })
  }, 3)
}
  item.linePosition && (lineTime = setTimeout(() => {
const createLinePath = (item, cb = () => { }) => {
  if (item.linePosition) {
    let polyline = new DC.Polyline(item.linePosition)
    polyline.setStyle({
      width: 20,
@@ -203,41 +342,9 @@
    })
    dynamicLineVectorLayer.addOverlay(polyline)
  } else {
    if (startClick) pointStore.updateSharedData(2)
    window.$viewer.flyToPosition(new DC.Position(item.lineCenter.lng, item.lineCenter.lat, 400, 0, -90, 0), () => { }, 3)
  }, item.lineTime))
  timeTwo = setTimeout(() => {
    let twoCenter = DC.Position.fromObject(item.twoPointPosition)
    let twoCircle = new DC.Circle(twoCenter, 10)
    twoCircle.setStyle({
      material: new DC.CircleWaveMaterialProperty({
        color: DC.Color.fromRandom(),
        speed: 20,
        count: 5,
        gradient: 0.5
      })
    })
    dynamicVectorLayer.addOverlay(twoCircle)
    let twoContent = new DC.DivIcon(
      new DC.Position(item.twoPointPosition.lng, item.twoPointPosition.lat, 70),
      `<div class="dynamic-event-profile-map-popup">
          <div class="content-wrap">
            <div class="content">
              <p>${item.twoContent}</p>
              </div>
              </div>
              <div class="arrow"></div>
              </div>`
      // <p>特征污染物:${item.specificPollutant}</p>
    )
    dynamicHtmlLayer.addOverlay(twoContent)
    // 执行对应的事件函数
    window.$viewer.flyToPosition(new DC.Position(item.twoPointPosition.lng, item.twoPointPosition.lat, 400, 0, -90, 0), () => { }, 3)
  }, item.twotime)
  timeThree = setTimeout(() => {
    let threeCenter = DC.Position.fromObject(item.threePointPosition)
    let threeCircle = new DC.Circle(threeCenter, 30)
    threeCircle.setStyle({
@@ -249,89 +356,292 @@
      })
    })
    dynamicVectorLayer.addOverlay(threeCircle)
  }
    let threeContent = new DC.DivIcon(
      new DC.Position(item.threePointPosition.lng, item.threePointPosition.lat, 70),
      `<div class="dynamic-map-popup">
  let threeContent = new DC.DivIcon(
    new DC.Position(item.threePointPosition.lng, item.threePointPosition.lat, item.threePointPosition.alt),
    `<div class="dynamic-event-profile-map-popup">
          <div class="content-wrap">
            <div class="content">
              <p>${item.threeContent}</p>
            </div>
          </div>
          <div class="arrow"></div>
        </div>`
    )
    dynamicHtmlLayer.addOverlay(threeContent)
    window.$viewer.flyToPosition(new DC.Position(item.threePointPosition.lng, item.threePointPosition.lat, 400, 0, -90, 0), () => { }, 3)
  }, item.threetime)
  item.fourPointPosition && (timeFour = setTimeout(() => {
    let FourCenter = DC.Position.fromObject(item.fourPointPosition)
    let fourCircle = new DC.Circle(FourCenter, 10)
    fourCircle.setStyle({
      material: new DC.CircleWaveMaterialProperty({
        color: DC.Color.fromRandom(),
        speed: 20,
        count: 5,
        gradient: 0.5
      })
    })
    dynamicVectorLayer.addOverlay(fourCircle)
    let fourContent = new DC.DivIcon(
      new DC.Position(item.fourPointPosition.lng, item.fourPointPosition.lat, 70),
      `<div class="dynamic-event-profile-map-popup">
          <div class="content-wrap">
            <div class="content">
              <p>${item.fourContent}</p>
              </div>
              </div>
              <div class="arrow"></div>
              </div>`
    )
    dynamicHtmlLayer.addOverlay(fourContent)
    // 执行对应的事件函数
    window.$viewer.flyToPosition(new DC.Position(item.fourPointPosition.lng, item.fourPointPosition.lat, 400, 0, -90, 0), () => { }, 3)
  }, item.fourtime))
    // <p>特征污染物:${item.specificPollutant}</p>
  )
  dynamicHtmlLayer.addOverlay(threeContent)
  // 执行对应的事件函数
  item.fivePointPosition && (timeFive = setTimeout(() => {
    let fiveCenter = DC.Position.fromObject(item.fivePointPosition)
    let fiveCircle = new DC.Circle(fiveCenter, 10)
    fiveCircle.setStyle({
      material: new DC.CircleWaveMaterialProperty({
        color: DC.Color.fromRandom(),
        speed: 20,
        count: 5,
        gradient: 0.5
      })
  window.$viewer.flyToPosition(new DC.Position(item.threePointPosition.lng, item.threePointPosition.lat, 400, 0, -90, 0), () => {
    speak(item.threeContent, () => {
      cb()
    })
    dynamicVectorLayer.addOverlay(fiveCircle)
  }, 3)
}
const parseLineString = (lineString) => {
  // 移除 "LINESTRING(" 和 ")"
  const cleanedString = lineString.replace(/^LINESTRING\(/, '').replace(/\)$/, '')
    let fiveContent = new DC.DivIcon(
      new DC.Position(item.fivePointPosition.lng, item.fivePointPosition.lat, 70),
      `<div class="dynamic-event-profile-map-popup">
  // 使用逗号分割成坐标对字符串数组
  const coordinatePairsString = cleanedString.split(',')
  // 将每个坐标对字符串转换为数组,并解析成浮点数
  const coordinatesArray = coordinatePairsString.map(pair => {
    const [lon, lat] = pair.trim().split(' ')
    return [parseFloat(lon), parseFloat(lat)]
  })
  return coordinatesArray
}
let publicEventHandle = {
  oneCentent: 'xx年xx月xx日,企业发生化学原料危害品泄漏。',
  onePointPosition: {
    lng: null,
    lat: null,
    alt: null
  },
  onetime: 0,
  twoContent: '关闭所有可能外溢事故污水的外排口,利用企业自身的围堰、应急池等环境应急防控设施,将污水控制在企业厂区内部。',
  twoPointPosition: {
    lng: null,
    lat: null,
    alt: null
  },
  twotime: 5000,
  threeContent: '通过专用管道或临时转输措施,与相邻企业应急池、园区公共应急池等互联互通,拦截处置事故污水。',
  threePointPosition: {
    lng: null,
    lat: null,
    alt: null
  },
  threetime: 15000,
  fourContent: '利用化工集中区内的坑塘、河道、沟渠以及周边水系等,构建环境应急防控空间,对进出园区的水体实施封闭或分段管控。',
  fourPointPosition: {
    lng: null,
    lat: null,
    alt: null
  },
  fourtime: 15000,
}
const wxEntityClick = (e) => {
  const { attrParams } = e.overlay
  clearAll()
  pointStore.updateSharedData(1)
  mapStore.setShowPreLevel(true)
  spatialAnalysisPoint({
    lng: attrParams.lng,
    lat: attrParams.lat
  }).then(res => {
    let arr = res.data.data
    publicEventHandle.onePointPosition = {
      lng: attrParams.lng,
      lat: attrParams.lat,
      alt: 16
    }
    arr.forEach(item => {
      if (item.preLevel == 1) {
        publicEventHandle.twoPointPosition = {
          lng: item.lng,
          lat: item.lat,
          alt: item.ele
        }
      }
      if (item.preLevel == 2 && item.geom) {
        var line = window.$turf.lineString(parseLineString(item.geom))
        var pt = window.$turf.point([attrParams.lng, attrParams.lat])
        var snapped = window.$turf.nearestPointOnLine(line, pt, { units: "miles" })
        publicEventHandle.threePointPosition = {
          lng: snapped.geometry.coordinates[0],
          lat: snapped.geometry.coordinates[1],
          alt: 30
        }
      }
      if (item.preLevel == 3) {
        publicEventHandle.fourPointPosition = {
          lng: item.lng,
          lat: item.lat,
          alt: item.ele
        }
      }
    })
    timeOne = setTimeout(() => {
      function oneLoad () {
        let oneCenter = DC.Position.fromObject(publicEventHandle.onePointPosition)
        let oneCircle = new DC.Circle(oneCenter, 20)
        oneCircle.setStyle({
          material: new DC.CircleWaveMaterialProperty({
            color: DC.Color.RED.withAlpha(0.9),
            speed: 20,
            count: 5,
            gradient: 0.5
          })
        })
        dynamicVectorLayer.addOverlay(oneCircle)
        let oneCentent = new DC.DivIcon(
          new DC.Position(publicEventHandle.onePointPosition.lng, publicEventHandle.onePointPosition.lat, publicEventHandle.onePointPosition.alt),
          `<div class="dynamic-map-popup">
          <div class="content-wrap">
            <div class="content">
              <p>${item.fiveContent}</p>
              <p>${publicEventHandle.oneCentent}</p>
              </div>
              </div>
              <div class="arrow"></div>
              </div>`
    )
    dynamicHtmlLayer.addOverlay(fiveContent)
    // 执行对应的事件函数
    window.$viewer.flyToPosition(new DC.Position(item.fivePointPosition.lng, item.fivePointPosition.lat, 400, 0, -90, 0), () => { }, 3)
  }, item.fivetime))
          // <p>特征污染物:${publicEventHandle.specificPollutant}</p>
        )
        dynamicHtmlLayer.addOverlay(oneCentent)
        speak(publicEventHandle.oneCentent, () => {
          twoFun(publicEventHandle, () => {
            createLinePath(publicEventHandle, () => {
              publicFun(publicEventHandle)
            })
          })
        })
      }
      if (publicEventHandle.showModel) {
        oneLoad()
      } else {
        window.$viewer.flyToPosition(new DC.Position(publicEventHandle.onePointPosition.lng, publicEventHandle.onePointPosition.lat, 400, 0, -90, 0), () => {
          oneLoad()
        }, 3)
      }
    }, publicEventHandle.onetime)
  })
}
EventBus.on('wxEntityClick', wxEntityClick)
const schemeStart = (item, type) => {
  emit('closePanel')
  clearAll()
  if (type == 1) {
    if (startClick) {
      EventBus.emit('restHandleDelChange', `4-1`)
      EventBus.emit('restHandleDelChange', `4-2`)
      EventBus.emit('restHandleDelChange', `4-3`)
      EventBus.emit('restHandleDelChange', `4-9`)
    }
    if (item.showModel) {
      window.$viewer.flyToPosition("115.10587903,27.28374884,400,0,-90", () => {
        track.setModel(VITE_APP_BASE + 'gltf/car.gltf', {
          show: true,
          scale: 0.0025,
          // nodeTransformations: {
          //   rotation: window.$Cesium.Quaternion.fromHeadingPitchRoll(window.$Cesium.Math.toRadians(0), window.$Cesium.Math.toRadians(0), window.$Cesium.Math.toRadians(0)),
          // }
        })
        tc.play()
        tc.viewTrack(track, {
          mode: '2',
          pitch: -45,
          range: 400
        })
      })
    }
    timeOne = setTimeout(() => {
      function oneLoad () {
        let oneCenter = DC.Position.fromObject(item.onePointPosition)
        let oneCircle = new DC.Circle(oneCenter, 20)
        oneCircle.setStyle({
          material: new DC.CircleWaveMaterialProperty({
            color: DC.Color.RED.withAlpha(0.9),
            speed: 20,
            count: 5,
            gradient: 0.5
          })
        })
        dynamicVectorLayer.addOverlay(oneCircle)
        let oneCentent = new DC.DivIcon(
          new DC.Position(item.onePointPosition.lng, item.onePointPosition.lat, item.onePointPosition.alt),
          `<div class="dynamic-map-popup">
          <div class="content-wrap">
            <div class="content">
              <p>${item.oneCentent}</p>
              </div>
              </div>
              <div class="arrow"></div>
              </div>`
          // <p>特征污染物:${item.specificPollutant}</p>
        )
        dynamicHtmlLayer.addOverlay(oneCentent)
        speak(item.oneCentent, () => {
          if (item.key == 2) {
            twoFun(item, () => {
              createLinePath(item, () => {
                publicFun(item)
              })
            })
          } else if (item.key == 1) {
            twoFun(item, () => {
              createLinePath(item, () => {
                publicFun(item)
              })
            })
          } else {
            twoFun(item, () => {
              createLinePath(item, () => {
                publicFun(item)
              })
            })
          }
        })
      }
      if (item.showModel) {
        oneLoad()
      } else {
        window.$viewer.flyToPosition(new DC.Position(item.onePointPosition.lng, item.onePointPosition.lat, 400, 0, -90, 0), () => {
          oneLoad()
        }, 3)
      }
    }, item.onetime)
    startClick = false
    mapStore.setStartCustomWx(startClick)
  } else {
    startClick = true
    mapStore.setStartCustomWx(startClick)
    EventBus.emit('restHandleCheckChange', `4`)
  }
}
const clearAll = () => {
  mapStore.setShowPreLevel(false)
  window.speechSynthesis.cancel()
  lineTime && (clearTimeout(lineTime), lineTime = null)
  timeOne && (clearTimeout(timeOne), timeOne = null)
  timeTwo && (clearTimeout(timeTwo), timeTwo = null)
  timeThree && (clearTimeout(timeThree), timeThree = null)
  timeFour && (clearTimeout(timeFour), timeFour = null)
  timeFive && (clearTimeout(timeFive), timeFive = null)
  timeSix && (clearTimeout(timeSix), timeSix = null)
  track.setModel(VITE_APP_BASE + 'gltf/car.gltf', {
    show: false,
    scale: 0.0025,
    // nodeTransformations: {
    //   rotation: window.$Cesium.Quaternion.fromHeadingPitchRoll(window.$Cesium.Math.toRadians(0), window.$Cesium.Math.toRadians(0), window.$Cesium.Math.toRadians(0)),
    // }
  })
  dynamicVectorLayer.clear()
  dynamicHtmlLayer.clear()
@@ -339,11 +649,27 @@
}
onUnmounted(() => {
  if (startClick) {
    EventBus.emit('restHandleDelChange', `4-1`)
    EventBus.emit('restHandleDelChange', `4-2`)
    EventBus.emit('restHandleDelChange', `4-3`)
    EventBus.emit('restHandleDelChange', `4-9`)
  }
  mapStore.setStartCustomWx(false)
  EventBus.off('wxEntityClick', wxEntityClick)
  clearAll()
  dynamicVectorLayer && window.$viewer.removeLayer(dynamicVectorLayer)
  dynamicHtmlLayer && window.$viewer.removeLayer(dynamicHtmlLayer)
  dynamicLineVectorLayer && window.$viewer.removeLayer(dynamicLineVectorLayer)
  tc.clear()
  dynamicVectorLayer && window.$viewer && window.$viewer.removeLayer(dynamicVectorLayer)
  dynamicHtmlLayer && window.$viewer && window.$viewer.removeLayer(dynamicHtmlLayer)
  dynamicLineVectorLayer && window.$viewer && window.$viewer.removeLayer(dynamicLineVectorLayer)
  tc = null
  track = null
  dynamicVectorLayer = null
  dynamicHtmlLayer = null
  dynamicLineVectorLayer = null
})
</script>
@@ -366,9 +692,15 @@
              </div>
            </div>
            <div class="footer-btn">
              <div class="start-btn" @click="schemeStart(item)">
            <div class="footer-btn" v-show="item.type == 'demo'">
              <div class="start-btn" @click="schemeStart(item, 1)">
                开始模拟
              </div>
            </div>
            <div class="footer-btn" v-show="item.type != 'demo'">
              <div class="start-btn" @click="schemeStart(item, 2)">
                自定义风险源
              </div>
            </div>
          </div>
@@ -449,6 +781,7 @@
.start-btn,
.start-btn:focus,
.start-btn:hover {
  padding: 0 10px;
  display: inline-block;
  position: relative;
  min-width: 96px;