From 458d80c37f3200c02d370b19a4273ad347c70502 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 17 Sep 2025 17:14:10 +0800
Subject: [PATCH] feat:更新飞行日志

---
 src/views/flightLog/flightLog.vue |  104 ++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 72 insertions(+), 32 deletions(-)

diff --git a/src/views/flightLog/flightLog.vue b/src/views/flightLog/flightLog.vue
index f3c23c0..6ba20fa 100644
--- a/src/views/flightLog/flightLog.vue
+++ b/src/views/flightLog/flightLog.vue
@@ -25,12 +25,15 @@
       </div>
       </div>
       </el-form>
-      <div>
+      <!-- <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>
     <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="title" label="飞行类型" align="center" show-overflow-tooltip></el-table-column>
@@ -57,9 +60,9 @@
             </el-select>
           </template>
         </el-table-column>
-				<el-table-column label="操作" width="200" align="center">
+				<el-table-column label="操作" width="230" align="center">
 					<template #default="scope">
-            <!-- <el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button> -->
+            <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>
@@ -68,7 +71,9 @@
 					</template>
 				</el-table-column>
 			</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"
@@ -76,36 +81,28 @@
 				@size-change="handleSizeChange" @current-change="handleCurrentChange" />
 		</div>
   </div>
-  <!-- <el-dialog class="ztzf-dialog" append-to-body v-model="isShowView" title="查看"
-		:width="pxToRem(600)" :close-on-click-modal="false" :destroy-on-close="true">
-		<div class="content">
-      <table class="view-table" border>
-        <tr>
-          <td class="label">空域类型</td>
-          <td class="value">{{ rowView.model_name }}</td>
-          <td class="label">创建时间</td>
-          <td class="value">{{ rowView.alg_type }}</td>
-        </tr>
-      </table>
+  <el-dialog class="ztzf-dialog" append-to-body v-model="isShowView" title="查看"
+		:width="pxToRem(1000)" :close-on-click-modal="false" :destroy-on-close="true">
+		<!-- <div class="content"> -->
+      <el-table border :data="tableDataDetails" height="466">
+        <el-table-column label="序号" type="index" width="60"></el-table-column>
+        <el-table-column prop="flight_type" label="飞行类型" align="center" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="latitude" label="经度" align="center"></el-table-column>
+        <el-table-column prop="longitude" label="纬度" align="center"></el-table-column>
+        <el-table-column prop="height" label="高度" align="center"></el-table-column>
+        <el-table-column prop="elevation" label="海拔高度" align="center"></el-table-column>
+      </el-table>
+      <div class="pagination" style="display: flex;justify-content: end;margin-top: 10px;">
+        <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="detailParams.current"
+          v-model:page-size="detailParams.size" layout="total, sizes, prev, pager, next, jumper" :total="detailTotal"
+          @size-change="handleSizeChangeDetails" @current-change="handleCurrentChangeDetails" />
+    <!-- </div> -->
     </div>
 	</el-dialog>
-  <el-dialog class="ztzf-dialog" append-to-body v-model="isShowEditView" title="新增"
-		:width="pxToRem(800)" :close-on-click-modal="false" :destroy-on-close="true">
-		<div class="content-edit">
-      <el-form ref="ruleFormRef" :model="editParams" :rules="rules" inline>
-        <el-form-item label="空域名称">
-          <el-input v-model="editParams.model_name" />
-        </el-form-item>
-        <div class="btns">
-          <el-button type="primary" @click="submit(ruleFormRef)">确认</el-button>
-          <el-button @click="isShowEditView = false">取消</el-button>
-        </div>
-      </el-form>
-    </div>
-	</el-dialog> -->
 </template>
 <script setup>
-import { getHistoryTrack, cancelStar, addStar, updateDroneFlight } from '@/api/logs';
+import { getHistoryTrack, cancelStar, addStar, updateDroneFlight, droneFlightLogInfoPage } from '@/api/logs';
 import { flightLogPage } from '@/api/airspace/airspace';
 import { downloadXls } from '@/utils/util';
 import { exportBlob } from '@/api/common'
@@ -123,7 +120,7 @@
 
 let tableList = ref([])
 
-// let isShowView = ref(false)
+let isShowView = ref(false)
 
 // let rowView = ref({})
 
@@ -178,12 +175,55 @@
   tabType.value = '全部'
   getList()
 }
+// 查看
+let tableDataDetails = ref([])
+let detailTotal = ref(0)
+let detailParams = ref({
+  current: 1,
+  size: 10,
+  flightId: ''
+})
+function handleDetail(row) {
+  isShowView.value = true
+  detailParams.value.current = 1
+  detailParams.value.flightId = row.id
+  detailTotal.value = 0
+  droneFlightLogInfoPage(detailParams.value).then(res => {
+    tableDataDetails.value = res.data.data.records
+    detailTotal.value = res.data.data.total
+  })
+}
+// 分页
+function handleSizeChangeDetails(val) {
+  detailParams.value.size = val
+  detailParams.value.current = 1
+  droneFlightLogInfoPage(detailParams.value).then(res => {
+    tableDataDetails.value = res.data.data.records
+    detailTotal.value = res.data.data.total
+  })
+}
+function handleCurrentChangeDetails(val) {
+  detailParams.value.current = val
+  droneFlightLogInfoPage(detailParams.value).then(res => {
+    tableDataDetails.value = res.data.data.records
+    detailTotal.value = res.data.data.total
+  })
+}
+
 
 function handleStartList() {
   params.value.isFavorite = true
   tabType.value = '收藏'
   params.value.page = 1
   getList()
+}
+
+function handleTabClick() {
+  if (tabType.value === '全部') {
+    handleAll()
+  } else if (tabType.value === '收藏') {
+    handleStartList()
+  }
 }
 
 // async function submit(formValidate) {
@@ -269,7 +309,7 @@
     display: flex;
     flex-direction: column;
     .search-box {
-      height: 80px;
+      height: 30px;
     }
 
     :deep(.el-input) {

--
Gitblit v1.9.3