| | |
| | | <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> |
| | |
| | | /> |
| | | </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> |
| | |
| | | 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); |
| | |
| | | visible: '可见光', |
| | | ir: '红外', |
| | | }; |
| | | |
| | | const loadings = ref(true); |
| | | let loading; |
| | | const total = ref(0); |
| | |
| | | const params = { |
| | | ...jobListParams.searchParams, |
| | | }; |
| | | params.areaCode = ''; |
| | | downloadApi(params).then(res => { |
| | | aLinkDownload(res.data.data, `sjzx-file-pack-${dayjs().format('YYYYMMDDHHmmss')}.zip`); |
| | | loading.close(); |
| | |
| | | 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); |
| | | |
| | |
| | | }); |
| | | 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(); |
| | | // 监听打开全景事件 |
| | |
| | | onBeforeUnmount(() => { |
| | | // 组件卸载时移除事件监听,防止内存泄漏 |
| | | EventBus.off('open-panorama'); |
| | | viewInstance.value.removeAllCustomImageryProviderDataSource(curCustomImageryProvider); |
| | | viewInstance.value?.removeAllCustomImageryProviderDataSource(curCustomImageryProvider); |
| | | viewInstance.value?.viewerDestroy(); |
| | | }); |
| | | </script> |