无人机管理后台前端(已迁走)
张含笑
2025-06-11 96da8aa6eb08a004f0b4d613a50d97079d544125
feat:接口调试
5 files modified
255 ■■■■ changed files
.env.development 4 ●●●● patch | view | raw | blame | history
src/api/dataCenter/dataCenter.js 20 ●●●●● patch | view | raw | blame | history
src/views/dataCenter/components/searchData.vue 36 ●●●● patch | view | raw | blame | history
src/views/dataCenter/dataCenter.vue 191 ●●●● patch | view | raw | blame | history
src/views/wel/components/calendarBox.vue 4 ●●●● patch | view | raw | blame | history
.env.development
@@ -10,9 +10,9 @@
VITE_APP_BASE=/manage
# 服务地址
#VITE_APP_URL = https://wrj.shuixiongit.com/api
VITE_APP_URL = https://wrj.shuixiongit.com/api
#VITE_APP_URL= http://192.168.1.168 rjg
VITE_APP_URL= http://192.168.1.33
#VITE_APP_URL= http://192.168.1.33
#新大屏地址
VITE_APP_DASHBOARD_URL = 'https://wrj.shuixiongit.com/command-center-dashboard/'
src/api/dataCenter/dataCenter.js
@@ -16,4 +16,22 @@
            id,
          },
    })
  };
  };
//删除
export const deleteFileMultipleApi = (ids) => {
    return request({
        url: `/blade-resource/attach/remove`,
        method: 'post',
        params: {
            ids,
          },
    })
}
// 下载
export const downloadApi = (data) => {
    return request({
        url: `/blade-resource/attach/download`,
        method: 'post',
        data
    })
}
src/views/dataCenter/components/searchData.vue
@@ -97,8 +97,8 @@
      </div>
      <div class="search-first">
        <div class="search-btn">
          <el-button type="primary" icon="el-icon-download">全部下载</el-button>
          <el-button type="success" plain icon="el-icon-download">下载</el-button>
          <el-button type="primary" icon="el-icon-download" @click="allDownloadFun">全部下载</el-button>
          <el-button type="success" plain icon="el-icon-download" @click="downloadFun">下载</el-button>
        </div>
      </div>
    </el-form>
@@ -114,7 +114,7 @@
const store = useStore();
const userAreaCode = computed(() => store.getters.userInfo.detail.areaCode);
const selectedAreaCode = computed(() => store.state.user.selectedAreaCode);
const emit = defineEmits(['search']);
const emit = defineEmits(['search','downFun','allDownFun']);
const treeProps = {
  label: 'name',
  value: 'id',
@@ -152,20 +152,22 @@
    label: '红外',
  },
];
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')]
const dateRange = ref(timeRange);
const timeFormat = 'YYYY-MM-DD HH:mm:ss';
const searchForm = reactive({
  jobName: '', //任务名称
  nickName: '', //文件名称
  areaCode: userAreaCode.value, // 区域code
  endTime: null, // 结束时间
  startTime: null, // 开始时间
  endTime:  endTime.format(timeFormat), // 结束时间
  startTime: startTime.format(timeFormat), // 开始时间
  deviceSn: '', // 所属机巢
  resultType: '', //文件格式
  photoType: '', //文件类别
});
const dateRange = ref([]);
const timeFormat = 'YYYY-MM-DD HH:mm:ss';
// 部门
let deptTreeData = ref([]);
// 机巢
@@ -183,8 +185,16 @@
    if (diff > 31) {
      ElMessage.warning('日期范围不能超过31天');
      dateRange.value = [];
      // 重置为默认时间范围
      setTimeout(() => {
        dateRange.value = timeRange;
      }, 0);
      return;
    }
    // 更新搜索表单中的时间
    searchForm.startTime = start.format(timeFormat);
    searchForm.endTime = end.format(timeFormat);
  }
  handleSearch();
};
@@ -209,7 +219,7 @@
    searchForm.deviceSn = signDevice_sn.value;
  }
  // 所属部门重新请求值
  searchForm.create_dept = '';
  deptData.value = [];
  getDeptsByAreaCode();
};
@@ -248,6 +258,14 @@
  handleNodeClick({ id: userAreaCode.value });
  handleSearch();
};
// 下载
const downloadFun =()=>{
  emit('downFun');
}
// 全部下载
const allDownloadFun =()=>{
    emit('allDownFun');
}
onMounted(() => {
  requestDockInfo();
});
src/views/dataCenter/dataCenter.vue
@@ -1,6 +1,10 @@
<template>
  <div class="dataCenter-table">
    <searchData @search="searchClick"></searchData>
    <searchData
      @search="searchClick"
      @downFun="downloadFile"
      @allDownFun="aLLDownloadFile"
    ></searchData>
    <!-- 表格部分 -->
    <div class="dataTable">
      <el-table
