无人机管理后台前端(已迁走)
chenyao
2025-09-17 72253913e5cd11a05cbd11eb3f76e9989bd0d760
src/views/dataCenter/dataCenter.vue
@@ -7,10 +7,12 @@
      ref="searchBoxRef"
      :searchjobId="searchjobId"
      :switchFolders="switchFolders"
      :switchStar = "switchStar"
        @search="searchClick"
        @downFun="downloadFile"
        @allDownFun="aLLDownloadFile"
        @handleswitchFolders="handleswitchFolders"
        @handleswitchList="handleswitchList"
        @handleStartList="handleStartList"
        @handleBack ="handleBack"
       :viewDetails ="viewDetails"
@@ -165,7 +167,7 @@
              >
                <img :src="positionicon" class="custom-icon" />定位</el-button
              >
              <el-button type="text" @click="handleStar"><el-icon><Star /></el-icon>收藏</el-button>
              <el-button type="text" @click="handleStar(scope.row)"><el-icon><Star /></el-icon>{{ scope.row.isFavorite ? '取消收藏':'收藏' }}</el-button>
              <el-popover
                placement="top-start"
                title="扫二维码分享"
@@ -369,7 +371,7 @@
  deleteFileMultipleApi,
  downloadApi,
  updataTitleApi,
  getOrthoimageInfo, getDownloadStatusApi,getJobIdsBySnApi
  getOrthoimageInfo, getDownloadStatusApi,getJobIdsBySnApi, starAdd, cancelStar
} from '@/api/dataCenter/dataCenter';
const userInfo = computed(() => store.getters.userInfo);
const isShow = defineModel('show');
@@ -380,6 +382,7 @@
const currentAreaPosition = ref({ height: 1987280, latitude: 27.636112, longitude: 115.732975 });
let handler = null;
const switchFolders = ref(false)
const switchStar = ref(false)
function bytesToMB(bytes, decimalPlaces = 2) {
  if (typeof bytes !== 'number' || bytes < 0) return '0';
  return (bytes / 1048576).toFixed(decimalPlaces) + ' MB';
@@ -460,7 +463,7 @@
  current: 1,
  size: 10,
  orderByCreateTime: true,
  searchParams: { startTime: timeRange[0], endTime: timeRange[1] },
  searchParams: { startTime: timeRange[0], endTime: timeRange[1], isFavorite: false },
});
const FolderListParams = reactive({
    page: 1,
@@ -539,10 +542,20 @@
    getaiImagesPage();
  }
};
// 列表
function handleswitchList() {
  switchFolders.value = false;
  switchStar.value = false;
  jobListParams.current = 1;
  jobListParams.size = 10;
  jobListParams.searchParams.isFavorite = false;
  getaiImagesPage();
}
// 切换文件夹
 const handleswitchFolders = () => {
 searchjobId.value = ''
     switchFolders.value = !switchFolders.value;
     switchFolders.value = true;
     switchStar.value = false;
     jobListParams.current = 1;
     FolderListParams.page = 1;
@@ -560,9 +573,13 @@
   }
   const searchBoxRef = ref(null);
// 收藏列表
const starList = ref([])
const handleStartList = () => {
  switchFolders.value = false;
  switchStar.value = true;
  jobListParams.current = 1;
  jobListParams.size = 10;
  jobListParams.searchParams.isFavorite = true;
  getaiImagesPage();
}
// 查询
const searchClick = params => {
@@ -905,8 +922,20 @@
  }
}
// 收藏
function handleStar() {}
// 收藏 or 取消收藏
function handleStar(row) {
  if (row.isFavorite) {
    cancelStar(row.id).then(res => {
      ElMessage.success('取消收藏成功')
      getaiImagesPage();
    })
  } else {
    starAdd({ attachId: row.id }).then(res => {
      ElMessage.success('收藏成功')
      getaiImagesPage();
    })
  }
}
// 分享
const myQrCode = ref(null)