From fa45209c5007d8c84bcc14a2fbcdc236f4758213 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 17 Jun 2025 10:48:22 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v2.0.0/后台管理数据中心'
---
src/views/dataCenter/dataCenter.vue | 126 +++++++++++++++++++++--------------------
1 files changed, 65 insertions(+), 61 deletions(-)
diff --git a/src/views/dataCenter/dataCenter.vue b/src/views/dataCenter/dataCenter.vue
index 50543cd..69a17cd 100644
--- a/src/views/dataCenter/dataCenter.vue
+++ b/src/views/dataCenter/dataCenter.vue
@@ -78,11 +78,12 @@
<span class="delete" @click="deleteDetail(scope.row)" v-if="scope.row.resultType !== 2"
>删除</span
>
- <!-- && !isTifFile(scope.row.nickName) -->
+ <!-- && !isTifFile(scope.row.nickName)
+ scope.row.resultType !== 1-->
<span
class="location"
@click="positionDetail(scope.row)"
- v-if="scope.row.resultType !== 1"
+ v-if="shouldShowLocation(scope.row)"
>定位</span
>
</template>
@@ -103,7 +104,7 @@
/>
</div>
<!-- 查看弹框 -->
- <el-dialog v-model="dialogVisible" width="60%" append-to-body>
+ <el-dialog v-model="dialogVisible" width="60%" append-to-body @close="dialogClose">
<template #header="{ titleId, titleClass }">
<div class="my-header">
<h4 :id="titleId" :class="titleClass">{{ detailTitle }}</h4>
@@ -218,7 +219,7 @@
import { Cartesian3 } from 'cesium';
import * as Cesium from 'cesium';
import EventPopUpBox from '@/hooks/components/EventPopUpBox.vue';
-import { render } from 'vue';
+import { nextTick, render } from 'vue';
import defaultIcon from '@/assets/images/dataCenter/datamap/eventCompleted.png';
const isShow = defineModel('show');
const viewerRef = shallowRef(null);
@@ -272,6 +273,7 @@
visible: '可见光',
ir: '红外',
};
+
const loadings = ref(true);
let loading;
const total = ref(0);
@@ -424,6 +426,7 @@
const params = {
...jobListParams.searchParams,
};
+ params.areaCode = '';
downloadApi(params).then(res => {
aLinkDownload(res.data.data, `sjzx-file-pack-${dayjs().format('YYYYMMDDHHmmss')}.zip`);
loading.close();
@@ -497,52 +500,6 @@
console.error('API error:', error);
});
};
-
-// 查看弹框
-function isTifFile(filename) {
- const lastDot = filename.lastIndexOf('.');
- if (lastDot === -1) return false; // 无后缀
- return filename.slice(lastDot + 1).toLowerCase() === 'tif';
-}
-const dialogVisible = ref(false);
-const dialogDetailList = ref(null);
-const detailTitle = ref('');
-let curCustomImageryProvider = null;
-const lookDetail = val => {
- console.log('查看', val);
- if (val.resultType === 4) {
- // 正射
- getOrthoimageInfo(val.wayLineJobId).then(res => {
- console.log('正射', res.data.data);
- detailTitle.value = val.nickName;
- dialogDetailList.value = val;
- 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=${
- res.data.data.odmToken.split(' ')[1]
- }`,
-
- })
- );
-
- yxShowBox.value = true;
- }
- dialogVisible.value = true;
- });
- } else {
- getAttachInfoAPI(val.id).then(res => {
- detailTitle.value = res.data.data.nickName;
- dialogDetailList.value = res.data.data;
- dialogDetailList.value = { ...res.data.data, checkedinput: false };
- // console.log('detailTitle.value',dialogDetailList.value);
- dialogVisible.value = true;
- });
- }
-};
-
// 正射地图
const yxShowBox = ref(false);
@@ -568,24 +525,71 @@
});
viewer = viewInstance.value.getViewer();
viewerRef.value = viewer;
+
isMapInitialized.value = true;
- console.log('地图初始化完成');
+
+ // console.log('地图初始化完成');
};
-// 监听对话框状态
-watch(dialogVisible, newVal => {
- if (newVal) {
- nextTick(() => {
+// 查看弹框
+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 dialogVisible = ref(false);
+const dialogDetailList = ref(null);
+const detailTitle = ref('');
+let curCustomImageryProvider = null;
+const orthoimageApi = 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()
initMap();
+ 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=${
+ res.data.data.odmToken.split(' ')[1]
+ }`,
+ // maximumLevel: 12,
+ })
+
+ );
+
+ yxShowBox.value = true;
+ }
+
});
} else {
- // 对话框关闭时清理资源
+ getAttachInfoAPI(val.id).then(res => {
+ detailTitle.value = res.data.data.nickName;
+ dialogDetailList.value = res.data.data;
+ dialogDetailList.value = { ...res.data.data, checkedinput: false };
+ dialogVisible.value = true;
+ });
+ }
+};
+
+function dialogClose(){
+ // 对话框关闭时清理资源
viewInstance.value?.viewerDestroy();
viewer = null;
isMapInitialized.value = false;
- // removeHandler();
- }
-});
-
+}
onMounted(() => {
getaiImagesPage();
// 监听打开全景事件
@@ -597,7 +601,7 @@
onBeforeUnmount(() => {
// 组件卸载时移除事件监听,防止内存泄漏
EventBus.off('open-panorama');
- viewInstance.value.removeAllCustomImageryProviderDataSource(curCustomImageryProvider);
+ viewInstance.value?.removeAllCustomImageryProviderDataSource(curCustomImageryProvider);
viewInstance.value?.viewerDestroy();
});
</script>
--
Gitblit v1.9.3