无人机管理后台前端(已迁走)
chenyao
2025-09-17 78bf59d8e0106ccf2acdd5bc4e3a6e510e1e5cbf
feat:更新代码
2 files modified
31 ■■■■ changed files
src/api/logs.js 7 ●●●● patch | view | raw | blame | history
src/views/flightLog/flightLog.vue 24 ●●●● patch | view | raw | blame | history
src/api/logs.js
@@ -102,6 +102,11 @@
    data
  })
}
export const cancelStar = data => {
  return request({
    url: '/drone-device-core/log/favorite/cancel/'+data,
    method: 'get',
  })
}
src/views/flightLog/flightLog.vue
@@ -54,8 +54,8 @@
                <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>
@@ -97,7 +97,7 @@
    </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'
@@ -158,7 +158,10 @@
}
function handleAll() {
  params.value.isFavorite = false
  params.value.page = 1
  tabType.value = '全部'
  getList()
}
function handleStartList() {
@@ -182,9 +185,18 @@
// 收藏
function handleStar(row) {
  addStar({ flight_log_id: row.id }).then(res => {
    getList()
  })
  console.log(row, '5555')
  if (row.is_favorite) {
    cancelStar(row.id).then(res => {
      ElMessage.success('取消收藏成功')
      getList()
    })
  } else {
    addStar({ flight_log_id: row.id }).then(res => {
      ElMessage.success('收藏成功')
      getList()
    })
  }
}
// 打标签