@@ -13,10 +17,14 @@
      >
        <el-table-column type="selection" width="55" />
        <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>
          <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 />
@@ -26,12 +34,12 @@
            <img
              class="quanjing"
              @click="clickpanorama(scope.row)"
              v-if="scope.row.fileformat === '全景'"
              v-if="scope.row?.resultType === 3"
              :src="scope.row.link"
              alt=""
            />
            <img
              v-else-if="scope.row.fileformat === '视频'"
              v-else-if="scope.row?.resultType === 1"
              :src="convertVideoUrlToThumbnail(scope.row.link)"
              alt=""
              class="imageBox"
@@ -39,8 +47,8 @@
            />
            <el-image
              v-else
              :src="scope.row.img"
              :preview-src-list="[scope.row.link]"
              :src="scope.row.smallUrl"
              :preview-src-list="[scope.row.showUrl]"
              fit="cover"
              preview-teleported
            />
@@ -49,18 +57,21 @@
        <el-table-column prop="jobTime" label="任务时间" />
        <el-table-column property="photoType" label="文件类别">
          <template #default="scope">
            <span>{{photoTypeMap[scope.row.photoType] }}</span>
            <span>{{ photoTypeMap[scope.row.photoType] }}</span>
          </template>
        </el-table-column>
        <el-table-column property="resultType" label="文件格式">
          <template #default="{ row }">
            <span>{{ resultTypeMap[row.resultType]  }}</span>
            <span>{{ resultTypeMap[row?.resultType] }}</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
              class="delete"
              @click="deleteDetail(scope.row)"
              v-if="scope.row.fileformat !== 'AI识别'"
              >删除</span
            >
            <span class="location" @click="positionDetail()" v-if="scope.row.fileformat !== '视频'"
@@ -92,7 +103,15 @@
        </div>
      </template>
      <div class="detailContainer">
        <div class="leftImg"><img :src="dialogDetailList.link" alt="" /></div>
        <div class="leftImg">
          <img
            v-if="dialogDetailList?.resultType === 1"
            :src="convertVideoUrlToThumbnail(dialogDetailList.link)"
            alt=""
            class="imageBox"
          />
          <img v-else :src="dialogDetailList.link" alt="" />
        </div>
        <div class="rightDetail">
          <div class="title">
            <div class="inputEdit">
@@ -120,12 +139,12 @@
          <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>文件类型:{{photoTypeMap[dialogDetailList?.photoType]  }}</div>
          <div>照片位置:{{ dialogDetailList?.longitude }},{{ dialogDetailList?.latitude }}</div>
          <div>任务时间:{{ dialogDetailList?.jobTime }}</div>
          <div>拍摄时间:{{ dialogDetailList?.createTime }}</div>
          <div>文件类型:{{ photoTypeMap[dialogDetailList?.photoType] }}</div>
          <div>文件格式:{{ resultTypeMap[dialogDetailList?.resultType] }}</div>
          <div>照片文件大小:{{dialogDetailList?.attachSize}}</div>
          <div>照片文件大小:{{ dialogDetailList?.attachSize }}</div>
        </div>
      </div>
    </el-dialog>
