无人机管理后台前端(已迁走)
chenyao
2025-11-13 c958cd87cfc8fdb712187793b2147f8f5f967892
feat:还原返航高度
3 files modified
52 ■■■■■ changed files
src/hooks/useRouteLine/useRouteLine.js 7 ●●●●● patch | view | raw | blame | history
src/store/modules/common.js 10 ●●●●● patch | view | raw | blame | history
src/views/tickets/orderLog.vue 35 ●●●●● patch | view | raw | blame | history
src/hooks/useRouteLine/useRouteLine.js
@@ -194,10 +194,9 @@
                height: 50,
            },
        })
        // 获取航线拆分所有点
        store.commit('setPositionsArr', pointList)
        // 获取安全起飞高度
        store.commit('setSafeHeight', curRouteLineData.value.take_off_security_height)
        // 获取最后一点高度
        console.log(pointList, '查看数组最后一点高度')
        store.commit('setLastHeight', Number(pointList[pointList.length - 1].height))
        flyVisual({
            positionsData:pointList.map(i => [Number(i.longitude), Number(i.latitude), Number(i.height)]),
            viewer,
src/store/modules/common.js
@@ -21,15 +21,11 @@
      htsjzx: 100, //数据中心
      htlsrwxq: 100, //历史任务详情
    },
    safeHeight: 0, // 获取选择航线高度
    positionsArr: [], // 获取选择航线点数据
    lastHeight: 0, // 获取最后一点高度
  },
  mutations: {
    setSafeHeight (state, data) {
      state.safeHeight = data
    },
    setPositionsArr(state, data) {
      state.positionsArr = data
    setLastHeight(state, data) {
      state.lastHeight = data
    },
    setDownloadProgress(state, data) {
      state.downloadProgress = data
src/views/tickets/orderLog.vue
@@ -555,8 +555,7 @@
  orderLogExport,
  jobStatusNum,
  userPublish,
  deleteOrderLog,
  getWaylineMaxTerrainHeight
  deleteOrderLog
} from '@/api/tickets/orderLog'
import { getTicketInfo } from '@/api/tickets/ticket'
import { getDictionaryByCode } from '@/api/system/dictbiz'
@@ -811,13 +810,9 @@
      return CircleClose
    },
    ...mapGetters(['userInfo', 'permission']),
    safeHeight () {
      const safeHeight = this.$store.state.common.safeHeight
      return Number(safeHeight) || 0 // 确保是数字类型
    },
    positionsArr () {
      const positionsArr = this.$store.state.common.positionsArr
      return Number(positionsArr) || 0 // 确保是数字类型
    lastHeight () {
      const height = this.$store.state.common.lastHeight
      return Number(height) || 0 // 确保是数字类型
    },
    filteredTabs () {
      // rejection_and_draft 权限控制“已驳回”和“草稿”tab
@@ -997,21 +992,15 @@
          const maxItem = checkedList.reduce((max, item) => {
            return item.drone_height > max.drone_height ? item : max;
          });
          // 返航绝对高度
          let backHeight = this.form.rth_altitude // + maxItem.drone_height
          console.log(backHeight,'backHeight')
          // 安全起飞高度
          this.positionsArr.unshift({latitude: maxItem.latitude, longitude: maxItem.longitude, height:maxItem.drone_height })
          this.positionsArr.push({latitude: maxItem.latitude, longitude: maxItem.longitude, height:maxItem.drone_height})
          let resultHeight = 0
          await getWaylineMaxTerrainHeight(this.positionsArr).then(res => {
            resultHeight = this.safeHeight > (res.data.data + 30) ? this.safeHeight : (res.data.data + 30)
          })
          let valueHeight = _.round(backHeight - resultHeight, 2)
          console.log('打印比较值', valueHeight)
          console.log(maxItem.drone_height, '高度');
          console.log(this.lastHeight, '最后一点高度');
          let result = _.round((maxItem.drone_height + this.form.rth_altitude), 2);
          if (valueHeight < 0) {
            this.$confirm(`当前返航高度存在安全隐患,建议调整为${resultHeight}米以上后进行发布`, '提示', {
          let resultHeight = this.lastHeight - maxItem.drone_height
          let resultH = _.round(resultHeight, 2)
          if (this.lastHeight > result) {
            this.$confirm(`当前返航高度存在安全隐患,建议调整为${resultH}米以上后进行发布`, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'