无人机管理后台前端(已迁走)
shuishen
2025-06-14 32e51ed4e7a1ca073efb46eb1af8e1b167802d5b
feat:智飞工单已审核通过的工单详情,地图航线显示处理
3 files modified
24 ■■■■■ changed files
src/components/map-container/mapContainer.vue 2 ●●● patch | view | raw | blame | history
src/hooks/useRouteLine/useRouteLine.js 15 ●●●● patch | view | raw | blame | history
src/views/tickets/orderLog.vue 7 ●●●●● patch | view | raw | blame | history
src/components/map-container/mapContainer.vue
@@ -113,7 +113,7 @@
 * @param data 数据  数据格式 [[lng, lat], [lng, lat], [lng, lat]]
 */
async function addPolyline (data) {
    await renderPreviewLine(data.url, data.type, data.cb)
    await renderPreviewLine(data.url, data.type, data.cb, data.infos)
}
onMounted(() => {
src/hooks/useRouteLine/useRouteLine.js
@@ -33,6 +33,7 @@
        execute_height_mode: '',
        auto_flight_speed: '',
        wayline_type: '',
        infos: {}
    })
    const routeLineListClick = async data => {
@@ -42,7 +43,7 @@
        await renderRouteLine(data.data)
    }
    async function renderPreviewLine (kmzUrl, wayline_type, cb = () => { }) {
    async function renderPreviewLine (kmzUrl, wayline_type, cb = () => { }, infos = {}) {
        resetCurRouteLineData()
        const { pointPlacemark, polygonList, templateType, startPoint, execute_height_mode, auto_flight_speed } =
@@ -55,6 +56,7 @@
            execute_height_mode,
            auto_flight_speed,
            wayline_type,
            infos: infos
        }
        cb(curRouteLineData.value.polygonList.map(item => [Number(item[0]), Number(item[1])]))
@@ -130,8 +132,6 @@
            })
        }
        let pointList = handlePointListForKmz({
            placemark: data,
            startPoint: curRouteLineData.value.startPoint,
@@ -141,7 +141,14 @@
        pointList.shift()
        const routePositions = pointList.map(i => Cesium.Cartesian3.fromDegrees(Number(i.longitude), Number(i.latitude), Number(i.height)))
        let dronePosition = {}
        if (JSON.stringify(curRouteLineData.value.infos) != '{}') dronePosition = {
            longitude: curRouteLineData.value.infos[0].longitude,
            latitude: curRouteLineData.value.infos[0].latitude,
            height: curRouteLineData.value.infos[0].height || 0,
        }
        const routePositions = [dronePosition, ...pointList].map(i => Cesium.Cartesian3.fromDegrees(Number(i.longitude), Number(i.latitude), Number(i.height)))
        previewDataSource.entities.add({
            polyline: {
src/views/tickets/orderLog.vue
@@ -1055,7 +1055,7 @@
      this.initMapLine()
    },
    initMapLine (cb = () => { }) {
    initMapLine (infos = {}, cb = () => { }) {
      let currentLine = this.wayLineList.find(item => item.wayline_id == this.form.file_id)
      if (!currentLine) return
@@ -1065,7 +1065,8 @@
          this.$refs.MapContainer.initAddEntity('polyline', {
            url: `${import.meta.env.VITE_APP_AIRLINE_URL + currentLine.object_key}?_t=${new Date().getTime()}`,
            type: currentLine.wayline_type,
            cb
            cb,
            infos
          })
        }
      })
@@ -1077,7 +1078,7 @@
      that.device_sns = []
      this.initMapLine(async (polygon) => {
      this.initMapLine({}, async (polygon) => {
        const currentLine = that.wayLineList.find(item => item.wayline_id === waylineId)
        //按照航线来