From da727393fa41fa3eb97a8181526fa5db8cd6f014 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Fri, 14 Nov 2025 09:47:57 +0800
Subject: [PATCH] feat:更新智飞工单 返航高度

---
 src/views/tickets/orderLog.vue |   42 +++++++++++++++++++++++++++---------------
 1 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/src/views/tickets/orderLog.vue b/src/views/tickets/orderLog.vue
index 512ec11..73793d1 100644
--- a/src/views/tickets/orderLog.vue
+++ b/src/views/tickets/orderLog.vue
@@ -194,7 +194,7 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
-              <el-input-number v-model="form.rth_altitude" :min="50" :max="300"></el-input-number>
+              <el-input-number v-model="form.rth_altitude" :min="50" :max="500"></el-input-number>
             </el-form-item>
           </el-col>
         </el-row>
@@ -320,7 +320,7 @@
           <el-col :span="6">
             <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
               <el-input-number :disabled="detailTitle === '工单详情'" v-model="form.rth_altitude" :min="50"
-                               :max="300"></el-input-number>
+                               :max="500"></el-input-number>
             </el-form-item>
           </el-col>
         </el-row>
@@ -455,7 +455,7 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
-              <el-input-number :disabled="true" v-model="form.rth_altitude" :min="50" :max="300"></el-input-number>
+              <el-input-number :disabled="true" v-model="form.rth_altitude" :min="50" :max="500"></el-input-number>
             </el-form-item>
           </el-col>
         </el-row>
@@ -555,7 +555,8 @@
   orderLogExport,
   jobStatusNum,
   userPublish,
-  deleteOrderLog
+  deleteOrderLog,
+  getWaylineMaxTerrainHeight
 } from '@/api/tickets/orderLog'
 import { getTicketInfo } from '@/api/tickets/ticket'
 import { getDictionaryByCode } from '@/api/system/dictbiz'
@@ -810,9 +811,13 @@
       return CircleClose
     },
     ...mapGetters(['userInfo', 'permission']),
-    lastHeight () {
-      const height = this.$store.state.common.lastHeight
-      return Number(height) || 0 // 确保是数字类型
+    safeHeight () {
+      const safeHeight = this.$store.state.common.safeHeight
+      return Number(safeHeight) || 0 // 确保是数字类型
+    },
+    positionsArr () {
+      const positionsArr = this.$store.state.common.positionsArr
+      return positionsArr || [] // 确保是数字类型
     },
     filteredTabs () {
       // rejection_and_draft 权限控制“已驳回”和“草稿”tab
@@ -992,15 +997,22 @@
           const maxItem = checkedList.reduce((max, item) => {
             return item.drone_height > max.drone_height ? item : max;
           });
-          console.log(maxItem.drone_height, '高度');
-          console.log(this.lastHeight, '最后一点高度');
-          let result = _.round((maxItem.drone_height + this.form.rth_altitude), 2);
+          // 返航绝对高度
+          let backHeight = this.form.rth_altitude // + maxItem.drone_height
+          console.log(backHeight,'backHeight')
+          // 安全起飞高度
+          let positions = this.positionsArr
+          positions.unshift({latitude: maxItem.latitude, longitude: maxItem.longitude, height:maxItem.drone_height })
+          positions.push({latitude: maxItem.latitude, longitude: maxItem.longitude, height:maxItem.drone_height})
+          let resultHeight = 0
+          await getWaylineMaxTerrainHeight(positions).then(res => {
+            resultHeight = this.safeHeight > (res.data.data + 30) ? this.safeHeight : (res.data.data + 30)
+          })
+          let valueHeight = _.round(backHeight - resultHeight, 2)
+          console.log('打印比较值', valueHeight)
 
-          let resultHeight = this.lastHeight - maxItem.drone_height
-          let resultH = _.round(resultHeight, 2)
-
-          if (this.lastHeight > result) {
-            this.$confirm(`当前返航高度存在安全隐患,建议调整为${resultH}米以上后进行发布`, '提示', {
+          if (valueHeight < 0) {
+            this.$confirm(`当前返航高度存在安全隐患,建议调整为${resultHeight}米以上后进行发布`, '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning'

--
Gitblit v1.9.3