无人机管理后台前端(已迁走)
罗广辉
2025-12-05 ac04d6c2bdd933609818872e6e840ec5184e9634
Merge branch 'feature/v9.0/9.0.1' into test

# Conflicts:
# src/views/job/components/DeviceJobDetails.vue
7 files modified
151 ■■■■■ changed files
src/views/device/airport.vue 104 ●●●●● patch | view | raw | blame | history
src/views/job/components/DeviceJobDetails.vue 12 ●●●● patch | view | raw | blame | history
src/views/job/components/JobRelatedEvents.vue 8 ●●●● patch | view | raw | blame | history
src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue 4 ●●●● patch | view | raw | blame | history
src/views/layerManagement/components/leftList.vue 2 ●●● patch | view | raw | blame | history
src/views/tickets/component/AddEditDetails.vue 11 ●●●● patch | view | raw | blame | history
src/views/tickets/orderLogCopy.vue 10 ●●●● patch | view | raw | blame | history
src/views/device/airport.vue
@@ -299,6 +299,7 @@
      rollFirmVersion: '',
      firmList: [],
      rollFirmwareBox: false,
      isUpdateDrone: {},
      // 用于记录已经创建的websocket,防止重复创建
      webSocketIdSet: new Set(),
      // 用于保存多组websocket
@@ -410,6 +411,46 @@
            ],
          },
          {
            label: '设备状态',
            prop: 'mode_code',
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            labelWidth: 145,
            searchSpan: 4,
            search: true,
            type: 'select',
            dicData: [
              { label: '在线', value: 0 },
              { label: '离线', value: -1 },
              { label: '远程调试', value: 2 },
              { label: '现场调试', value: 1 },
              { label: '固件升级中', value: 3 }
            ],
            slot: true,
            width: 110,
            rules: [
              {
                required: true,
                message: '请输入机场状态',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '固件升级',
            prop: 'firmware_status',
            labelWidth: 145,
            width: 100,
            // hide: true,
            viewDisabled: true,
            addDisabled: true,
            editDisplay: false, //编辑显示
            addDisplay: false,
            viewDisplay: false,
          },
          {
            label: '4G增强',
            prop: 'link_workmode',
            labelWidth: 145,
@@ -503,46 +544,7 @@
            labelWidth: 145,
            width: 110,
          },
          {
            label: '设备状态',
            prop: 'mode_code',
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            labelWidth: 145,
            searchSpan: 4,
            search: true,
            type: 'select',
            dicData: [
              { label: '在线', value: 0 },
              { label: '离线', value: -1 },
              { label: '远程调试', value: 2 },
              { label: '现场调试', value: 1 },
              { label: '固件升级中', value: 3 }
            ],
            slot: true,
            width: 110,
            rules: [
              {
                required: true,
                message: '请输入机场状态',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '固件升级',
            prop: 'firmware_status',
            labelWidth: 145,
            width: 100,
            // hide: true,
            viewDisabled: true,
            addDisabled: true,
            editDisplay: false, //编辑显示
            addDisplay: false,
            viewDisplay: false,
          },
          {
            label: '设备SN',
            prop: 'device_sn',
@@ -876,6 +878,9 @@
        return
      }
      console.log(loadData.data.output.progress.percent, '6666')
      // if(loadData.data.output.progress.percent < 10) {
      //   this.onLoad(this.page)
      // }
      this.data.forEach((e, index) => {
        if ((e.device_sn == loadData.data.sn || e.child_sn == loadData.data.sn) && loadData.data.output.status == 'in_progress') {
          e.firmware_progress = loadData.data.output.progress.percent
@@ -1008,6 +1013,7 @@
    },
    // 版本回退点击事件
    rollFirmware(row) {
      console.log(this.data,row, '打印看看值')
      if (row.status == 0) {
        this.$message({
          type: 'warning',
@@ -1027,6 +1033,7 @@
      }
      var that = this
      this.rollFirmwareBox = true
      this.isUpdateDrone = row
      const param = {
        device_name: row.device_name,
      }
@@ -1132,6 +1139,7 @@
          // 需要改变的版本号和无人机版本号如果是一致,进行单独的机场升级/回滚操作
        }
      }
      ota(that.firmwareInfo.workspaceId, arr).then(res => {
        that.firmwareVersion = ''
        that.firmwareInfo = {}
@@ -1140,7 +1148,24 @@
          type: 'success',
          message: '操作成功!',
        })
        // 此处需分是无人机升级还是机巢升级版本
        console.log('看看是无人机更新还是机场更新',that.isUpdateDrone)
        if(that.isUpdateDrone.domain == 3) {
        this.onLoad(this.page)
        } else {
          console.log(111)
          this.data.map(item => {
            if(item.workspace_id === that.isUpdateDrone.workspace_id) {
              item.firmware_status = 2
              item.mode_code = 3
              item.children[0].mode_code = 0
              item.children[0].firmware_status = 4
              this.connectWebSocket(item)
              console.log('无人机更新中',item)
            }
          })
        }
        // 获取保存的 resolve 函数===== 此处需要更新子集塞入父级
        // done()
      })
    },
@@ -1461,6 +1486,7 @@
          ...item,
          firmware_progress: 0
        }));
        console.log('2222',this.data)
        this.loading = false
        this.selectionClear()
      })
