无人机管理后台前端(已迁走)
罗广辉
2025-12-05 f177ca08c2d768048735548013df69f622b40b6c
Merge remote-tracking branch 'origin/feature/v9.0/9.0.1' into feature/v9.0/9.0.1
1 files modified
103 ■■■■ changed files
src/views/tickets/component/AddEditDetails.vue 103 ●●●● patch | view | raw | blame | history
src/views/tickets/component/AddEditDetails.vue
@@ -1,15 +1,22 @@
<template>
  <el-dialog class="ztzf-dialog-mange" modal-class="add-edit-details" v-model="isShowAddEditDetails" :title="txtTitle"
    width="70%" :close-on-click-modal="false" :destroy-on-close="true" @close="cancel"
    :before-close="handleBeforeClose">
  <el-dialog
    class="ztzf-dialog-mange"
    modal-class="add-edit-details"
    v-model="isShowAddEditDetails"
    :title="txtTitle"
    width="70%"
    :close-on-click-modal="false"
    :destroy-on-close="true"
    @close="cancel"
    :before-close="handleBeforeClose"
  >
    <div class="add-edit-details">
      <div class="process" v-if="txtTitle !== '新建工单'">
        <div class="order_title">{{ formParams.name }}</div>
        <div class="custom-steps-container">
          <!-- 标题行 -->
          <div class="steps-titles">
            <div class="step-title" v-for="(record, index) in formParams.record_list"
              :class="{ active: record.user_id >= 0 }" :key="index">
            <div class="step-title" v-for="(record, index) in formParams.record_list" :class="{ active: record.user_id >= 0 }" :key="index">
              {{ record.status_str }}
            </div>
          </div>
@@ -35,42 +42,36 @@
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="工单名称" prop="name">
              <el-input v-model="formParams.name" placeholder="请输入工单名称" maxlength="100" show-word-limit
                :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input>
              <el-input v-model="formParams.name" placeholder="请输入工单名称" maxlength="100" show-word-limit :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input>
            </el-form-item>
          </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">
            <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
              <el-input-number v-model="formParams.rth_altitude" :min="50" :max="500"
                :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input-number>
              <el-input-number v-model="formParams.rth_altitude" :min="50" :max="500" :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="关联机巢" prop="device_sns">
              <el-select v-model="formParams.device_sns" placeholder="请选择机巢" multiple
                :disabled="(txtTitle === '工单审核' || txtTitle === '工单详情')">
                <el-option v-for="item in drone_sns" :key="item.device_sn" :label="item.nickname"
                  :value="item.device_sn" />
              <el-select v-model="formParams.device_sns" placeholder="请选择机巢" multiple :disabled="(txtTitle === '工单审核' || txtTitle === '工单详情')">
                <el-option v-for="item in drone_sns" :key="item.device_sn" :label="item.nickname" :value="item.device_sn" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="关联算法" prop="ai_types">
              <el-select v-model="formParams.ai_types" placeholder="请选择关联算法" multiple
                :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'">
                <el-option v-for="item in aiTypeList" :key="item.dictKey" :label="item.dictValue"
                  :value="item.dictKey" />
              <el-select v-model="formParams.ai_types" placeholder="请选择关联算法" multiple :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'">
                <el-option v-for="item in aiTypeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
              </el-select>
            </el-form-item>
          </el-col>
@@ -79,8 +80,7 @@
        <el-row :gutter="20">
          <el-col :span="12" v-if="txtTitle === '新建工单'">
            <el-form-item label="工单内容" prop="content">
              <el-input type="textarea" v-model="formParams.content" rows="4" placeholder="请输入工单内容" maxlength="255"
                show-word-limit :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input>
              <el-input type="textarea" v-model="formParams.content" rows="4" placeholder="请输入工单内容" maxlength="255" show-word-limit :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input>
            </el-form-item>
          </el-col>
@@ -92,20 +92,26 @@
          <el-col :span="7">
            <el-form-item label="周期频次" prop="date_range">
              <el-date-picker :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'" v-model="formParams.date_range"
                type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
              <el-date-picker :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"
                              v-model="formParams.date_range"
                              type="daterange"
                              range-separator="至"
                              start-placeholder="开始日期"
                              end-placeholder="结束日期"
                :disabled-date="disabledDate" />
            </el-form-item>
          </el-col>
          <el-col :span="2">
            <el-select v-model="formParams.rep_fre_type" placeholder="请选择频次"
              :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'">
            <el-select v-model="formParams.rep_fre_type" placeholder="请选择频次" :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'">
              <el-option v-for="item in weeks" :key="item" :label="item" :value="item" />
            </el-select>
          </el-col>
          <el-col :span="3">
            <el-time-picker :style="{ width: pxToRem(140) }" v-model="formParams.deal_time"
              :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'" prop="deal_time" value-format="HH:mm"
            <el-time-picker :style="{ width: pxToRem(140) }"
                            v-model="formParams.deal_time"
                            :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"
                            prop="deal_time"
                            value-format="HH:mm"
              :picker-options="{ selectableRange: '00:00 - 23:59' }" />
          </el-col>
        </el-row>
