无人机管理后台前端(已迁走)
张含笑
2025-10-25 39abebc6d54083556a393441e0628bc3d93b46c7
Merge remote-tracking branch 'origin/feature/v7.0/7.0.2' into feature/v7.0/7.0.2
4 files modified
101 ■■■■ changed files
src/hooks/common.js 52 ●●●●● patch | view | raw | blame | history
src/hooks/useRouteLine/useRouteLine.js 1 ●●●● patch | view | raw | blame | history
src/views/algorithmRepository/algorithmRepository.vue 5 ●●●●● patch | view | raw | blame | history
src/views/tickets/orderLog.vue 43 ●●●● patch | view | raw | blame | history
src/hooks/common.js
@@ -26,14 +26,17 @@
    if (!placemark?.length) return []
    const isWGS84 = execute_height_mode === 'WGS84'
    const list = placemark.map(item => {
        const [longitude, latitude] = item.point.coordinates.trim().split(',')
        const [longitude, latitude] = item.point.coordinates.trim().split(',').map(i => _.round(i, 6))
        const [latitude1, longitude1] = (item?.waypoint_heading_param?.waypoint_poi_point?.trim()?.split(',') || [])
            .map(i => _.round(i, 6))
        let action_modes = item?.action_group?.action || []
        action_modes = Array.isArray(action_modes) ? action_modes : [action_modes]
        return {
            longitude: _.round(longitude, 8),
            latitude: _.round(latitude, 8),
            height: isWGS84 ? item.execute_height : item.execute_height + startPoint.height,
            longitude,
            latitude,
            height: _.round(item.execute_height,2),
            waypoint_speed: item.waypoint_speed,
            waypoint_poi_point: longitude1 ? { longitude: longitude1, latitude: latitude1 } : undefined,//兴趣点
            action_modes,
        }
    })
@@ -42,9 +45,6 @@
        flyRotateYaw: 0,
        pointType: 'start',
        waypoint_speed: auto_flight_speed,
        heading: 0, // 椎体 heading
        arrowHeading: 0, // 飞行器 heading
        pitch: 0, //椎体俯仰角
        fov: 19.5, // 这个是椎体的展示截面大小
    }
    list.forEach(item => {
@@ -56,7 +56,6 @@
                item1.action_actuator_func_param.focal_length = Number(focal_length) / 24
            }
        })
        item.arrowHeading = 0
    })
    return [pointStart, ...list]
}
@@ -69,6 +68,7 @@
    const waylinesXMLJSON = XMLToJSON(waylinesXML)?.['Document']
    const templateXMLObj = camelToSnake(removeTextKey(templateXMLJSON))
    const waylinesXMLObj = camelToSnake(removeTextKey(waylinesXMLJSON))
    const {
        mission_config: {
            take_off_ref_point,
@@ -77,12 +77,16 @@
        folder: {
            payload_param: { image_format } = {},
            placemark: {
                polygon
                polygon,
                margin: buffer_distance_meters = 0
            },
            wayline_coordinate_sys_param:{height_mode} = {},
            global_height, auto_flight_speed,
            template_type: templateType
        } = {},
    } = templateXMLObj
    const [latitude, longitude, height] = take_off_ref_point.split(',').map(item => _.round(item, 6))
    let startPoint = { latitude, longitude, height: Number.isNaN(height) ? 0 : height }
    const {
        mission_config: { take_off_security_height } = {},
@@ -98,14 +102,9 @@
        execute_height_mode = polygonPointFolder.execute_height_mode
        pointPlacemark = polygonPointFolder.placemark
    }
    const [latitude, longitude, height] = take_off_ref_point.split(',').map(item => _.round(item, 6))
    let startPoint = { latitude, longitude, height }
    // 取出点位
    const coordinates = polygon?.outer_boundary_is.linear_ring
        .coordinates?.split('\n') || []
    // 数组转换
    let polygonList = coordinates.map((coordinate) =>
        coordinate
@@ -113,9 +112,21 @@
            .split(',')
            .map((v) => Number(v)),
    )
    polygonList.pop()
    const templatePlacemark = templateXMLObj.folder.placemark
    // 点航线list
    let pointList = handlePointListForKmz({
        placemark: polygonPointFolder.placemark,
        startPoint,
        execute_height_mode,
        auto_flight_speed
    }).map((i,index)=> {
        // 注入是否使用全局高度参数
        return {
            ...i,
            use_global_height: index > 0 ? templatePlacemark[index-1]?.use_global_height : 0
        }
    })
    return {
        image_format,
        startPoint,
@@ -124,11 +135,14 @@
        take_off_ref_point,
        drone_enum_value,
        drone_sub_enum_value,
        take_off_security_height,
        execute_height_mode,
        take_off_security_height,//起飞安全高度
        execute_height_mode,//执行高度模式
        height_mode,//高度模式
        pointList,//航点航线 点list
        templateType,
        pointPlacemark,
        polygonList
        polygonList,
        buffer_distance_meters
    }
}
src/hooks/useRouteLine/useRouteLine.js
@@ -195,6 +195,7 @@
            },
        })
        // 获取最后一点高度
        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)]),
