GuLiMmo
2024-07-01 8e79b5c74f4c0f52cff9f18991cde9cfc16d270f
fix: /subscribeTopic
/unsubscribeTopic
注释
7 files modified
82 ■■■■ changed files
.gitignore 1 ●●●● patch | view | raw | blame | history
src/components/common/sidebar.vue 3 ●●●● patch | view | raw | blame | history
src/components/waylinetool/component/interval-shoot.vue 4 ●●●● patch | view | raw | blame | history
src/components/waylinetool/event-edit.vue 6 ●●●●● patch | view | raw | blame | history
src/pages/page-web/projects/tsa.vue 3 ●●●● patch | view | raw | blame | history
src/utils/cesium/use-map-draw.ts 64 ●●●● patch | view | raw | blame | history
vite.config.ts 1 ●●●● patch | view | raw | blame | history
.gitignore
@@ -1,6 +1,7 @@
node_modules
.DS_Store
dist
drone-web
dist-ssr
*.local
node_modules/
src/components/common/sidebar.vue
@@ -75,7 +75,8 @@
    async function goBack () {
      const query = toRefs(osdVisible.value)
      snList.value.forEach(async (v: string) => {
        await UnBind(v)
        // TODO:暂时注释
        // await UnBind(v)
      })
      store.commit('SET_OSD_VISIBLE_INFO', { ...query, visible: false })
      store.commit('SET_SELECT_WAYLINE_INFO', {})
src/components/waylinetool/component/interval-shoot.vue
@@ -2,9 +2,9 @@
 * @Author: GuLiMmo 2820890765@qq.com
 * @Date: 2024-03-27 15:15:50
 * @LastEditors: GuLiMmo 2820890765@qq.com
 * @LastEditTime: 2024-03-28 09:36:06
 * @LastEditTime: 2024-04-02 11:15:06
 * @FilePath: /drone-web/src/components/waylinetool/component/interval-shoot.vue
 * @Description: 航点事件-单拍
 * @Description: 航点事件-等距拍摄
 * Copyright (c) 2024 by GuLiMmo, All Rights Reserved.
-->
src/components/waylinetool/event-edit.vue
@@ -11,13 +11,15 @@
          <span @click="handleDelAction"><DeleteOutlined /></span>
        </div>
      </div>
      {{ currentPointEvent.aciton }}
      <div class="event-edit">
        <take-photo
          v-model:serial="serial"
          v-if="['takePhoto', 'startRecord'].includes(currentPointEvent.aciton.key)"
        />
        <interval-shoot v-model:serial="serial" />
        <interval-shoot
          v-model:serial="serial"
          v-if="['distance'].includes(currentPointEvent.aciton.key)"
          />
      </div>
    </div>
    <div class="map-box"></div>
src/pages/page-web/projects/tsa.vue
@@ -522,7 +522,8 @@
        onlineDevices.data.push(device)
      }
      snList.push(gateway.device_sn)
      bind(gateway.device_sn)
      // TODO: 暂时注释
      // bind(gateway.device_sn)
    })
    store.commit('SET_SN_LIST', snList)
  })
src/utils/cesium/use-map-draw.ts
@@ -5,7 +5,7 @@
import { ref } from 'vue'
import { cesiumOperation } from '/@/hooks/use-cesium-tsa'
import { XMLToJSON } from './kmz'
import _ from 'lodash'
import _, { includes } from 'lodash'
const { addPolyline, getEntityById, removeAllDataSource, removeAllPoint } = cesiumOperation()
const getResource = (name: string) => {
@@ -51,12 +51,12 @@
    icon: getResource('waylinetool/camera-off.png'),
  },
  {
    key: 'time',
    key: 'multipleTiming',
    name: '开始等时间隔拍照',
    icon: getResource('waylinetool/shoot1.png'),
  },
  {
    key: 'distance',
    key: 'multipleDistance',
    name: '开始等距间隔拍照',
    icon: getResource('waylinetool/shoot2.png'),
  },
@@ -91,7 +91,7 @@
    key: 'panoShot',
    name: '全景拍摄',
    icon: getResource('waylinetool/panoramicview.png'),
  }
  },
]
const waylinePointsEvent = ref<tragetPoint[]>([])
@@ -315,30 +315,60 @@
    }
    const kmlJson = XMLToJSON(kmlRes).Document
    const points = Array.isArray(kmlJson.Folder?.Placemark) ? kmlJson.Folder.Placemark : [kmlJson.Folder.Placemark]
    let takePhotoNum = 0
    points?.forEach((point: { actionGroup: any }, index: number) => {
      if (point !== undefined) {
        if (Reflect.has(point, 'actionGroup')) {
          const action = point.actionGroup.action
          if (Array.isArray(action)) {
            action.forEach((item) => {
              const { actionActuatorFunc } = item
              actionActuatorFunc?.['#text'] === 'takePhoto' && takePhotoNum++
              const actionObj: eventParmas | any = actionList.find((event) => actionActuatorFunc['#text'] === event.key)
              waylinePointsEvent.value[index].eventList?.push(actionObj)
          if (Array.isArray(point.actionGroup)) {
            const actionGroups = point.actionGroup
            actionGroups.forEach((actionGroup) => {
              const action = actionGroup.action
              const actionTrigger = actionGroup.actionTrigger
              pointActionShow(action, actionTrigger, index)
            })
          } else {
            action?.actionActuatorFunc['#text'] === 'takePhoto' && takePhotoNum++
            const actionObj: eventParmas | any = actionList.find(
              (item) => action?.actionActuatorFunc['#text'] === item.key,
            )
            waylinePointsEvent.value[index].eventList?.push(actionObj)
            const action = point.actionGroup.action
            const actionTrigger = point.actionGroup.actionTrigger
            pointActionShow(action, actionTrigger, index)
          }
        }
      }
    })
    waylineDetails[3].value = takePhotoNum
  }
  let takePhotoNum = 0
  const pointActionShow = (
    action: { forEach: (arg0: (item: any) => void) => void; actionActuatorFunc: { [x: string]: string } },
    actionTrigger: { actionTriggerType: { [x: string]: string } },
    index: number,
  ) => {
    if (Array.isArray(action)) {
      action.forEach((item) => {
        const { actionActuatorFunc } = item
        actionActuatorFunc?.['#text'] === 'takePhoto' && takePhotoNum++
        const actionObj: eventParmas | any = actionList.find((event) => {
          if (actionTrigger?.actionTriggerType['#text'] === event.key) {
            return actionTrigger?.actionTriggerType['#text'] === event.key
          } else {
            return actionActuatorFunc['#text'] === event.key
          }
        })
        waylinePointsEvent.value[index].eventList?.push(actionObj)
      })
    } else {
      action?.actionActuatorFunc['#text'] === 'takePhoto' && takePhotoNum++
      const actionObj: eventParmas | any = actionList.find((item) => {
        const actionTriggerType = actionTrigger.actionTriggerType['#text']
        if (['multipleDistance', 'multipleTiming'].includes(actionTriggerType)) {
          return actionTriggerType === item.key
        } else {
          return action?.actionActuatorFunc['#text'] === item.key
        }
      })
      waylinePointsEvent.value[index].eventList?.push(actionObj)
    }
  }
  const clearWaylineData = () => {
    kmlEntities.value = []
    waylinePointsEvent.value = []
vite.config.ts
@@ -96,6 +96,7 @@
    build: {
      target: ['es2015'], // 最低支持 es2015
      sourcemap: true,
      outDir: 'drone-web'
    },
  }
})