forked from drone/command-center-dashboard

shuishen
2025-04-17 381b218d91095471f8715c616110b023a192ff18
feat:聚合hooks调整
2 files modified
29 ■■■■■ changed files
src/hooks/useMapAggregation/useMapAggregation.js 21 ●●●● patch | view | raw | blame | history
src/hooks/useSingleDroneMap/useSingleDroneMap.js 8 ●●●● patch | view | raw | blame | history
src/hooks/useMapAggregation/useMapAggregation.js
@@ -6,9 +6,12 @@
import DevicePopUpBox from '@/hooks/components/DevicePopUpBox.vue'
import EventPopUpBox from '@/hooks/components/EventPopUpBox.vue'
// 图标
import offlineImg from '@/assets/images/home/useEventOperate/offline.png'
import onlineImg from '@/assets/images/home/useEventOperate/eventSingle.png'
// 机巢图标
import endingImg from '@/assets/images/aiNowFly/ending.png'
import endingHighImg from '@/assets/images/aiNowFly/ending-high.png'
import { render } from 'vue'
import { useStore } from 'vuex'
import { getCenterPoint } from '@/utils/cesium/mapUtil'
@@ -39,8 +42,6 @@
export const useMapAggregation = (type, status) => {
    const { flyTo } = cesiumOperation()
    const singleImg = type === 'device' ? onlineImg : eventSingle
  const offlinesingleImg = type === 'device' ? offlineImg : eventSingle
    const mergeImg = type === 'device' ? aggregationImg : eventAggregationImg
    const MapPopUpBox = type === 'device' ? DevicePopUpBox : EventPopUpBox
    const styleTransform = type === 'device' ? 'translateY(-50%)' : 'translate(-50%,-110%)'
@@ -136,7 +137,6 @@
    // 事件散点
    let eventList = []
    function processChildren(childrens) {
        // console.log(childrens, '事件点')
        return (childrens || []).map(item => {
            const arr = processChildren(item.childrens)
            if (item.data) {
@@ -195,6 +195,7 @@
        if (!areaCode) return
        saveParams.area_code = areaCode
        const list = type === 'device' ? await getDeviceCount(areaCode) : await getMapEventCount(saveParams)
        const splashedList =
            type === 'device'
                ? await getDeviceList(areaCode)
@@ -291,7 +292,9 @@
    //散点机巢
    function splashed(row) {
        row.splashedList.forEach((item, index) => {
      const image = type === 'device' ? (item.status === "OFFLINE" ? endingHighImg : endingImg) : eventSingle
            viewer.entities.add({
                id: `aggregation-splashed-${index}`,
@@ -308,9 +311,7 @@
                },
                billboard: {
          // singleImg
                    image: new Cesium.ConstantProperty(()=>{
            return item.status ==="OFFLINE" ? offlinesingleImg:singleImg
          }),
          image: new Cesium.ConstantProperty(image),
                    width: 24,
                    height: 24,
                },
@@ -495,8 +496,6 @@
    const singleMachineEvent = async click => {
        let clickTargets = viewer.scene.drillPick(click.position).map(item => item.id)
        if (!clickTargets.length) return
        // console.log(clickTargets, 11111)
        let deviceAggregationFind = findTypeItem(
            clickTargets,
src/hooks/useSingleDroneMap/useSingleDroneMap.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2025-04-15 22:41:40
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2025-04-17 14:30:08
 * @LastEditTime: 2025-04-17 15:05:32
 * @FilePath: \command-center-dashboard\src\hooks\useSingleDroneMap\useSingleDroneMap.js
 * @Description: 
 * 
@@ -168,13 +168,9 @@
    let clickedEntities = viewer?.scene.drillPick(click.position).map(item => item.id)
    console.log(clickedEntities, 1111111)
    if (!clickedEntities?.length) return
    currentEntity = findEntityByType(clickedEntities, 'single-drone-event')
    console.log(currentEntity, 1111111)
    removeLabel()
@@ -215,8 +211,6 @@
  const labelBoxRender = () => {
    if (!currentEntity) return
    let dom = document.querySelector('#mapPopUpBox')
    console.log(currentEntity.properties.customData, 4444)
    if (!dom) {
      dom = getLabelDom(currentEntity.properties.customData._value.data)