无人机管理后台前端(已迁走)
chenyao
2025-09-25 8f1c3411eea739db54ba4940ee4bed7fdd67681a
src/views/monitor/log/flightLog.vue
File was renamed from src/views/flightLog/flightLog.vue
@@ -1,9 +1,9 @@
<!-- 飞行日志 -->
<template>
  <div class="flight">
    <div class="search-box">
    <div class="ztzf-search-mange">
      <el-form :model="params" inline>
        <div style="display: flex;justify-content: space-between">
        <div class="search-contain">
          <div>
            <el-form-item label="任务名称:">
              <el-input v-model="params.jobName" placeholder="请输入任务名称" clearable />
@@ -23,63 +23,58 @@
              />
            </el-form-item>
          </div>
          <div>
            <el-form-item>
              <el-button type="primary" @click="getList">搜索</el-button>
              <el-button @click="cancelSearch">清空</el-button>
            </el-form-item>
          <div class="btns">
            <el-button type="primary" @click="getList" :icon="Search">搜索</el-button>
            <el-button @click="cancelSearch" :icon="Delete">清空</el-button>
          </div>
        </div>
      </el-form>
      <!-- <div>
        <el-button :type="tabType === '全部'?'primary':'default'" @click="handleAll"><el-icon><Folder /></el-icon>全部</el-button>
        <el-button :type="tabType === '收藏'?'primary':'default'" @click="handleStartList"><el-icon><Star /></el-icon>我的收藏</el-button>
      </div> -->
    </div>
    <div class="mange-table">
      <el-tabs v-model="tabType" class="demo-tabs" @tab-click="handleTabClick">
        <el-tab-pane label="全部" name="全部"></el-tab-pane>
        <el-tab-pane label="我的收藏" name="收藏"></el-tab-pane>
        <el-table border :data="tableList" class="custom-header">
          <el-table-column label="序号" type="index" width="60"></el-table-column>
          <el-table-column prop="job_name" label="任务名称" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="job_info_num" label="任务编号" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="title" label="飞行类型" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="device_name" label="无人机" align="center"></el-table-column>
          <el-table-column prop="start_time" label="开始时间" align="center">
            <template #default="scope">
              {{ timeFormatConvert(scope.row.start_time) }}
            </template>
          </el-table-column>
          <el-table-column prop="end_time" label="结束时间" align="center">
            <template #default="scope">
              {{ timeFormatConvert(scope.row.end_time) }}
            </template>
          </el-table-column>
          <el-table-column prop="end_time" label="标签" align="center">
            <template #default="scope">
              <el-select v-model="scope.row.label_id" @change="handleUpdateLabel(scope.row)" clearable>
                <el-option
                  v-for="item in tagList"
                  :key="item.id"
                  :label="item.label_name"
                  :value="item.id"
                ></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="操作" width="300" align="center">
            <template #default="scope">
              <el-button icon="el-icon-view" type="text" @click="handleDetail(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>
                {{ scope.row.is_favorite ? '取消收藏':'收藏' }}</el-button>
              <el-button type="text" @click="handleExport(scope.row)"><el-icon><Download /></el-icon>导出</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-tabs>
<!--      <el-tabs v-model="tabType" class="demo-tabs" @tab-click="handleTabClick">-->
<!--        <el-tab-pane label="全部" name="全部"></el-tab-pane>-->
<!--        <el-tab-pane label="我的收藏" name="收藏"></el-tab-pane>-->
<!--        -->
<!--      </el-tabs>-->
      <el-table border :data="tableList" class="custom-header">
        <el-table-column label="序号" type="index" width="60"></el-table-column>
        <el-table-column prop="job_name" label="任务名称" align="center" show-overflow-tooltip></el-table-column>
        <el-table-column prop="job_info_num" label="任务编号" align="center" show-overflow-tooltip></el-table-column>
        <el-table-column prop="title" label="飞行类型" align="center" show-overflow-tooltip></el-table-column>
        <el-table-column prop="device_name" label="无人机" align="center"></el-table-column>
        <el-table-column prop="start_time" label="开始时间" align="center">
          <template #default="scope">
            {{ timeFormatConvert(scope.row.start_time) }}
          </template>
        </el-table-column>
        <el-table-column prop="end_time" label="结束时间" align="center">
          <template #default="scope">
            {{ timeFormatConvert(scope.row.end_time) }}
          </template>
        </el-table-column>
<!--        <el-table-column prop="end_time" label="标签" align="center">-->
<!--          <template #default="scope">-->
<!--            <el-select v-model="scope.row.label_id" @change="handleUpdateLabel(scope.row)" clearable>-->
<!--              <el-option-->
<!--                v-for="item in tagList"-->
<!--                :key="item.id"-->
<!--                :label="item.label_name"-->
<!--                :value="item.id"-->
<!--              ></el-option>-->
<!--            </el-select>-->
<!--          </template>-->
<!--        </el-table-column>-->
        <el-table-column label="操作" width="300" align="center">
          <template #default="scope">
            <el-button icon="el-icon-view" type="text" @click="handleDetail(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>-->
<!--              {{ scope.row.is_favorite ? '取消收藏':'收藏' }}</el-button>-->
            <el-button type="text" @click="handleExport(scope.row)"><el-icon><Download /></el-icon>导出</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="pagination">
@@ -115,6 +110,7 @@
import { downloadXls } from '@/utils/util';
import { exportBlob } from '@/api/common'
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
import { Delete, Search } from '@element-plus/icons-vue';
const total = ref(0)
let rangTime = ref([])
@@ -217,13 +213,13 @@
  getList()
}
function handleTabClick() {
  if (tabType.value === '全部') {
    handleAll()
  } else if (tabType.value === '收藏') {
    handleStartList()
  }
}
// function handleTabClick() {
//   if (tabType.value === '全部') {
//     handleAll()
//   } else if (tabType.value === '收藏') {
//     handleStartList()
//   }
// }
// 收藏
function handleStar(row) {
@@ -299,7 +295,7 @@
}
onMounted(() => {
  tagManageList()
  // tagManageList()
  getList()
})
</script>
@@ -314,9 +310,9 @@
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  .search-box {
    height: 30px;
  }
  //.search-box {
  //  height: 30px;
  //}
  :deep(.el-input) {
    .el-input__wrapper {