From cffd1da3e8aa72ebfd8ebfe4b4a765a245c3ee84 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Wed, 13 Aug 2025 17:34:20 +0800
Subject: [PATCH] feat:修改地图颜色
---
src/views/dataCenter/dataCenter.vue | 327 ++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 266 insertions(+), 61 deletions(-)
diff --git a/src/views/dataCenter/dataCenter.vue b/src/views/dataCenter/dataCenter.vue
index 31fa8ad..501ffe4 100644
--- a/src/views/dataCenter/dataCenter.vue
+++ b/src/views/dataCenter/dataCenter.vue
@@ -4,19 +4,39 @@
>
<div class="dataCenter-table">
<searchData
+ :searchjobId="searchjobId"
+ :switchFolders="switchFolders"
@search="searchClick"
@downFun="downloadFile"
@allDownFun="aLLDownloadFile"
+ @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">
+ <div class="dataTable" v-else>
<el-table
+ border
+ stripe
v-loading="loadings"
element-loading-text="加载中"
- stripe
:data="tableData"
class="custom-header"
@selection-change="handleSelectionChange"
+ @cell-click="handleCellClick"
>
<el-table-column type="selection" width="55" />
<el-table-column label="序号" type="index" width="60">
@@ -35,7 +55,14 @@
</el-table-column>
<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 prop="nickName" label="文件名称" width="160">
+ <template #default="scope">
+ <el-tooltip-copy :content="scope.row.nickName" :showCopyText="true">
+ {{scope.row.nickName}}
+ </el-tooltip-copy>
+ </template>
+ </el-table-column>
+
<el-table-column property="link" label="缩略图" width="120">
<template #default="scope">
<img
@@ -45,13 +72,21 @@
:src="scope.row?.smallUrl"
alt=""
/>
- <img
- v-else-if="scope.row?.resultType === 1"
- :src="convertVideoUrlToThumbnail(scope.row?.link)"
- alt=""
- class="imageBox"
- @click="enterFullScreen(scope.row)"
- />
+ <!-- 视频 -->
+ <div v-else-if="scope.row?.resultType === 1" class="videoItem1">
+ <img
+ :src="convertVideoUrlToThumbnail(scope.row?.link)"
+ alt=""
+ class="imageBox"
+ @click="enterFullScreen(scope.row)"
+ />
+ <img
+ class="playBox"
+ @click="enterFullScreen(scope.row)"
+ src="@/assets/images/dataCenter/videoplay.png"
+ alt=""
+ />
+ </div>
<!-- 正射 -->
<el-image
v-else-if="scope.row?.resultType === 4"
@@ -73,7 +108,7 @@
<el-table-column property="photoType" label="文件类别">
<template #default="scope">
<span>{{
- photoTypeMap[scope.row.photoType] ? photoTypeMap[scope.row.photoType] : 'tif'
+ photoTypeMap[scope.row.photoType] ? photoTypeMap[scope.row.photoType] : '--'
}}</span>
</template>
</el-table-column>
@@ -82,21 +117,24 @@
<span>{{ resultTypeMap[row?.resultType] }}</span>
</template>
</el-table-column>
- <el-table-column label="操作" width="150" align="center">
+ <el-table-column label="操作" width="200" align="center">
<template #default="scope">
- <span class="look" @click="lookDetail(scope.row)">查看</span>
- <span
- class="delete"
- @click="deleteDetail(scope.row)"
- v-if="scope.row.resultType !== 2"
- >删除</span
+ <el-button icon="el-icon-view" type="text" @click="lookDetail(scope.row)"
+ >查看</el-button
>
-
- <span
- class="location"
- @click="positionDetail(scope.row)"
+ <el-button
+ v-if="scope.row.resultType !== 2"
+ icon="el-icon-delete"
+ type="text"
+ @click="deleteDetail(scope.row)"
+ >删除</el-button
+ >
+ <el-button
v-if="shouldShowLocation(scope.row)"
- >定位</span
+ type="text"
+ @click="positionDetail(scope.row)"
+ >
+ <img :src="positionicon" class="custom-icon" />定位</el-button
>
</template>
</el-table-column>
@@ -104,16 +142,16 @@
</div>
<!-- 分页 -->
<div class="pagination">
- <el-pagination
- v-model:current-page="jobListParams.current"
- v-model:page-size="jobListParams.size"
- :page-sizes="[10, 20, 30, 40]"
- background
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
+ <el-pagination
+ :current-page="switchFolders ? FolderListParams.page : jobListParams.current"
+ :page-size="switchFolders ? FolderListParams.page_size : jobListParams.size"
+ :page-sizes="[10, 20, 30, 40]"
+ background
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="total"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ />
</div>
<!-- 查看弹框 -->
<el-dialog
@@ -188,7 +226,7 @@
文件类型:{{
photoTypeMap[dialogDetailList?.photoType]
? photoTypeMap[dialogDetailList?.photoType]
- : 'tif'
+ : '--'
}}
</div>
<div>
@@ -258,6 +296,13 @@
</template>
<script setup>
+import fileimg from '@/assets/images/dataCenter/filePackage.png'
+import { getShowImg, getSmallImg, getzsSmallImg } from '@/utils/util';
+import { onMounted, watch } from 'vue';
+import dayjs from 'dayjs';
+import ElTooltipCopy from '@/components/ElTooltipCopy.vue';
+import videoplay from '@/assets/images/dataCenter/videoplay.png';
+import positionicon from '@/assets/images/dataCenter/positionicon.png';
import { useStore } from 'vuex';
import { PublicCesium } from '@/utils/cesium/publicCesium';
import { Cartesian3 } from 'cesium';
@@ -286,11 +331,9 @@
deleteFileMultipleApi,
downloadApi,
updataTitleApi,
- getOrthoimageInfo,
+ getOrthoimageInfo, getDownloadStatusApi,getJobIdsBySnApi
} from '@/api/dataCenter/dataCenter';
-import { getShowImg, getSmallImg, getzsSmallImg } from '@/utils/util';
-import { onMounted, watch } from 'vue';
-import dayjs from 'dayjs';
+const switchFolders = ref(false)
function bytesToMB(bytes, decimalPlaces = 2) {
if (typeof bytes !== 'number' || bytes < 0) return '0';
@@ -374,6 +417,14 @@
orderByCreateTime: true,
searchParams: { startTime: timeRange[0], endTime: timeRange[1] },
});
+const FolderListParams = reactive({
+ page: 1,
+ page_size: 30,
+ startTime: jobListParams.searchParams.startTime?.slice(0, 10),
+ endTime: jobListParams.searchParams.endTime?.slice(0, 10),
+ waylineName:'',
+
+});
const tableData = ref([]);
// 获取列表数据
@@ -383,7 +434,6 @@
orderByCreateTime: jobListParams.orderByCreateTime,
...jobListParams.searchParams,
};
-
getaiImagesPageAPI(params, {
current: jobListParams.current,
size: jobListParams.size,
@@ -400,27 +450,86 @@
}));
})
.catch(error => {
- // 可选:这里可以添加错误处理逻辑
console.error('获取数据失败:', error);
})
.finally(() => {
- loadings.value = false; // 无论成功失败都会执行
+ loadings.value = false;
});
};
+const folderList = ref([])
+// 获取文件夹数据
+const getFolderList=()=>{
+ loadings.value = true;
+ const apiParams = {
+ ...FolderListParams,
+ };
+ getJobIdsBySnApi(apiParams)
+ .then(res => {
+ folderList.value = res.data.data.records.map(i => ({ ...i, checked: false }))
+ total.value = res.data.data.total
+ })
+ .finally(() => {
+ 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();
+ }
+};
+// 切换文件夹
+ const handleswitchFolders = () => {
+ switchFolders.value = !switchFolders.value;
+ jobListParams.current = 1;
+ FolderListParams.page = 1;
+ fetchData();
+ };
// 查询
const searchClick = params => {
- jobListParams.current = 1;
- jobListParams.size = 10;
- jobListParams.searchParams = params;
- getaiImagesPage();
+ 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,
+ getFolderList()
+ }else{
+ jobListParams.current = 1;
+ jobListParams.size = 10;
+ jobListParams.searchParams = {
+ ...jobListParams.searchParams,
+ ...params
+ };
+ getaiImagesPage()
+ }
};
-const handleSizeChange = val => {
- jobListParams.size = val;
- getaiImagesPage();
+const handleSizeChange = (val) => {
+ if (switchFolders.value) {
+ FolderListParams.page_size = val;
+ } else {
+ jobListParams.size = val;
+ }
+ fetchData();
};
-const handleCurrentChange = val => {
- jobListParams.current = val;
- getaiImagesPage();
+const handleCurrentChange = (val) => {
+ if (switchFolders.value) {
+ FolderListParams.page = val;
+ } else {
+ jobListParams.current = val;
+ }
+ fetchData();
};
// 多选
const selectedRows = ref([]);
@@ -461,7 +570,7 @@
a.click();
document.body.removeChild(a);
}
-const fileDownload = () => {
+const fileDownload = async () => {
const list = selectedRows.value.filter(i => i.checked);
if (!list?.length) return ElMessage.warning('请选择文件');
if (list.length === 1) {
@@ -482,18 +591,32 @@
jobName: '',
resultType: '',
startTime: '',
- wayLineJobIds: [],
+ type:'htsjzx'
};
-
- downloadApi(aaa).then(res => {
- aLinkDownload(res.data.data, `sjzx-file-pack-${dayjs().format('YYYYMMDDHHmmss')}.zip`);
+ const res = await getDownloadStatusApi({type: 'htsjzx'})
+ if (!['CANCELLED','COMPLETED'].includes(res.data.data?.status || 'COMPLETED')){
+ loading.close()
+ return ElMessage.warning('还有正在处理的')
+ }
+ downloadApi(aaa).finally(res => {
loading.close();
});
}
};
+// 文件夹打包下载
+async function folderDownload() {
+ const jobId = folderList.value.filter(i => i.checked).map(i => i.job_id)
+ if (!jobId?.length) return ElMessage.warning('请选择文件夹')
+ const res = await getDownloadStatusApi({type: 'dpsjzx'})
+ if (!['CANCELLED','COMPLETED'].includes(res.data.data?.status || 'COMPLETED')){
+ return ElMessage.warning('还有正在处理的')
+ }
+ await downloadApi({ wayLineJobIds:jobId, withFolder: true, resultType: 0, type:'htsjzx' })
+}
// 下载
const downloadFile = () => {
- fileDownload();
+
+ switchFolders.value?folderDownload(): fileDownload();
};
const detailDownLoad = val => {
const suffix = val.link?.split('.').pop();
@@ -697,6 +820,13 @@
viewer = null;
isMapInitialized.value = false;
}
+function handleCellClick(row, column) {
+ if (column.no === 5) {
+ navigator.clipboard.writeText(row.nickName).then(() => {
+ ElMessage.success('复制文件名称成功')
+ })
+ }
+}
onMounted(() => {
getaiImagesPage();
// 监听打开全景事件
@@ -712,7 +842,6 @@
viewInstance.value?.viewerDestroy();
});
</script>
-
<style scoped lang="scss">
.dataCenter-table {
height: 0;
@@ -730,7 +859,12 @@
cursor: pointer;
margin-right: 10px;
}
-
+ .custom-icon {
+ width: 14px;
+ height: 14px;
+ margin-right: 5px;
+ vertical-align: middle;
+ }
.delete {
color: #ff241c;
margin-right: 10px;
@@ -742,7 +876,67 @@
cursor: pointer;
}
}
+ .fileshow {
+ 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;
+ position: relative;
+ background: #ddd;
+ cursor: pointer;
+ img {
+ width: 111px;
+ height: 111px;
+
+ }
+ .el-checkbox {
+ position: absolute;
+ top: 0;
+ left: 6px;
+ }
+
+ .itemName {
+ position: absolute;
+ bottom: 0;
+ 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;
+ font-weight: 400;
+ font-size: 14px;
+ color: #ffffff;
+ line-height: 23px;
+
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ div {
+ white-space: nowrap;
+ }
+
+ img {
+ width: 14px;
+ height: 14px;
+ cursor: pointer;
+ }
+ }
+ }
+ }
.pagination {
display: flex;
justify-content: end;
@@ -756,7 +950,17 @@
width: 76px;
height: 72px;
}
-
+ .videoItem1 {
+ .playBox {
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ top: 46%;
+ left: 43%;
+ transform: translate(-50%, -50%);
+ cursor: pointer;
+ }
+ }
.videoDialog :deep(.el-dialog) {
height: 600px;
width: 54%;
@@ -781,6 +985,7 @@
:deep(.custom-header th.el-table__cell) {
color: rgba(0, 0, 0, 0.85);
+ background: #fafafa;
}
// 弹框
@@ -888,4 +1093,4 @@
}
}
}
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.9.3