| | |
| | | export function useTaskWayline () { |
| | | let viewer = null |
| | | let deviceOsdInfo = null |
| | | let taskWatch = null |
| | | let deviceWatch = null |
| | | |
| | | // 解析kmz文件 |
| | | const parsingFiles = async url => { |
| | |
| | | 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 { |