@@ -164,13 +183,19 @@
<script setup>
import dataCenterMap from '@/views/dataCenter/components/dataCenterMap.vue';
import PanoramaPopup from '@/components/PanoramaPopup/PanoramaPopup.vue'; //全景
import { ElMessage, ElMessageBox } from 'element-plus';
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
import searchData from '@/views/dataCenter/components/searchData.vue';
import fy1 from '@/assets/images/dataCenter/1.jpeg';
import { getaiImagesPageAPI, getAttachInfoAPI } from '@/api/dataCenter/dataCenter';
import {
  getaiImagesPageAPI,
  getAttachInfoAPI,
  deleteFileMultipleApi,
  downloadApi,
} 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') {
@@ -185,23 +210,23 @@
  1: '视频',
  2: 'AI识别',
  3: '全景',
  4:'正射'
  4: '正射',
};
const photoTypeMap ={
  visible:'可见光',
  ir:'红外'
}
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 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')];
const jobListParams = reactive({
  current: 1,
  size: 10,
  searchParams: {startTime:timeRange[0],endTime:timeRange[1]},
  orderByCreateTime: true,
  searchParams: { startTime: timeRange[0], endTime: timeRange[1] },
});
const tableData = ref([]);
@@ -210,6 +235,7 @@
  getaiImagesPageAPI({
    current: jobListParams.current,
    size: jobListParams.size,
    orderByCreateTime: jobListParams.orderByCreateTime,
    ...jobListParams.searchParams,
  }).then(res => {
    loading.value = true;
@@ -217,9 +243,9 @@
    tableData.value = res.data.data.records.map(i => ({
      ...i,
      checked: false,
      url: i.domainUrl,
      smallUrl: getSmallImg(i.domainUrl),
      showUrl: getShowImg(i.domainUrl),
      url: i.link,
      smallUrl: getSmallImg(i.link),
      showUrl: getShowImg(i.link),
      file_name: i.name.split('/').pop(),
    }));
    console.log('res', tableData.value);
@@ -231,44 +257,111 @@
  jobListParams.current = 1;
  jobListParams.size = 10;
  jobListParams.searchParams = params;
  console.log('jobListParams', jobListParams);
  getaiImagesPage();
};
const handleSizeChange = val => {
  jobListParams.size = val;
  getaiImagesPage();
  console.log('jobListParams.size', jobListParams.size);
};
const handleCurrentChange = val => {
  jobListParams.current = val;
  getaiImagesPage();
  console.log('jobListParams.current', jobListParams.current);
};
// 多选
const selectedRows = ref([]);
const handleSelectionChange = val => {
  // console.log('多选',val);
};
  // 更新选中状态
  tableData.value.forEach(item => {
    item.checked = val.some(selected => selected.id === item.id);
  });
  selectedRows.value = val;
};
// url下载
function aLinkDownload(url, name) {
  const a = document.createElement('a');
  a.style.display = 'none';
  a.href = url;
  a.download = name;
  document.body.appendChild(a);
  a.click();
  document.body.removeChild(a);
}
const fileDownload = () => {
  const list = selectedRows.value.filter(i => i.checked);
  if (!list?.length) return ElMessage.warning('请选择文件');
  if (list.length === 1) {
    list.forEach((item, index) => {
      setTimeout(() => {
        // console.log('item.url, item.file_name', item.url, item.nickName)
        aLinkDownload(item.url, item.nickName);
      }, index * 500); // 每个文件下载间隔50毫秒
    });
  } else {
    // loading = ElLoading.service({ background: 'rgba(0, 0, 0, 0.5)', text: '打包中,请稍等...' })
    const fileIds = list.map(i => Number(i.id));
    console.log('fileIds', fileIds, list);
    let aaa = {
      areaCode: '',
      attachIds: fileIds,
      dockSn: '',
      endTime: '',
      fileName: '',
      fileType: '',
      jobName: '',
      resultType: '',
      startTime: '',
      wayLineJobIds: [],
    };
    downloadApi(aaa).then(res => {
      console.log('res.data.data', res.data.data);
      // aLinkDownload(res.data.data, `sjzx-file-pack-${dayjs().format('YYYYMMDDHHmmss')}.zip`);
      // loading.close()
    });
  }
};
// 下载
const downloadFile = () => {
  fileDownload();
};
// 全部下载
const aLLDownloadFile = () => {
  console.log('全部下载');
};
// 查看弹框
const dialogVisible = ref(false);
const dialogDetailList = ref(null);
const lookDetail = val => {
  // dialogDetailList.value = val;
getAttachInfoAPI(val.id).then(res=>{
dialogDetailList.value = res.data.data
  console.log('red',res.data.data);
})
console.log('val',val);
  getAttachInfoAPI(val.id).then(res => {
    dialogDetailList.value = res.data.data;
  });
  dialogVisible.value = true;
    console.log('弹框', val.id);
};
// 删除
const deleteDetail = () => {
const deleteDetail = val => {
  ElMessageBox.confirm('您确定删除吗?', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning',
  });
  })
    .then(() => {
      deleteFileMultipleApi(val.id)
        .then(res => {
          console.log('删除成功', res);
          ElMessage.success('删除成功');
          getaiImagesPage();
        })
        .catch(error => {
          ElMessage.error('删除失败');
        });
    })
    .catch(() => {});
};
// 编辑文件名
const editTitle = val => {
@@ -288,15 +381,13 @@
const VideoShow = ref(false);
const currentVideoUrl = ref(null);
const enterFullScreen = val => {
  currentVideoTitle.value = val.filename;
  currentVideoTitle.value = val.nickName;
  currentVideoUrl.value = val.link;
  VideoShow.value = true;
  currentVideoUrl.value = val.img;
  console.log('视频', val);
};
// 地图弹框
const dataCenterMapVisible = ref(false);
const positionDetail = () => {
  console.log('地图');
  dataCenterMapVisible.value = true;
};
onMounted(() => {
src/views/wel/components/calendarBox.vue
@@ -68,7 +68,7 @@
const getDate = date => {
  return date.getDate();
};
console.log('getDate', getDate);
// 获取对应日期的事件
const getEvents = dateString => {
@@ -76,7 +76,7 @@
};
const monthRange = getCurrentMonthRange();
params.value = monthRange;
console.log('params.value', params.value);
const getJobEventBar = () => {
  getCalen(params.value).then(res => {