From b60d5576b3eaee576b57cffa5b487324214c23ac Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 10 Jun 2025 17:47:28 +0800
Subject: [PATCH] feat:调用列表接口

---
 src/views/dataCenter/dataCenter.vue |  178 ++++++++++++++++++++++++++---------------------------------
 1 files changed, 78 insertions(+), 100 deletions(-)

diff --git a/src/views/dataCenter/dataCenter.vue b/src/views/dataCenter/dataCenter.vue
index 96de4b7..63f9c7e 100644
--- a/src/views/dataCenter/dataCenter.vue
+++ b/src/views/dataCenter/dataCenter.vue
@@ -2,8 +2,10 @@
   <div class="dataCenter-table">
     <searchData></searchData>
     <!-- 表格部分 -->
-    <div class="dataTable">
+    <div class="dataTable" >
       <el-table
+      v-loading="loading"
+          element-loading-text="加载中"
         stripe
         :data="tableData"
         class="custom-header"
@@ -11,22 +13,22 @@
       >
         <el-table-column type="selection" width="55" />
         <el-table-column label="序号" type="index" width="60" />
-        <el-table-column prop="address" label="所属区域" />
-        <el-table-column property="nest" label="所属机巢" />
-        <el-table-column property="taskname" label="任务名称" />
-        <el-table-column prop="filename" label="文件名称" />
+        <el-table-column prop="regionName" label="所属区域" />
+        <el-table-column property="nestName" label="所属机巢" />
+        <el-table-column property="jobName" label="任务名称" show-overflow-tooltip/>
+        <el-table-column prop="nickName" label="文件名称"   show-overflow-tooltip />
         <el-table-column property="img" label="缩图" width="120">
           <template #default="scope">
             <img
               class="quanjing"
               @click="clickpanorama(scope.row)"
               v-if="scope.row.fileformat === '全景'"
-              :src="scope.row.img"
+              :src="scope.row.link"
               alt=""
             />
             <img
               v-else-if="scope.row.fileformat === '视频'"
-              :src="convertVideoUrlToThumbnail(scope.row.img)"
+              :src="convertVideoUrlToThumbnail(scope.row.link)"
               alt=""
               class="imageBox"
               @click="enterFullScreen(scope.row)"
@@ -34,22 +36,42 @@
             <el-image
               v-else
               :src="scope.row.img"
-              :preview-src-list="[scope.row.img]"
+              :preview-src-list="[scope.row.link]"
               fit="cover"
               preview-teleported
             />
           </template>
         </el-table-column>
