无人机管理后台前端(已迁走)
chenyao
2025-09-30 4809afba10333e1e911c795d28b8c68fb364d593
feat:完成飞行日志和马上智飞功能
2 files modified
185 ■■■■■ changed files
src/views/flightLog/flightLog.vue 52 ●●●●● patch | view | raw | blame | history
src/views/tickets/orderLog.vue 133 ●●●●● patch | view | raw | blame | history
src/views/flightLog/flightLog.vue
@@ -68,9 +68,10 @@
            </el-select>
          </template>
        </el-table-column>
                <el-table-column label="操作" width="300" align="center">
                <el-table-column label="操作" width="340" align="center">
                    <template #default="scope">
            <el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button>
            <el-button icon="el-icon-view" type="text" v-if="!scope.row.isHL" @click="handleWarnInfo(scope.row)">警告</el-button>
                        <el-button icon="el-icon-delete" type="text" @click="handleDelete(scope.row)">删除</el-button> 
            <el-button type="text" @click="handleStar(scope.row)">
              <el-icon><Star /></el-icon>
@@ -108,6 +109,18 @@
    <!-- </div> -->
    </div>
    </el-dialog>
  <el-dialog class="ztzf-dialog" append-to-body v-model="isShowWarnView" title="查看警告信息" :width="pxToRem(1000)" :close-on-click-modal="false" :destroy-on-close="true">
    <el-table border :data="warningList" height="300">
      <el-table-column label="序号" type="index" width="60"></el-table-column>
      <el-table-column prop="warn_info" label="内容" align="center" show-overflow-tooltip></el-table-column>
    </el-table>
    <template #footer>
        <span class="dialog-footer">
          <el-button @click="isShowWarnView = false">取 消</el-button>
          <el-button type="primary" @click="hlSubmit">忽略</el-button>
        </span>
    </template>
  </el-dialog>
</template>
<script setup>
import { getHistoryTrack, cancelStar, addStar, updateDroneFlight, droneFlightLogInfoPage } from '@/api/logs';
@@ -115,6 +128,7 @@
import { downloadXls } from '@/utils/util';
import { exportBlob } from '@/api/common'
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
import { dateNow } from '@/utils/date';
const total = ref(0)
let rangTime = ref([])
@@ -131,6 +145,8 @@
let tableList = ref([])
let isShowView = ref(false)
let isShowWarnView = ref(false)
let warningList = ref([])
let tabType = ref('全部')
@@ -163,8 +179,24 @@
    23, 59, 59
  ).getTime() : ''
  getHistoryTrack(params.value).then(res => {
    tableList.value = res.data.data.list || []
    tableList.value = res.data.data.list.map(item => {
      return {
        ...item,
        isHL: false,
        children: [{
          id: item.id,
          time: timeFormatConvert(dateNow()),
          warn_info: '您今天误操作,今后请注意!'
        },
          {
            id: item.id,
            time: timeFormatConvert(dateNow()),
            warn_info: '您今天误操作,今后请注意!'
          }],
      }
    })
    total.value = res.data.data.pagination.total || 0
  })
}
@@ -192,6 +224,22 @@
    detailTotal.value = res.data.data.total
  })
}
// 警告信息
let saveId = ref('')
function handleWarnInfo(row) {
  isShowWarnView.value = true
  saveId.value = row.id
  warningList.value = tableList.value.find(item => item.id === row.id).children
}
function hlSubmit() {
  // 设置isHL为true
  tableList.value.map(item => {
    if (item.id === saveId.value) {
      item.isHL = true
      isShowWarnView.value = false
    }
  })
}
// 分页
function handleSizeChangeDetails(val) {
  detailParams.value.size = val
src/views/tickets/orderLog.vue
@@ -183,6 +183,9 @@
              <el-button type="success" plain icon="el-icon-download" @click="exportData"
                >导出</el-button
              >
              <el-button type="primary" plain icon="el-icon-plus" @click="moreAdd"
              >批量添加</el-button
              >
            </template>
            <template #menu="{ row }">
@@ -806,6 +809,69 @@
        </el-row>
      </el-form>
    </el-dialog>
    <el-dialog class="ztzf-dialog" append-to-body v-model="moreAddVisible" title="批量添加" :width="pxToRem(1200)" :close-on-click-modal="false" :destroy-on-close="true">
      <el-button type="primary" plain icon="el-icon-plus" @click="addMoreData" style="margin-bottom: 10px;"></el-button>
      <el-table border :data="moreDataList" height="400">
        <el-table-column label="序号" type="index" width="60"></el-table-column>
        <el-table-column prop="name" label="工单名称" align="center">
          <template #default="scope">
            <el-input v-model="scope.row.name"></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="end_time" label="选择航线" align="center">
          <template #default="scope">
            <el-select
              v-model="scope.row.file_id"
              placeholder="请选择航线"
              filterable
              @change="getFlyingNestBy"
            >
              <el-option
                v-for="item in wayLineList"
                :key="item.wayline_id"
                :label="item.name"
                :value="item.wayline_id"
              />
            </el-select>
          </template>
        </el-table-column>
        <el-table-column prop="end_time" label="选择机巢" align="center">
          <template #default="scope">
            <el-select
              v-model="scope.row.device_sns"
              placeholder="请选择机巢"
            >
              <el-option label="赣县-夏谭机场" value="赣县-夏谭机场" />
              <el-option label="江西融媒" value="江西融媒" />
              <el-option label="广盈机场" value="广盈机场" />
              <el-option label="桃花街道" value="桃花街道" />
              <el-option label="南昌机场一代1" value="南昌机场一代1" />
            </el-select>
          </template>
        </el-table-column>
        <el-table-column prop="time" label="创建日期" align="center">
          <template #default="scope">
            <el-date-picker v-model="scope.row.time" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择日期" style="width: 200px;" />
          </template>
        </el-table-column>
        <el-table-column label="描述" prop="remark">
          <template #default="scope">
            <el-input v-model="scope.row.remark"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="100">
          <template #default="scope">
            <el-button icon="el-icon-delete" type="text" @click="handleDelete(scope.$index)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="moreAddVisible = false">取 消</el-button>
          <el-button type="primary" @click="saveSubmit">保存</el-button>
        </span>
      </template>
    </el-dialog>
  </basic-container>
</template>
@@ -1011,6 +1077,8 @@
        currentPage: 1,
        total: 0,
      },
      moreDataList: [],
      moreAddVisible: false,
      dialogVisible: false,
      detailVisible: false,
      currentDetail: {},
