无人机管理后台前端(已迁走)
chenyao
2025-09-17 72253913e5cd11a05cbd11eb3f76e9989bd0d760
feat:更新数据中心
4 files modified
73 ■■■■ changed files
src/api/dataCenter/dataCenter.js 16 ●●●●● patch | view | raw | blame | history
src/views/dataCenter/components/searchData.vue 11 ●●●● patch | view | raw | blame | history
src/views/dataCenter/dataCenter.vue 45 ●●●● patch | view | raw | blame | history
src/views/flightLog/flightLog.vue 1 ●●●● patch | view | raw | blame | history
src/api/dataCenter/dataCenter.js
@@ -106,3 +106,19 @@
        data: data,
    })
}
// 收藏
export const starAdd = (data) => {
    return request({
        url: `/blade-resource/attach/favorite`,
        method: 'post',
        data
    })
}
// 取消收藏
export const cancelStar = (data) => {
    return request({
        url: `/blade-resource/attach/favorite/${data}`,
        method: 'delete',
    })
}
src/views/dataCenter/components/searchData.vue
@@ -113,8 +113,10 @@
<!--            >全部下载</el-button-->
<!--          >-->
        
        <el-button v-if="!viewDetailsDisabled" type="primary" plain  @click="handleswitchFolders" ><el-icon><FolderOpened /></el-icon></el-button>
        <el-button @click="handleStartList"><el-icon><Star /></el-icon></el-button>
        <!-- <el-button v-if="!viewDetailsDisabled" type="primary" plain  @click="handleswitchFolders" ><el-icon><FolderOpened /></el-icon></el-button> -->
        <el-button :type="!switchStar && !switchFolders ? 'primary':'default'" @click="handleswitchList">列表</el-button>
        <el-button :type="switchStar && !switchFolders ? 'primary':'default'" @click="handleStartList">我的收藏</el-button>
        <el-button :type="!switchStar && switchFolders ? 'primary':'default'" @click="handleswitchFolders">文件</el-button>
          <div class="downloadBtn" @click="htsjzx === 100 && downloadFun()">
            <el-progress v-if="htsjzx !== 100" :percentage="htsjzx" :show-text="false" striped striped-flow :duration="1" />
            <div class="downloadBtnText">
@@ -150,7 +152,7 @@
const timeRange = [startTime.format('YYYY-MM-DD HH:mm:ss'), endTime.format('YYYY-MM-DD HH:mm:ss')];
const dateRange = ref(timeRange);
const timeFormat = 'YYYY-MM-DD HH:mm:ss';
const props = defineProps(['searchjobId','switchFolders','viewDetails'])
const props = defineProps(['searchjobId','switchFolders', 'switchStar','viewDetails'])
const searchForm = reactive({
  jobName: '', //任务名称
  name: '', //文件名称
@@ -351,6 +353,9 @@
    ElMessage.success('取消成功')
  })
}
const handleswitchList =()=>{
  emit('handleswitchList');
}
// 切换文件夹
const handleswitchFolders =()=>{
  emit('handleswitchFolders'); 
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)
src/views/flightLog/flightLog.vue
@@ -200,7 +200,6 @@
// 收藏
function handleStar(row) {
  console.log(row, '5555')
  if (row.is_favorite) {
    cancelStar(row.id).then(res => {
      ElMessage.success('取消收藏成功')