src/views/job/components/DeviceJobDetails.vue
@@ -236,9 +236,9 @@
// 任务成果
const total = ref(0)
const achievementList = ref([])
const props = defineProps(['wayLineJodInfoId', 'waylineJobId', 'batchNo','jobId'])
const wayLineJodInfoId = computed(() => props.wayLineJodInfoId)
provide('wayLineJodInfoId', wayLineJodInfoId)
const props = defineProps(['wayLineJobInfoId', 'waylineJobId', 'batchNo','jobId'])
const wayLineJobInfoId = computed(() => props.wayLineJobInfoId)
provide('wayLineJobInfoId', wayLineJobInfoId)
// 可见数量
const visibleCount = computed(() =>
    showAll.value ? achievementList.value.length : Math.min(5, achievementList.value.length)
@@ -276,7 +276,7 @@
const jobTimes = ref([])
const getDetails = () => {
    const params = {
        wayLineJobInfoId: props.wayLineJodInfoId,
    wayLineJobInfoId: props.wayLineJobInfoId,
        waylineJobId: props.waylineJobId,
        batchNo: props.batchNo
    }
@@ -285,8 +285,8 @@
        jobTimes.value = res.data.data.job_times
        infoList.value.forEach(item => {
            if (item.name === '任务频次') {
                const { rep_rule_type = '', rep_rule_val = '' } = detailsData?.value || {}
                item.value = rep_rule_type + ' -- ' + rep_rule_val
        const { rep_rule_type = '',final_cycle_frequency = '' } = detailsData?.value || {}
        item.value = rep_rule_type ? final_cycle_frequency : '1次'
            } else {
                item.value = detailsData.value?.[item.field] || '--'
            }
src/views/job/components/JobRelatedEvents.vue
@@ -106,7 +106,7 @@
const loading = ref(false)
const list = ref()
const params = ref({
    way_line_jod_info_id: null,
    way_line_job_info_id: null,
    event_name: '',
    ai_types: [], // 算法类型
    start_date: null,
@@ -133,11 +133,11 @@
      },
    });
}
const wayLineJodInfoId = inject('wayLineJodInfoId')
const wayLineJobInfoId = inject('wayLineJobInfoId')
const getList = () => {
    if (!wayLineJodInfoId.value) return
    params.value.way_line_jod_info_id = wayLineJodInfoId.value
    if (!wayLineJobInfoId.value) return
    params.value.way_line_job_info_id = wayLineJobInfoId.value
    params.value.batchNo = props.batchNo
    loading.value = true
    getDeviceEventList(params.value, sizeParams.value).then(res => {
src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -100,10 +100,10 @@
    <!-- <CurrentTaskDetails
        v-if="isShowCurrentTaskDetails"
        v-model:show="isShowCurrentTaskDetails"
        :wayLineJodInfoId="rowData.id"
        :wayLineJobInfoId="rowData.id"
    /> -->
    <!-- 历史任务详情 -->
    <DeviceJobDetails v-if="isShowDeviceJobDetails" v-model:show="isShowDeviceJobDetails" :wayLineJodInfoId="rowData.id"
    <DeviceJobDetails v-if="isShowDeviceJobDetails" v-model:show="isShowDeviceJobDetails" :wayLineJobInfoId="rowData.id"
        :batchNo="rowData.batch_no" :jobId="jobId"/>
    <CancelTaskDialog ref="cancelTaskDialogRef" v-model:isShowCancelTask="isShowCancelTask" :row-data="rowData"
        @refresh="getJobList" />
src/views/layerManagement/components/leftList.vue
@@ -125,7 +125,7 @@
const gettreeDataApi = async () => {
  try {
    loading.value = true;
    const res = await treeDataApi();
    const res = await treeDataApi({filterExpired:false});
    treeAllData.value = res.data.data;
    if(coverData.value.length===0){
       checkedKeys.value = [];
src/views/tickets/component/AddEditDetails.vue
@@ -47,10 +47,11 @@
          </el-col>
          <el-col :span="6">
            <el-form-item label="关联航线" prop="file_id">
              <el-select v-model="formParams.file_id" placeholder="请选择航线" filterable @change="getFlyingNest" :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'">
              <el-select v-if="txtTitle === '新建工单'" v-model="formParams.file_id" placeholder="请选择航线" filterable @change="getFlyingNest">
                <el-option v-for="item in lineList" :key="item.wayline_id" :label="item.name"
                           :value="item.wayline_id" />
              </el-select>
              <el-input v-else v-model="formParams.wayline_file_region_vo.name" :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
@@ -292,10 +293,11 @@
// initMapLine 方法
const initMapLine = async (infos = {}, cb = () => {}) => {
  const currentLine = lineList.value.find(item => item.wayline_id == formParams.value.file_id)
  let currentLine = lineList.value.find(item => item.wayline_id == formParams.value.file_id)
  if (!currentLine) return
  if (!currentLine) {
    currentLine = formParams.value.wayline_file_region_vo
  }
  await nextTick()
  if (mapContainerRef.value?.initAddEntity) {
@@ -445,7 +447,6 @@
    formParams.value = {
      ...data
    }
    console.log(formParams.value, '898789')
    drone_sns.value = data.device_list
    initMapLine(data.device_map_infos)
  } else {
src/views/tickets/orderLogCopy.vue
@@ -993,10 +993,10 @@
              return this.$message.warning('任务时间不能小于当前时间')
            }
          }
          let checkedList = this.device_sns.filter(item => this.form.device_sns.includes(item.device_sn));
          let checkedList = this.device_sns.filter(item => this.form.device_sns.includes(item.device_sn))
          const maxItem = checkedList.reduce((max, item) => {
            return item.drone_height > max.drone_height ? item : max;
          });
            return item.drone_height > max.drone_height ? item : max
          })
          // 返航绝对高度
          let backHeight = this.form.rth_altitude // + maxItem.drone_height
          console.log(backHeight,'backHeight')
@@ -1200,7 +1200,7 @@
      }
      // 更新机巢列表
      this.device_sns = data.device_map_infos;// data.device_list;
      this.device_sns = data.device_map_infos// data.device_list;
      this.permission &&
      (this.permission.order_log_review || this.permission.order_log_recall) &&
      (data.status == 1 || data.status == 3 ||  (data.status == 2 && this.userInfo.user_id !== this.form.create_user))
@@ -1362,7 +1362,7 @@
        const currentLine = that.wayLineList.find(item => item.wayline_id === waylineId)
        //按照航线来
        const params = {
          type: ['2', '4', '5'].includes(currentLine.wayline_type) ? 2 : 0,
          type: ['2', '4', '5', '7', '8', '9', '10'].includes(currentLine.wayline_type) ? 2 : 0,
          wayline_id: waylineId,
          polygon
        }