src/views/algorithmRepository/algorithmRepository.vue
@@ -55,7 +55,6 @@
            </div>
          </div>
          <div class="search-btn">
            <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
            <el-button icon="el-icon-delete" @click="handleReset">清空</el-button>
            <el-button type="primary" icon="el-icon-back" @click="goback">返回</el-button>
@@ -365,7 +364,7 @@
  }
  .search {
    display: flex;
    justify-content: space-between;
    //justify-content: space-between;
  }
  .searchBox {
    display: flex;
@@ -381,7 +380,7 @@
    .item {
      display: flex;
      align-items: center;
      margin-right: 49px;
      margin-right: 40px;
    }
  }
  .search-btn {
src/views/tickets/orderLog.vue
@@ -320,7 +320,7 @@
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="安全返航真高" prop="rth_altitude">
            <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
              <el-input-number
                v-model="form.rth_altitude"
                :min="50"
@@ -490,7 +490,7 @@
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
          <el-col :span="6">
            <el-form-item label="关联航线" prop="file_id">
              <el-select
                v-model="form.file_id"
@@ -506,6 +506,16 @@
                  :value="item.wayline_id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <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>
            </el-form-item>
          </el-col>
        </el-row>
@@ -711,7 +721,7 @@
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
          <el-col :span="6">
            <el-form-item label="关联航线" prop="file_id">
              <el-select v-model="form.file_id" placeholder="请选择航线" :disabled="true">
                <el-option
@@ -721,6 +731,16 @@
                  :value="item.wayline_id"
                />
              </el-select>
            </el-form-item>
          </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-form-item>
          </el-col>
        </el-row>
@@ -1310,11 +1330,15 @@
          const maxItem = this.device_sns.reduce((max, item) => {
            return item.drone_height > max.drone_height ? item : max;
          });
          console.log(maxItem, '高度');
          console.log(maxItem.drone_height, '高度');
          console.log(this.lastHeight, '最后一点高度');
          let result = _.round((maxItem.drone_height + this.form.rth_altitude), 2);
          let resultHeight = this.lastHeight - maxItem.drone_height
          let resultH = _.round(resultHeight, 2)
          if (this.lastHeight > result) {
            this.$confirm(`安全返航真高${result}米低于航线返航点高度${this.lastHeight}米,为确保返航路径安全,建议您进行调整后再发布`, '提示', {
            this.$confirm(`当前返航高度存在安全隐患,建议调整为${resultH}米以上后进行发布`, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
@@ -1947,6 +1971,15 @@
  justify-content: center;
}
.safe-height {
  :deep(.el-form-item__label) {
    width: 120px !important;
  }
  :deep(.el-input-number) {
    width: 180px !important;
  }
}
.flex {
  display: flex;
}