-        <el-table-column prop="timer" label="任务时间" />
-        <el-table-column property="fileclass" label="文件类别" />
-        <el-table-column property="fileformat" label="文件格式" />
+        <el-table-column prop="createTime" label="任务时间" />
+        <el-table-column property="photoType" label="文件类别" > 
+           <template #default="scope">
+            <span>{{scope.row.photoType=== 'visible' ? '可见光':'红外'}}</span>
+             </template>
+        </el-table-column>
+        <el-table-column property="resultType" label="文件格式">
+          <template #default="scope">
+            <span>{{
+              scope.row.resultType === 0
+                ? '照片'
+                : scope.row.resultType === 1
+                ? '视频'
+                : scope.row.resultType === 2
+                ? 'AI识别'
+                : scope.row.resultType === 3
+                ? '全景'
+                : '正射'
+            }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" width="150" align="center">
           <template #default="scope">
             <span class="look" @click="lookDetail(scope.row)">查看</span>
             <span class="delete" @click="deleteDetail()" v-if="scope.row.fileformat !== 'AI识别'"
               >删除</span
             >
-            <span class="location" @click="positionDetail()" v-if="scope.row.fileformat !== '视频'">定位</span>
+            <span class="location" @click="positionDetail()" v-if="scope.row.fileformat !== '视频'"
+              >定位</span
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -62,7 +84,7 @@
         :page-sizes="[10, 20, 30, 40]"
         background
         layout="total, sizes, prev, pager, next, jumper"
-        :total="400"
+        :total="total"
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
       />
@@ -130,21 +152,28 @@
       @close="currentVideoIndex = -1"
     >
       <div class="video-container">
-        <video style="width:100%" class="videoBox" ref="videoRefs" controls autoplay :src="currentVideoUrl"></video>
+        <video
+          style="width: 100%"
+          class="videoBox"
+          ref="videoRefs"
+          controls
+          autoplay
+          :src="currentVideoUrl"
+        ></video>
       </div>
     </el-dialog>
     <!-- 地图弹框 -->
-     <dataCenterMap v-model:show="dataCenterMapVisible"></dataCenterMap>
+    <dataCenterMap v-model:show="dataCenterMapVisible"></dataCenterMap>
   </div>
 </template>
 
 <script setup>
-import dataCenterMap from '@/views/dataCenter/components/dataCenterMap.vue'
+import dataCenterMap from '@/views/dataCenter/components/dataCenterMap.vue';
 import PanoramaPopup from '@/components/PanoramaPopup/PanoramaPopup.vue'; //全景
 import { ElMessage, ElMessageBox } from 'element-plus';
 import searchData from '@/views/dataCenter/components/searchData.vue';
 import fy1 from '@/assets/images/dataCenter/1.jpeg';
-import {getaiImagesPage} from '@/api/dataCenter/dataCenter'
+import { getaiImagesPage } from '@/api/dataCenter/dataCenter';
 import { onMounted } from 'vue';
 function convertVideoUrlToThumbnail(videoUrl) {
   // 检查是否是有效的视频URL
@@ -155,76 +184,26 @@
   const thumbnailUrl = videoUrl.replace(/\.mp4$/, '_small.jpg');
   return thumbnailUrl;
 }
-
+const loading = ref(true);
+const total = ref(0);
 const jobListParams = reactive({
   current: 1,
   size: 10,
   searchParams: {},
 });
-const tableData = [
-  {
-    address: '南昌市,西湖区',
-    nest: '空间大厦',
-    date: '2016-05-04',
-    taskname: '测试任务',
-    filename: 'ABD2025053054654',
-    img: fy1,
-    timer: '2025-05-26 10:25',
-    fileclass: '可见光',
-    fileformat: '照片',
-  },
-  {
-    address: '南昌市,西湖区',
-    nest: '空间大厦',
-    date: '2016-05-04',
-    taskname: '测试任务',
-    filename: '1111',
-    img: 'https://wrj.shuixiongit.com/minio/cloud-bucket/9748effb-f27b-49c8-b57d-3e2c2ac7c03a/DJI_202506100845_010_9748effb-f27b-49c8-b57d-3e2c2ac7c03a/DJI_20250610084758_0002_V.mp4',
-    timer: '2025-05-26 10:25',
-    fileclass: '可见光',
-    fileformat: '视频',
-  },
-  {
-    address: '南昌市,西湖区',
-    nest: '空间大厦',
-    date: '2016-05-04',
-    taskname: '测试任务',
-    filename: '2222',
-    img: fy1,
-    timer: '2025-05-26 10:25',
-    fileclass: '可见光',
-    fileformat: 'AI识别',
-  },
-  {
-    address: '南昌市,西湖区',
-    nest: '空间大厦',
-    date: '2016-05-04',
-    taskname: '测试任务',
-    filename: '333',
-    img: fy1,
-    timer: '2025-05-26 10:25',
-    fileclass: '可见光',
-    fileformat: '全景',
-  },
-  {
-    address: '南昌市,西湖区',
-    nest: '空间大厦',
-    date: '2016-05-04',
-    taskname: '测试任务',
-    filename: '44',
-    img: fy1,
-    timer: '2025-05-26 10:25',
-    fileclass: '可见光',
-    fileformat: '正射',
-  },
-];
+const tableData = ref([]);
+
 // 获取列表数据
-const getgetaiImagesPage =()=>{
-  getaiImagesPage(jobListParams).then(res=>{
-    console.log('res',res);
-    
-  })
-}
+const getgetaiImagesPage = () => {
+  getaiImagesPage(jobListParams).then(res => {
+  loading.value = true;
+    total.value = res.data.data.total;
+
+    tableData.value = res.data.data?.records;
+    console.log('res', tableData.value, total.value);
+      loading.value = false;
+  });
+};
 const handleSizeChange = () => {};
 const handleCurrentChange = () => {};
 // 多选
@@ -273,15 +252,14 @@
   console.log('视频', val);
 };
 // 地图弹框
-const dataCenterMapVisible = ref(false)
-const positionDetail=()=>{
+const dataCenterMapVisible = ref(false);
+const positionDetail = () => {
   console.log('地图');
-  dataCenterMapVisible.value = true
-  
-}
-onMounted(()=>{
-  // getgetaiImagesPage()
-})
+  dataCenterMapVisible.value = true;
+};
+onMounted(() => {
+  getgetaiImagesPage();
+});
 </script>
 
 <style scoped lang="scss">
@@ -316,23 +294,23 @@
   .el-image,
   .imageBox {
     cursor: pointer;
-    width: 96px;
+    width: 76px;
     height: 72px;
   }
-  .videoDialog :deep(.el-dialog){
-  height: 600px;
-  width: 54%;
+  .videoDialog :deep(.el-dialog) {
+    height: 600px;
+    width: 54%;
   }
   .video-container {
-  width: 100%;
-  aspect-ratio: 16/9; /* 按视频比例设置(如16:9) */
-  overflow: hidden; /* 隐藏溢出部分 */
-}
+    width: 100%;
+    aspect-ratio: 16/9; /* 按视频比例设置(如16:9) */
+    overflow: hidden; /* 隐藏溢出部分 */
+  }
   .videoBox {
     width: 100%;
-  height: 100%;
-  object-fit: contain; /* 保持比例完整显示 */
-  display: block;
+    height: 100%;
+    object-fit: contain; /* 保持比例完整显示 */
+    display: block;
   }
 }
 :deep(.custom-header th.el-table__cell) {

--
Gitblit v1.9.3