无人机管理后台前端(已迁走)
张含笑
2025-06-11 876dabc17c09c7c03d05f1f749d5be0a4c6eab99
src/views/dataCenter/dataCenter.vue
@@ -12,12 +12,16 @@
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55" />
        <el-table-column label="序号" type="index" width="60" />
        <el-table-column label="序号" type="index" width="60">
               <template #default="{ $index }">
                  {{ ($index + 1 + (jobListParams.current - 1) * jobListParams.size).toString().padStart(2, '0') }}
               </template>
            </el-table-column>
        <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">
        <el-table-column property="link" label="缩图" width="120">
          <template #default="scope">
            <img
              class="quanjing"
@@ -42,25 +46,15 @@
            />
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="任务时间" />
        <el-table-column prop="jobTime" label="任务时间" />
        <el-table-column property="photoType" label="文件类别">
          <template #default="scope">
            <span>{{ scope.row.photoType === 'visible' ? '可见光' : '红外' }}</span>
            <span>{{photoTypeMap[scope.row.photoType] }}</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 #default="{ row }">
            <span>{{ resultTypeMap[row.resultType]  }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="150" align="center">
@@ -98,7 +92,7 @@
        </div>
      </template>
      <div class="detailContainer">
        <div class="leftImg"><img :src="dialogDetailList.img" alt="" /></div>
        <div class="leftImg"><img :src="dialogDetailList.link" alt="" /></div>
        <div class="rightDetail">
          <div class="title">
            <div class="inputEdit">
@@ -123,15 +117,15 @@
              </div>
            </div>
          </div>
          <div>任务名称:{{ dialogDetailList?.taskname }}</div>
          <div>所属区域:{{ dialogDetailList?.address }}</div>
          <div>拍摄机巢:{{ dialogDetailList?.nest }}</div>
          <div>照片位置:{{}}</div>
          <div>任务时间:{{ dialogDetailList?.date }}</div>
          <div>任务名称:{{ dialogDetailList?.jobName }}</div>
          <div>所属区域:{{ dialogDetailList?.regionName }}</div>
          <div>拍摄机巢:{{ dialogDetailList?.nickName }}</div>
          <div>照片位置:{{dialogDetailList?.longitude}},{{dialogDetailList?.latitude}}</div>
          <div>任务时间:{{ dialogDetailList?.executeTime }}</div>
          <div>拍摄时间:{{ dialogDetailList?.date }}</div>
          <div>文件类型:{{ dialogDetailList?.fileclass }}</div>
          <div>文件格式:{{ dialogDetailList?.fileformat }}</div>
          <div>照片文件大小:2M</div>
          <div>文件类型:{{photoTypeMap[dialogDetailList?.photoType]  }}</div>
          <div>文件格式:{{ resultTypeMap[dialogDetailList?.resultType] }}</div>
          <div>照片文件大小:{{dialogDetailList?.attachSize}}</div>
        </div>
      </div>
    </el-dialog>
@@ -173,8 +167,10 @@
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 { getaiImagesPageAPI, getAttachInfoAPI } from '@/api/dataCenter/dataCenter';
import { getShowImg, getSmallImg } from '@/utils/util';
import { onMounted } from 'vue';
import dayjs from 'dayjs';
function convertVideoUrlToThumbnail(videoUrl) {
  // 检查是否是有效的视频URL
  if (!videoUrl || typeof videoUrl !== 'string') {
@@ -184,23 +180,49 @@
  const thumbnailUrl = videoUrl.replace(/\.mp4$/, '_small.jpg');
  return thumbnailUrl;
}
const resultTypeMap = {
  0: '照片',
  1: '视频',
  2: 'AI识别',
  3: '全景',
  4:'正射'
};
const photoTypeMap ={
  visible:'可见光',
  ir:'红外'
}
const loading = ref(true);
const total = ref(0);
const startTime = dayjs().subtract(6, 'day').startOf('day')
const endTime = dayjs().endOf('day')
const timeRange = [startTime.format('YYYY-MM-DD HH:mm:ss'), endTime.format('YYYY-MM-DD HH:mm:ss')]
console.log('11',timeRange);
const jobListParams = reactive({
  current: 1,
  size: 10,
  searchParams: {},
  searchParams: {startTime:timeRange[0],endTime:timeRange[1]},
});
const tableData = ref([]);
// 获取列表数据
const getgetaiImagesPage = () => {
  getaiImagesPage(jobListParams).then(res => {
const getaiImagesPage = () => {
  getaiImagesPageAPI({
    current: jobListParams.current,
    size: jobListParams.size,
    ...jobListParams.searchParams,
  }).then(res => {
    loading.value = true;
    total.value = res.data.data.total;
    tableData.value = res.data.data?.records;
    console.log('res', tableData.value, total.value);
    tableData.value = res.data.data.records.map(i => ({
      ...i,
      checked: false,
      url: i.domainUrl,
      smallUrl: getSmallImg(i.domainUrl),
      showUrl: getShowImg(i.domainUrl),
      file_name: i.name.split('/').pop(),
    }));
    console.log('res', tableData.value);
    loading.value = false;
  });
};
@@ -211,15 +233,15 @@
  jobListParams.searchParams = params;
  console.log('jobListParams', jobListParams);
  // getgetaiImagesPage()
  getaiImagesPage();
};
const handleSizeChange = val => {
  jobListParams.size = val;
  getgetaiImagesPage();
  getaiImagesPage();
};
const handleCurrentChange = val => {
  jobListParams.current = val;
  getgetaiImagesPage();
  getaiImagesPage();
};
// 多选
const selectedRows = ref([]);
@@ -227,13 +249,18 @@
  // console.log('多选',val);
};
// 弹框
// 查看弹框
const dialogVisible = ref(false);
const dialogDetailList = ref(null);
const lookDetail = val => {
  dialogDetailList.value = val;
  // console.log('弹框', dialogDetailList.value);
  // dialogDetailList.value = val;
getAttachInfoAPI(val.id).then(res=>{
dialogDetailList.value = res.data.data
  console.log('red',res.data.data);
})
  dialogVisible.value = true;
    console.log('弹框', val.id);
};
// 删除
const deleteDetail = () => {
@@ -273,7 +300,7 @@
  dataCenterMapVisible.value = true;
};
onMounted(() => {
  getgetaiImagesPage();
  getaiImagesPage();
});
</script>