@@ -1396,6 +1464,71 @@
      this.asyncgetWaylineFileListByArea();
    },
    // 批量添加
    moreAdd() {
      this.moreDataList = []
      this.moreAddVisible = true;
    },
    addMoreData() {
      this.moreDataList.push({
        name: '',
        file_id: '',
        device_sns: '',
        time: '',
        remark: ''
      })
    },
    // 删除
    handleDelete(index) {
      if (this.moreDataList.length > 0) {
        this.moreDataList.splice(index, 1)
      }
    },
    // 批量保存
    saveSubmit() {
      // tableData复制5条数据
      if (this.moreDataList.length === 0) {
        this.$message.warning('请添加数据');
        return
      }
      let bfList = []
      this.moreDataList.map((item, index) => {
        bfList.push({
            $cellEdit:false,
            $index:5,
            ai_type_str:'道路裂缝',
            area_code: `360113000000${index}`,
            begin_time:"2025/09/27 18:08",
            content:item.remark,
            create_time:item.time,
            create_user:"1971102860644016129",
            creator_name:"权限测试账号",
            cycle_time_value:"2025/09/27 2025/09/28 每天 18:08",
            dept_name: item.device_sns,
            device_names: item.device_sns,
            device_sns:['8UUXN5M00A08ZD'],
            end_time:"2025/09/28",
            execute_time_arr: ['1758967680', '1759054080'],
            file_id:"47825a57-e376-427e-8ed1-8bc94c27b9cf",
            id: index,
            industry_type_str:"综合类",
            job_info_num:"36011320250927031",
            latitude:28.692045732105385,
            longitude:115.85282499919674,
            name: item.name,
            reason:"",
            remark:item.remark,
            rep_fre_type:"每天",
            status:1,
            status_str:"待审核",
            wayline_job_info_id: index,
        })
      })
      // 把备份的数据加入tableData 中
      this.tableData = [...this.tableData, ...bfList]
      this.page.total = this.tableData.length + bfList.length
      this.moreAddVisible = false;
    },
    resetForm() {
      this.form = {
        name: '',