| | |
| | | <div class="flight"> |
| | | <div class="search-box"> |
| | | <el-form :model="params" inline> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <div> |
| | | <el-form-item label="日期:"> |
| | | <el-date-picker |
| | | v-model="rangTime" |
| | |
| | | @change="changeselect" |
| | | /> |
| | | </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> |
| | | </div> |
| | | </el-form> |
| | | <div> |
| | | <el-button :type="tabType === '全部'?'primary':'default'" @click="handleAll"><el-icon><Folder /></el-icon>全部</el-button> |
| | |
| | | <el-table-column label="操作" width="200" 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">删除</el-button> --> |
| | | <el-button type="text" @click="handleStar(scope.row)"><el-icon><Star /></el-icon>收藏</el-button> |
| | | <!-- <el-button icon="el-icon-delete" type="text" @click="handleDelete">删除</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-dialog> --> |
| | | </template> |
| | | <script setup> |
| | | import { getHistoryTrack, exportFlyLog, addStar, updateDroneFlight } from '@/api/logs'; |
| | | import { getHistoryTrack, cancelStar, addStar, updateDroneFlight } from '@/api/logs'; |
| | | import { flightLogPage } from '@/api/airspace/airspace'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import { exportBlob } from '@/api/common' |
| | |
| | | } |
| | | |
| | | function cancelSearch() { |
| | | rangTime.value = [] |
| | | params.value = { |
| | | startTime: '', |
| | | endTime: '', |
| | | isFavorite: false, |
| | | page: '1', |
| | | page_size: '10', |
| | |
| | | } |
| | | |
| | | function getList() { |
| | | console.log(rangTime.value, '333') |
| | | params.value.startTime = rangTime.value?.length ? rangTime.value[0].getTime() : '' |
| | | params.value.endTime = rangTime.value?.length? rangTime.value[1].getTime() : '' |
| | | params.value.endTime = rangTime.value?.length? new Date( |
| | | rangTime.value[1].getFullYear(), |
| | | rangTime.value[1].getMonth(), |
| | | rangTime.value[1].getDate(), |
| | | 23, 59, 59 |
| | | ).getTime() : '' |
| | | getHistoryTrack(params.value).then(res => { |
| | | tableList.value = res.data.data.list || [] |
| | | total.value = res.data.data.pagination.total || 0 |
| | |
| | | } |
| | | |
| | | function handleAll() { |
| | | params.value.isFavorite = false |
| | | params.value.page = 1 |
| | | tabType.value = '全部' |
| | | getList() |
| | | } |
| | | |
| | | function handleStartList() { |
| | |
| | | |
| | | // 收藏 |
| | | function handleStar(row) { |
| | | addStar({ flight_log_id: row.id }).then(res => { |
| | | getList() |
| | | }) |
| | | if (row.is_favorite) { |
| | | cancelStar(row.id).then(res => { |
| | | ElMessage.success('取消收藏成功') |
| | | getList() |
| | | }) |
| | | } else { |
| | | addStar({ flight_log_id: row.id }).then(res => { |
| | | ElMessage.success('收藏成功') |
| | | getList() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 打标签 |