无人机管理后台前端(已迁走)
张含笑
2025-08-13 cffd1da3e8aa72ebfd8ebfe4b4a765a245c3ee84
src/views/dataCenter/dataCenter.vue
@@ -4,13 +4,30 @@
  >
    <div class="dataCenter-table">
      <searchData
      :searchjobId="searchjobId"
      :switchFolders="switchFolders"
        @search="searchClick"
        @downFun="downloadFile"
        @allDownFun="aLLDownloadFile"
        @handleswitchFolders="handleswitchFolders"
          @handleswitchFolders="handleswitchFolders"
      ></searchData>
      <!-- 文件夹 -->
      <div class="fileshow" v-if="switchFolders"  v-loading="loadings "   element-loading-text="加载中">
          <div
                class="filePackage"
                v-for="(folderItem, fileIndex) in folderList"
                :key="fileIndex"
                @click.stop="foldersOpen(folderItem)"
              >
                <img :src="fileimg" alt="" />
                <el-checkbox v-model="folderItem.checked" @click.stop />
                <div class="itemName" :title="folderItem.name">
                  <div>{{ folderItem.name }}</div>
                    </div>
          </div>
      </div>
      <!-- 表格部分 -->
      <div class="dataTable" v-if="!switchFolders" >
      <div class="dataTable" v-else>
        <el-table
        border
         stripe
@@ -123,25 +140,9 @@
          </el-table-column>
        </el-table>
      </div>
      <!-- 文件夹 -->
      <div class="fileshow" v-else v-loading="loadings ">
          <div
                class="filePackage"
                v-for="(folderItem, fileIndex) in folderList"
                :key="fileIndex"
                @click.stop="foldersOpen(folderItem)"
              >
                <img :src="fileimg" alt="" />
                <el-checkbox v-model="folderItem.checked" @click.stop />
                <div class="itemName" :title="folderItem.name">
                  <div>{{ folderItem.name }}</div>
                    </div>
          </div>
      </div>
      <!-- 分页 -->
      <div class="pagination">
    <el-pagination
         <el-pagination
      :current-page="switchFolders ? FolderListParams.page : jobListParams.current"
      :page-size="switchFolders ? FolderListParams.page_size : jobListParams.size"
      :page-sizes="[10, 20, 30, 40]"
@@ -151,7 +152,7 @@
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
      </div>
      <!-- 查看弹框 -->
      <el-dialog
        v-model="dialogVisible"
@@ -419,7 +420,7 @@
const FolderListParams = reactive({
  page: 1,
  page_size: 30,
startTime: jobListParams.searchParams.startTime?.slice(0, 10),
    startTime: jobListParams.searchParams.startTime?.slice(0, 10),
    endTime: jobListParams.searchParams.endTime?.slice(0, 10),
   waylineName:'',
   
@@ -458,9 +459,9 @@
const folderList = ref([])
// 获取文件夹数据
const getFolderList=()=>{
 loadings.value = true;
 const apiParams = {
    ...FolderListParams, 
    // type:'0'
  };
  getJobIdsBySnApi(apiParams)
      .then(res => {
@@ -471,12 +472,21 @@
        loadings.value = false; 
      })
}
const searchjobId = ref('')
const foldersOpen = (val)=>{
    loadings.value = true;
    tableData.value=[]
    searchjobId.value = val.job_id
    switchFolders.value = false
}
// 获取数据时使用各自的分页参数
const fetchData = () => {
 loadings.value = true;
  if (switchFolders.value) {
    getFolderList();
  } else {
    getaiImagesPage();
    getaiImagesPage();
  }
};
// 切换文件夹
@@ -487,28 +497,23 @@
     fetchData();
   };
// 查询
const searchClick = async (params) => {
  loadings.value = true;
  total.value = 0;
  if (switchFolders.value) {
    // 文件夹逻辑
const searchClick = params => {
  if(switchFolders.value){
    FolderListParams.page = 1;
    FolderListParams.page_size = 30;
    FolderListParams.startTime = params.startTime?.slice(0, 10); 
    FolderListParams.endTime = params.endTime?.slice(0, 10);
    FolderListParams.waylineName=params.jobName,
    // FolderListParams.deviceSn = params.deviceSn
    await getFolderList();
  } else {
    // 表格逻辑
    jobListParams.current = 1;
    jobListParams.size = 10;
    jobListParams.searchParams = params;
    await getaiImagesPage();
    getFolderList()
  }else{
     jobListParams.current = 1;
      jobListParams.size = 10;
      jobListParams.searchParams = {
      ...jobListParams.searchParams,
      ...params
    };
    getaiImagesPage()
  }
  loadings.value = false;
};
const handleSizeChange = (val) => {
  if (switchFolders.value) {
@@ -606,7 +611,7 @@
   if (!['CANCELLED','COMPLETED'].includes(res.data.data?.status || 'COMPLETED')){
      return ElMessage.warning('还有正在处理的')
   }
   await downloadApi({ wayLineJobIds:jobId, withFolder: true, resultType: 0, type:'dpsjzx' })
   await downloadApi({ wayLineJobIds:jobId, withFolder: true, resultType: 0, type:'htsjzx' })
}
// 下载
const downloadFile = () => {
@@ -824,7 +829,6 @@
}
onMounted(() => {
  getaiImagesPage();
  getFolderList()
  // 监听打开全景事件
  EventBus.on('open-panorama', params => {
    panoramaParamsShow.value = params.show;
@@ -838,7 +842,6 @@
  viewInstance.value?.viewerDestroy();
});
</script>
<style scoped lang="scss">
.dataCenter-table {
  height: 0;
@@ -874,11 +877,16 @@
    }
  }
   .fileshow {
         display: grid;
         grid-template-columns: repeat(6, 1fr);
         gap: 10px;
       display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  overflow: auto;
  flex: 1;
  min-height: 0; /* 关键:解决 flex 容器中的最小高度问题 */
  align-content: flex-start; /* 让内容从顶部开始排列 */
         .filePackage {
          display: flex;
    justify-content: center;
            width: 260px;
            height: 146px;
            border-radius: 4px 4px 4px 4px;
@@ -888,7 +896,7 @@
            img {
               width: 111px;
               height: 111px;
               margin-left: 56px;
            }
            .el-checkbox {
@@ -903,6 +911,8 @@
               left: 0;
               height: 23px;
               width: 100%;
          padding: 0 10px;
          box-sizing: border-box;
               background: rgba(22, 56, 101, 0.3);
               border-radius: 0px 0px 4px 4px;
               font-family: Source Han Sans CN, Source Han Sans CN;
@@ -1083,4 +1093,4 @@
    }
  }
}
</style>
</style>