@@ -135,10 +141,12 @@
    </template>
    <template #footer v-if="txtTitle === '工单审核'">
      <div class="dialog-footer">
        <el-button type="primary" v-if="formParams.status == 1 && permission.orderLogpass"
        <el-button type="primary"
                   v-if="formParams.status == 1 && permission.orderLogpass"
          @click="orderPass(formParams.id)">通过
        </el-button>
        <el-button type="danger" v-if="formParams.status == 1 && permission.rejection_btn"
        <el-button type="danger"
                   v-if="formParams.status == 1 && permission.rejection_btn"
          @click="orderReject(formParams.id)">驳回
        </el-button>
        <el-button @click="cancel" icon="el-icon-circle-close">取消</el-button>
@@ -158,7 +166,7 @@
<script setup>
import { pxToRem, pxToRemNum } from '@/utils/rem'
import { ref, shallowRef, onMounted, computed } from 'vue'
import { ref, shallowRef, onMounted, computed } from 'vue';
import { newGetWorkspacesPage } from '@/api/resource/wayline'
import { getDictionaryByCode } from '@/api/system/dictbiz'
import { getFlyingNestBy } from '@/api/device/device'
@@ -168,21 +176,21 @@
  orderLogPass,
  orderLogReject,
  orderLogRecall, getWaylineMaxTerrainHeight
} from '@/api/tickets/orderLog'
} from '@/api/tickets/orderLog';
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn' // 导入中文语言包
import _ from 'lodash'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus';
import weekday from 'dayjs/plugin/weekday'
dayjs.extend(weekday)
dayjs.locale('zh-cn')
import { useStore } from 'vuex'
const emit = defineEmits(['refresh'])
const emit = defineEmits(['refresh']);
const store = useStore()
const userInfo = computed(() => store.state.user.userInfo)
const permission = computed(() => store.state.user.permission)
const permission = computed(() => store.state.user.permission);
// safeHeight 计算属性
const safeHeight = computed(() => {
@@ -261,7 +269,7 @@
  initMapLine({}, polygon => {
    const currentLine = lineList.value.find(item => item.wayline_id === waylineId)
    const params = {
      type: ['2', '4', '5', '7', '8', '9', '10'].includes(currentLine.wayline_type) ? 2 : 0,
      type: ['2', '4', '5'].includes(currentLine.wayline_type) ? 2 : 0,
      wayline_id: waylineId,
      polygon
    }
@@ -285,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) {
@@ -310,10 +319,10 @@
}
async function returnHeight () {
  let checkedList = drone_sns.value.filter(item => formParams.value.device_sns.includes(item.device_sn))
  let checkedList = drone_sns.value.filter(item => formParams.value.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 = formParams.value.rth_altitude // + maxItem.drone_height
  console.log(backHeight, 'backHeight')
@@ -345,10 +354,10 @@
          return ElMessage({ message: '任务时间不能小于当前时间', type: 'warning' })
        }
      }
      let checkedList = drone_sns.value.filter(item => formParams.value.device_sns.includes(item.device_sn))
      let checkedList = drone_sns.value.filter(item => formParams.value.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 = formParams.value.rth_altitude // + maxItem.drone_height
      console.log(backHeight, 'backHeight')
@@ -438,7 +447,6 @@
    formParams.value = {
      ...data
    }
    console.log(formParams.value, '898789')
    drone_sns.value = data.device_list
    initMapLine(data.device_map_infos)
  } else {
@@ -453,7 +461,7 @@
function cancel () {
  formParams.value = {}
  isShowAddEditDetails.value = false
  emit('refresh')
  emit('refresh');
}
// onMounted(async () => {
@@ -476,7 +484,6 @@
  .week_pc_one {
    flex: 1;
    .week-r {
      margin-right: 4px;
    }
@@ -485,7 +492,6 @@
      width: 100% !important;
    }
  }
  .process {
    .order_title {
      height: 30px;
@@ -495,7 +501,6 @@
      font-weight: bold;
      color: #333;
    }
    .custom-steps-container {
      width: 100%;
      margin: 7px 0;