From 0d5f70bbcf830f6c3aebf92a0b865a04c9d7f263 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 27 Jun 2025 11:28:12 +0800
Subject: [PATCH] feat:系统管理---二级页面样式调整
---
src/views/dataCenter/dataCenter.vue | 259 +++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 205 insertions(+), 54 deletions(-)
diff --git a/src/views/dataCenter/dataCenter.vue b/src/views/dataCenter/dataCenter.vue
index 69a17cd..3676273 100644
--- a/src/views/dataCenter/dataCenter.vue
+++ b/src/views/dataCenter/dataCenter.vue
@@ -1,4 +1,5 @@
<template>
+<basic-container>
<div class="dataCenter-table">
<searchData
@search="searchClick"
@@ -25,7 +26,11 @@
}}
</template>
</el-table-column>
- <el-table-column prop="regionName" label="所属区域" />
+ <el-table-column prop="regionName" label="所属区域" v-if="!isDistrictLevel">
+ <template #default="scope">
+ <span>{{ processAddress(scope.row.regionName) }}</span>
+ </template>
+ </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 />
@@ -76,15 +81,14 @@
<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
+ >删除</span
>
- <!-- && !isTifFile(scope.row.nickName)
- scope.row.resultType !== 1-->
+
<span
class="location"
@click="positionDetail(scope.row)"
- v-if="shouldShowLocation(scope.row)"
- >定位</span
+ v-if="shouldShowLocation(scope.row)"
+ >定位</span
>
</template>
</el-table-column>
@@ -112,15 +116,33 @@
</template>
<div class="detailContainer">
<div class="leftImg">
- <img
+ <!-- <img
v-if="dialogDetailList?.resultType === 1"
:src="convertVideoUrlToThumbnail(dialogDetailList?.link)"
alt=""
class="imageBox"
- />
+ /> -->
+ <!-- 视频 -->
+ <video
+ v-if="dialogDetailList?.resultType === 1"
+ style="width: 100%"
+ class="imageBox"
+ ref="videoRefs"
+ controls
+ autoplay
+ :src="dialogDetailList.link"
+ ></video>
+ <!-- 全景 -->
+ <!-- <img
+ class="quanjing"
+ @click="clickpanorama(dialogDetailList)"
+ v-else-if="dialogDetailList?.resultType === 5"
+ :src="dialogDetailList?.resultType?.smallUrl"
+ alt=""
+ /> -->
<!-- 地图 -->
<div
- v-if="dialogDetailList?.resultType === 4"
+ v-else-if="dialogDetailList?.resultType === 4"
id="detaildataCenterMap"
class="ztzf-cesium"
></div>
@@ -130,7 +152,7 @@
<div class="title">
<div class="inputEdit">
文件名称:<span class="fileTitle" v-if="!dialogDetailList?.checkedinput">{{
- dialogDetailList?.nickName
+ dialogDetailList?.nickName ? dialogDetailList?.nickName : '--'
}}</span>
<el-input
v-else
@@ -142,7 +164,7 @@
</div>
<div class="editname">
<span v-if="!dialogDetailList?.checkedinput" @click="editTitle(dialogDetailList)"
- ><el-icon><Edit /></el-icon
+ ><el-icon><Edit /></el-icon
></span>
<div v-else class="suffixBoxEdit">
<div class="editText" @click="submitEditSuffix(dialogDetailList)">✔</div>
@@ -150,26 +172,48 @@
</div>
</div>
</div>
- <div>任务名称:{{ dialogDetailList?.jobName }}</div>
- <div>所属区域:{{ dialogDetailList?.regionName }}</div>
- <div>拍摄机巢:{{ dialogDetailList?.nestName }}</div>
+ <div>任务名称:{{ dialogDetailList?.jobName ? dialogDetailList?.jobName : '--' }}</div>
+ <div>
+ 所属区域:{{ dialogDetailList?.regionName ? dialogDetailList?.regionName : '--' }}
+ </div>
+ <div>拍摄机巢:{{ dialogDetailList?.nestName ? dialogDetailList?.nestName : '--' }}</div>
<div>
照片位置:{{ _.round(dialogDetailList?.longitude, 3) }},{{
_.round(dialogDetailList?.latitude, 3)
}}
</div>
- <div>任务时间:{{ dialogDetailList?.jobTime }}</div>
- <div>拍摄时间:{{ dialogDetailList?.createTime }}</div>
- <div>文件类型:{{ photoTypeMap[dialogDetailList?.photoType] }}</div>
- <div>文件格式:{{ resultTypeMap[dialogDetailList?.resultType] }}</div>
- <div>照片文件大小:{{ bytesToMB(dialogDetailList?.attachSize) }}</div>
+ <div>任务时间:{{ dialogDetailList?.jobTime ? dialogDetailList?.jobTime : '--' }}</div>
+ <div>
+ 拍摄时间:{{ dialogDetailList?.createTime ? dialogDetailList?.createTime : '--' }}
+ </div>
+ <div>
+ 文件类型:{{
+ photoTypeMap[dialogDetailList?.photoType]
+ ? photoTypeMap[dialogDetailList?.photoType]
+ : '--'
+ }}
+ </div>
+ <div>
+ 文件格式:{{
+ resultTypeMap[dialogDetailList?.resultType]
+ ? resultTypeMap[dialogDetailList?.resultType]
+ : '--'
+ }}
+ </div>
+ <div>
+ 照片文件大小:{{
+ bytesToMB(dialogDetailList?.attachSize)
+ ? bytesToMB(dialogDetailList?.attachSize)
+ : '--'
+ }}
+ </div>
<div>
<el-button
type="success"
plain
icon="el-icon-download"
@click="detailDownLoad(dialogDetailList)"
- >下载</el-button
+ >下载</el-button
>
</div>
</div>
@@ -211,6 +255,7 @@
:dotData="mapList"
></dataCenterMap>
</div>
+ </basic-container>
</template>
<script setup>
@@ -221,6 +266,7 @@
import EventPopUpBox from '@/hooks/components/EventPopUpBox.vue';
import { nextTick, render } from 'vue';
import defaultIcon from '@/assets/images/dataCenter/datamap/eventCompleted.png';
+const userInfo = computed(() => store.getters.userInfo);
const isShow = defineModel('show');
const viewerRef = shallowRef(null);
let viewer = null;
@@ -248,6 +294,7 @@
import { getShowImg, getSmallImg, getzsSmallImg } from '@/utils/util';
import { onMounted, watch } from 'vue';
import dayjs from 'dayjs';
+
function bytesToMB(bytes, decimalPlaces = 2) {
if (typeof bytes !== 'number' || bytes < 0) return '无效输入';
return (bytes / 1048576).toFixed(decimalPlaces) + ' MB';
@@ -273,7 +320,39 @@
visible: '可见光',
ir: '红外',
};
+// 判断省市区
+const areaCode = userInfo.value?.detail?.areaCode || '';
+// 判断账号级别
+const isProvinceLevel = computed(() => areaCode.endsWith('00000000')); // 省级:后8位为0
+const isCityLevel = computed(() => !isProvinceLevel.value && areaCode.endsWith('000000')); // 市级:后6位为0
+const isDistrictLevel = computed(() => !isProvinceLevel.value && !isCityLevel.value); // 区县级
+// 处理区域名称的函数
+function processAddress(str) {
+ if (!str) return '';
+
+ const parts = str.split(',');
+
+ // 省级账号:显示市和区(去除省级)
+ if (isProvinceLevel.value) {
+ return parts.filter(part => !part.endsWith('省')).join(',');
+ }
+
+ // 市级账号:只显示区(去除省和市)
+ if (isCityLevel.value) {
+ return parts.filter(part => !part.endsWith('省') && !part.endsWith('市')).join(',');
+ }
+
+ // 区县级账号:不显示区域信息(在模板中已隐藏该列)
+ return '';
+}
+const showRegionColumn = computed(() => {
+ // 检查表格数据中是否有任何行的 regionName 处理后不为空
+ return tableData.value.some(row => {
+ const processed = processAddress(row.regionName || '');
+ return processed !== '';
+ });
+});
const loadings = ref(true);
let loading;
const total = ref(0);
@@ -322,7 +401,7 @@
showUrl: getShowImg(i?.link),
file_name: i.name.split('/').pop(),
}));
- // console.log('res', tableData.value);
+
loadings.value = false;
}
);
@@ -480,8 +559,8 @@
// 保存文件名
const saveTitle = item => {
const updateparams = {
- id: Number(item.id),
- nickName: item.nickName,
+ id: item.id,
+ nickName: `${item.nickName.trim()}`,
};
// 验证并提示
if (!validateNickname(updateparams.nickName, '名称')) return;
@@ -491,6 +570,7 @@
.then(res => {
if (res.status === 200) {
ElMessage.success('修改成功');
+ getaiImagesPage();
} else {
ElMessage.error(res.data.message || '修改失败');
}
@@ -502,7 +582,6 @@
};
// 正射地图
const yxShowBox = ref(false);
-
const removeHandler = () => {
handler?.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
handler?.destroy();
@@ -530,36 +609,38 @@
// console.log('地图初始化完成');
};
-// 查看弹框
+// 判断是否是正射
function isTifFile(filename) {
const lastDot = filename.lastIndexOf('.');
if (lastDot === -1) return false; // 无后缀
return filename.slice(lastDot + 1).toLowerCase() === 'tif';
}
-const shouldShowLocation=(row)=>{
-return row.resultType !== 1 && row.resultType !== 4
-}
+const shouldShowLocation = row => {
+ return row.resultType !== 1 && row.resultType !== 4;
+};
+// 查看弹框
const dialogVisible = ref(false);
const dialogDetailList = ref(null);
const detailTitle = ref('');
let curCustomImageryProvider = null;
const orthoimageApi = ref('');
+const positiongeom = ref('');
const odmToken = ref(null);
const lookDetail = val => {
- // console.log('查看', val);
if (val.resultType === 4) {
// 正射
getOrthoimageInfo(val.wayLineJobId).then(async res => {
dialogVisible.value = true;
- // console.log('正射', res.data.data);
detailTitle.value = val.nickName;
- dialogDetailList.value = val;
- await nextTick()
+ dialogDetailList.value = val;
+ console.log('3333', detailTitle.value, dialogDetailList.value);
+
+ await nextTick();
initMap();
+ positiongeom.value = res.data.data.geom;
orthoimageApi.value = res.data.data.orthoimageApi;
odmToken.value = res.data.data.odmToken;
if (res.data.data != null && isMapInitialized.value === true) {
- // console.log('viewer', viewer);
curCustomImageryProvider = viewInstance.value.addCustomImageryProviderDataSource(
new Cesium.UrlTemplateImageryProvider({
url: `${import.meta.env.VITE_APP_AREA_NAME}/webodm${res.data.data.orthoimageApi}?jwt=${
@@ -567,28 +648,63 @@
}`,
// maximumLevel: 12,
})
-
);
-
yxShowBox.value = true;
+ // 添加定位
+ if (positiongeom.value) {
+ // 解析WKT格式的多边形坐标
+ const wktString = positiongeom.value;
+ const coordinates = parseWKTCoordinates(wktString);
+ if (coordinates.length > 0) {
+ // 创建多边形边界
+ const positions = coordinates.map(coord =>
+ Cesium.Cartesian3.fromDegrees(coord[0], coord[1])
+ );
+ // 计算多边形的包围球
+ const boundingSphere = Cesium.BoundingSphere.fromPoints(positions);
+ const viewer = viewInstance.value.getViewer();
+ if (viewer && viewer.camera) {
+ viewer.camera.flyToBoundingSphere(boundingSphere, {
+ duration: 0, // 飞行动画持续时间(秒)
+ offset: new Cesium.HeadingPitchRange(0, -0.5, boundingSphere.radius * 1.5),
+ });
+ } else {
+ console.error('无法获取有效的 Viewer 或 camera 对象');
+ }
+ }
+ }
}
-
});
} else {
getAttachInfoAPI(val.id).then(res => {
- detailTitle.value = res.data.data.nickName;
- dialogDetailList.value = res.data.data;
- dialogDetailList.value = { ...res.data.data, checkedinput: false };
+ detailTitle.value = res.data.data.nickName.split('.jpeg')[0];
+ dialogDetailList.value = {
+ ...res.data.data,
+ checkedinput: false,
+ editName: res.data.data?.nickName?.split('.jpeg')[0],
+ };
dialogVisible.value = true;
});
}
};
-
-function dialogClose(){
- // 对话框关闭时清理资源
- viewInstance.value?.viewerDestroy();
- viewer = null;
- isMapInitialized.value = false;
+// WKT坐标解析函数
+function parseWKTCoordinates(wktString) {
+ // 解析POLYGON格式的WKT字符串
+ const regex = /POLYGON\s*\(\((.*?)\)\)/i;
+ const match = wktString.match(regex);
+ if (!match || !match[1]) return [];
+ // 分割坐标对
+ const coordinatePairs = match[1].split(/,\s*/);
+ return coordinatePairs.map(pair => {
+ const [lon, lat] = pair.trim().split(/\s+/).map(Number);
+ return [lon, lat];
+ });
+}
+function dialogClose() {
+ // 对话框关闭时清理资源
+ viewInstance.value?.viewerDestroy();
+ viewer = null;
+ isMapInitialized.value = false;
}
onMounted(() => {
getaiImagesPage();
@@ -608,32 +724,40 @@
<style scoped lang="scss">
.dataCenter-table {
- margin: 0 18px 16px 10px;
- background-color: #ffffff;
- padding: 14px 18px;
+ height: 0;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+
.dataTable {
- height: 700px;
+ height: 0;
+ flex: 1;
overflow: auto;
+
.look {
color: #1c5cff;
cursor: pointer;
margin-right: 10px;
}
+
.delete {
color: #ff241c;
margin-right: 10px;
cursor: pointer;
}
+
.location {
color: #19876d;
cursor: pointer;
}
}
+
.pagination {
display: flex;
justify-content: end;
margin-top: 20px;
}
+
.quanjing,
.el-image,
.imageBox {
@@ -641,54 +765,70 @@
width: 76px;
height: 72px;
}
+
.videoDialog :deep(.el-dialog) {
height: 600px;
width: 54%;
}
+
.video-container {
width: 100%;
- aspect-ratio: 16/9; /* 按视频比例设置(如16:9) */
- overflow: hidden; /* 隐藏溢出部分 */
+ aspect-ratio: 16/9;
+ /* 按视频比例设置(如16:9) */
+ overflow: hidden;
+ /* 隐藏溢出部分 */
}
+
.videoBox {
width: 100%;
height: 100%;
- object-fit: contain; /* 保持比例完整显示 */
+ object-fit: contain;
+ /* 保持比例完整显示 */
display: block;
}
}
+
:deep(.custom-header th.el-table__cell) {
color: rgba(0, 0, 0, 0.85);
}
+
// 弹框
.detailContainer {
display: flex;
justify-content: space-between;
+
.leftImg {
width: 70%;
height: 500px;
+
img {
width: 100%;
height: 100%;
}
+
#detaildataCenterMap {
width: 100%;
height: 100%;
}
}
+
.rightDetail {
width: 30%;
padding-left: 40px;
+
.title {
display: flex;
margin: 0 !important;
+
.editname {
cursor: pointer;
}
+
.inputEdit {
display: flex;
align-items: center;
width: 100%;
+
.fileTitle {
width: 70%;
white-space: nowrap;
@@ -697,49 +837,60 @@
}
}
}
+
div {
margin-bottom: 20px;
}
}
}
+
.my-header :deep(.el-dialog__title) {
margin: 0 !important;
height: 19px;
}
+
.my-header {
display: flex;
align-items: center;
+
.el-button {
margin-left: 20px;
}
}
+
.title-input {
margin-bottom: 0 !important;
width: 70%;
}
+
.editname {
margin-bottom: 0 !important;
}
+
.suffixBoxEdit {
display: flex;
// align-items: center;
justify-content: space-between;
margin-bottom: 0 !important;
font-size: 16px;
- > .editText {
+
+ >.editText {
cursor: pointer;
margin-right: 6px;
+
&:hover {
transform: scale(1.2);
}
}
+
.editimg {
cursor: pointer;
width: 15px;
height: 15px;
+
&:hover {
transform: scale(1.2);
}
}
}
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.9.3