无人机管理后台前端(已迁走)
罗广辉
2025-10-11 02409bfbe15f22fc3b5dccadabfd860a660a49d9
src/views/flightLog/flightLog.vue
@@ -6,7 +6,7 @@
        <div style="display: flex;justify-content: space-between">
          <div>
            <el-form-item label="任务名称:">
            <el-input v-model="params.job_name" placeholder="请输入任务名称" clearable />
            <el-input v-model="params.jobName" placeholder="请输入任务名称" clearable />
          </el-form-item>
          <el-form-item label="任务编号:">
            <el-input v-model="params.jobInfoNum" placeholder="请输入任务编号" clearable />
@@ -41,7 +41,7 @@
        <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 label="序号" type="index" width="60" align="center"></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>
@@ -68,10 +68,11 @@
            </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-delete" type="text" @click="handleDelete(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>
              {{ scope.row.is_favorite ? '取消收藏':'收藏' }}</el-button>
@@ -81,7 +82,7 @@
         </el-table>
    </el-tabs>
      </div>
      <div class="pagination">
         <el-pagination class="ztzf-pagination" popper-class="custom-pagination-dropdown" background
            :page-sizes="[10, 20, 30, 40, 50, 100]" :size="size" v-model:current-page="params.page"
@@ -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" align="center"></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([])
@@ -124,13 +138,15 @@
  page_size: 10,
  startTime: '',
  endTime: '',
  job_name: '',
  jobName: '',
  jobInfoNum: '',
});
let tableList = ref([])
let isShowView = ref(false)
let isShowWarnView = ref(false)
let warningList = ref([])
let tabType = ref('全部')
@@ -148,7 +164,7 @@
    isFavorite: tabType.value === '收藏' ? true : false,
    page: '1',
    page_size: '10',
    job_name: '',
    jobName: '',
    jobInfoNum: '',
  }
  getList()
@@ -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
  })
}
@@ -190,6 +222,22 @@
  droneFlightLogInfoPage(detailParams.value).then(res => {
    tableDataDetails.value = res.data.data.records
    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
    }
  })
}
// 分页
@@ -346,23 +394,23 @@
      }
    }
  }
 .content {
  padding: 20px;
  .view-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #EBEEF5;
    tr {
      &:not(:last-child) {
        border-bottom: 1px solid #EBEEF5;
      }
      td {
        padding: 12px 10px;
        &.label {
          width: 140px;
          text-align: right;
@@ -370,7 +418,7 @@
          // background-color: #F5F7FA;
          border-right: 1px solid #EBEEF5;
        }
        &.value {
          width: 180px;
          // color: #303133;
@@ -386,7 +434,7 @@
      :deep(.el-form-item__label) {
        width: 120px;
      }
    }
    .btns {
        display: flex;
@@ -394,4 +442,4 @@
      }
  }
}
</style>
</style>