| | |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2025-04-19 19:00:36 |
| | | * @FilePath: \command-center-dashboard\src\hooks\useTaskWayline\useTaskWayline.js |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2025 by shuishen, All Rights Reserved. |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2025 by shuishen, All Rights Reserved. |
| | | */ |
| | | import lineImg from '@/assets/images/arrow-right-blue.png' |
| | | import rwqfdImg from '@/assets/images/signMachineNest/rwqfd.png' |
| | |
| | | export function useTaskWayline () { |
| | | let viewer = null |
| | | let deviceOsdInfo = null |
| | | let taskWatch = null |
| | | let deviceWatch = null |
| | | |
| | | // 解析kmz文件 |
| | | const parsingFiles = async url => { |
| | |
| | | function setAircraftGltf () { |
| | | const host = deviceOsdInfo.value?.data?.host |
| | | |
| | | console.log(host, 1111111111) |
| | | |
| | | const aircraftEntity = viewer?.entities.getById('aircraftGltf') |
| | | const position = Cesium.Cartesian3.fromDegrees(host?.longitude, host?.latitude, host?.height) |
| | | if (aircraftEntity) { |
| | |
| | | viewer = v |
| | | deviceOsdInfo = computed(() => wsInfo.value?.device_osd) |
| | | |
| | | watch(taskDetails, |
| | | taskWatch?.() |
| | | |
| | | taskWatch = watch(taskDetails, |
| | | () => { |
| | | if (taskDetails.value?.way_lines?.length) { |
| | | parsingFiles(taskDetails.value.way_lines[0].url) |
| | |
| | | { immediate: true } |
| | | ) |
| | | |
| | | watch(deviceOsdInfo, () => { |
| | | deviceWatch?.() |
| | | |
| | | deviceWatch = watch(deviceOsdInfo, () => { |
| | | const host = deviceOsdInfo.value?.data?.host |
| | | |
| | | if (!host) return |
| | |
| | | onBeforeUnmount(() => { |
| | | mapEntityRemove() |
| | | removeEntitys() |
| | | |
| | | taskWatch?.() |
| | | deviceWatch?.() |
| | | }) |
| | | |
| | | return { |
| | |
| | | removeEntitys, |
| | | mapEntityRemove, |
| | | } |
| | | } |
| | | } |