diff --git a/src/views/dashboard/components/PointModal.vue b/src/views/dashboard/components/PointModal.vue index b77ceff..dd1122e 100644 --- a/src/views/dashboard/components/PointModal.vue +++ b/src/views/dashboard/components/PointModal.vue @@ -41,7 +41,6 @@ let renderer; // 新增加载状态和进度 const loading = ref(false); const progress = ref(0); - // 处理对话框关闭事件 const handleClose = () => { if (pcdContainer.value) { @@ -96,6 +95,10 @@ let camera; const pcdLoaded = ref(false); const onDialogOpened = () => { + // 检查点云数据URL是否存在 + if (!props.info.point_cloud_url) { + return; + } if (pcdContainer.value) { scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera( @@ -115,7 +118,7 @@ const onDialogOpened = () => { // 开始加载,设置加载状态为 true loading.value = true; loader.load( - "three/mod.pcd", + props.info.point_cloud_url, function (pointCloud) { // 加载完成,设置加载状态为 false loading.value = false;