| | |
| | | </el-form> |
| | | |
| | | <div class="command-table-toolbar"> |
| | | <el-button :icon="Download" color="#1A2652" type="primary" @click="exportFile" :loading="exportLoading">导出</el-button> |
| | | <el-button |
| | | :icon="Download" |
| | | color="#1A2652" |
| | | type="primary" |
| | | @click="exportFile" |
| | | :loading="exportLoading" |
| | | :disabled="!selectionList.length" |
| | | > |
| | | 导出 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <div class="command-table-container" v-loading="loading" element-loading-background="rgba(5, 5, 15, 0.6)"> |
| | | <div class="command-table-content command-table-content-bg"> |
| | | <el-table class="command-table" :data="list"> |
| | | <el-table class="command-table" :data="list" ref="tableRef" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="48" /> |
| | | <el-table-column type="index" show-overflow-tooltip width="64" label="序号" /> |
| | | <el-table-column prop="droneName" show-overflow-tooltip width="140" label="无人机名称" /> |
| | | <el-table-column prop="serialNo" show-overflow-tooltip label="无人机序列号" /> |
| | |
| | | |
| | | <script setup> |
| | | import { Search, RefreshRight, Download } from '@element-plus/icons-vue' |
| | | import { onMounted, ref } from 'vue' |
| | | import { onMounted, ref, nextTick } from 'vue' |
| | | import { exportFwDroneFlightRecordApi, fwDroneFlightRecordPageApi } from './fwDroneFlightRecord' |
| | | import { blobDownload, dateRangeFormat } from '@ztzf/utils' |
| | | import TrajectoryDiaLog from '@/views/recordManage/historyTracks/TrajectoryDiaLog.vue' |
| | |
| | | const total = ref(0) // 总条数 |
| | | const loading = ref(true) // 列表加载中 |
| | | const list = ref([]) // 列表数据 |
| | | const tableRef = ref(null) |
| | | const selectionList = ref([]) |
| | | const queryParamsRef = ref(null) // 查询表单实例 |
| | | const dateRange = ref([]) |
| | | const exportLoading = ref(false) |
| | |
| | | const res = await fwDroneFlightRecordPageApi(params) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | selectionList.value = [] |
| | | await nextTick() |
| | | tableRef.value?.clearSelection() |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | |
| | | |
| | | function exportFile() { |
| | | const range = dateRangeFormat(dateRange.value) |
| | | const ids = selectionList.value.map(item => item.id).filter(Boolean) |
| | | exportLoading.value = true |
| | | exportFwDroneFlightRecordApi({ ...searchParams.value, start_time: range[0], end_time: range[1] }) |
| | | exportFwDroneFlightRecordApi({ |
| | | ...searchParams.value, |
| | | start_time: range?.[0], |
| | | end_time: range?.[1], |
| | | id: ids.join(','), |
| | | }) |
| | | .then(res => { |
| | | blobDownload(res) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | function handleSelectionChange(selection) { |
| | | selectionList.value = selection || [] |
| | | } |
| | | |
| | | function handleView(row) { |
| | | dialogRef.value?.open({ mode: 'view', row: { ...row } }) |
| | | } |