| | |
| | | } |
| | | |
| | | //=============================== |
| | | // 获取实时航线 |
| | | const getWrjSsLx = () => { |
| | | if (window.cesiumViewer== null) return |
| | | globalViewer = window.cesiumViewer; |
| | | getWaylineFile(sbInfo.sn).then((res:any) => { |
| | | if (res.code != 200) return |
| | | ssLinePath.value = res.data |
| | | // globalViewer = window.cesiumViewer |
| | | // 先有航线,再飞行 |
| | | generateCourse() |
| | | }) |
| | | } |
| | | |
| | | // 生成航线轨迹 |
| | | const generateCourse = async () => { |
| | | if (!ssLinePath.value) return |
| | | const { fileInfoObj } = await analyzeKmzFile(`${ssLinePath.value}?_t=${new Date().getTime()}`) |
| | | const xmlStr = await fileInfoObj['wpmz/template.kml'] |
| | | const xmlJson = XMLToJSON(xmlStr)?.['Document'] |
| | | const placemark = xmlJson.Folder.Placemark |
| | | if (placemark?.Polygon) { |
| | | // return 'planar' |
| | | planarWayline(ssLinePath.value, sbInfo.longitude, sbInfo.latitude) |
| | | } else { |
| | | // return 'point' |
| | | pointWayline(ssLinePath.value, sbInfo.longitude, sbInfo.latitude) |
| | | } |
| | | } |
| | | |
| | | // 监听ws |
| | | const messageHandler = async (payload: any) => { |
| | |
| | | } |
| | | case EBizCode.DockOsd: { // 机场 |
| | | store.commit('SET_DOCK_INFO', payload.data) |
| | | break |
| | | } |
| | | case EBizCode.FlightTaskProgress: { // 获取进度 |
| | | // 如果点击列表进入没有获取到航线文件,那么这里重新请求一次 |
| | | if (ssLinePath.value == '') { |
| | | getWrjSsLx() |
| | | } |
| | | break |
| | | } |
| | | } |
| | |
| | | } |
| | | }; |
| | | |
| | | // 获取实时航线 |
| | | const getWrjSsLx = () => { |
| | | if (window.cesiumViewer== null) return |
| | | globalViewer = window.cesiumViewer; |
| | | getWaylineFile(sbInfo.sn).then((res:any) => { |
| | | if (res.code != 200) return |
| | | ssLinePath.value = res.data |
| | | // globalViewer = window.cesiumViewer |
| | | // 先有航线,再飞行 |
| | | generateCourse() |
| | | }) |
| | | } |
| | | |
| | | // 切换航线轨迹 |
| | | const courseTrack = (data:any) => { |
| | | if (window.cesiumViewer== null) return |
| | |
| | | }, {deep: true}) |
| | | |
| | | |
| | | |
| | | // 生成航线轨迹 |
| | | const generateCourse = async () => { |
| | | // ssLinePath.value = 'https://wrj.shuixiongit.com/minio/cloud-bucket/wayline/20250211/wayline_1739254562374.kmz' |
| | | if (!ssLinePath.value) return |
| | | const { fileInfoObj } = await analyzeKmzFile(`${ssLinePath.value}?_t=${new Date().getTime()}`) |
| | | const xmlStr = await fileInfoObj['wpmz/template.kml'] |
| | | const xmlJson = XMLToJSON(xmlStr)?.['Document'] |
| | | const placemark = xmlJson.Folder.Placemark |
| | | console.log('看看航线值', sbInfo) |
| | | if (placemark?.Polygon) { |
| | | // return 'planar' |
| | | planarWayline(ssLinePath.value, sbInfo.longitude, sbInfo.latitude) |
| | | } else { |
| | | // return 'point' |
| | | pointWayline(ssLinePath.value, sbInfo.longitude, sbInfo.latitude) |
| | | } |
| | | } |
| | | |
| | | let intervalId = null; |
| | | |
| | | onMounted(async () => { |
| | |
| | | if (domain !== '0') { |
| | | await getPhoneLocation(false,workspaceId.value) |
| | | // // // 设置定时器,每隔 5 秒刷新一次数据 |
| | | intervalId = setInterval(getPhoneLocation, 5000); |
| | | intervalId = setInterval(()=> { |
| | | getPhoneLocation(false,workspaceId.value) |
| | | }, 5000); |
| | | } |
| | | }); |
| | | |