|
|
@@ -42,7 +42,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
|
+ import { ref, onMounted, onBeforeUnmount, getCurrentInstance} from 'vue'
|
|
|
import * as THREE from 'three'
|
|
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
|
|
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'
|
|
|
@@ -58,6 +58,7 @@
|
|
|
import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js';
|
|
|
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
|
|
|
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
|
+ import { ElLoading } from 'element-plus'
|
|
|
|
|
|
const dom = ref<HTMLDivElement>()
|
|
|
let maxLength = 3600;
|
|
|
@@ -512,6 +513,12 @@
|
|
|
|
|
|
|
|
|
const loadScene = () => {
|
|
|
+ const loading = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: 'Loading',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
var sceneJson = localStorage.getItem('scene');
|
|
|
if (sceneJson) {
|
|
|
// // 将 sceneJson 字符串转换为 json 对象
|
|
|
@@ -531,6 +538,7 @@
|
|
|
}
|
|
|
const axes = initAxesHelper(1000)
|
|
|
scene.add(axes)
|
|
|
+ loading.close();
|
|
|
return;
|
|
|
}
|
|
|
};
|