|
@@ -0,0 +1,43 @@
|
|
|
+<script setup lang="ts">
|
|
|
+import { useRoute, useRouter } from 'vue-router';
|
|
|
+import { computed, onBeforeUnmount, onMounted } from 'vue';
|
|
|
+import Viewer from '@/components/3d/Viewer.vue';
|
|
|
+
|
|
|
+const route = useRoute();
|
|
|
+const router = useRouter();
|
|
|
+const modelPath = computed(() => (route.query.model as string));
|
|
|
+
|
|
|
+function onFullscreenChange() {
|
|
|
+ if (!document.fullscreenElement)
|
|
|
+ router.back();
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ document.body.requestFullscreen();
|
|
|
+ window.addEventListener('fullscreenchange', onFullscreenChange);
|
|
|
+});
|
|
|
+onBeforeUnmount(() => {
|
|
|
+ window.removeEventListener('fullscreenchange', onFullscreenChange);
|
|
|
+ if (document.fullscreenElement)
|
|
|
+ document.exitFullscreen();
|
|
|
+});
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <!-- 中 3D模型 显示 -->
|
|
|
+ <div class="d-flex flex-col w-100 h-100vh flex-shrink-0 bg-pure">
|
|
|
+ <div v-if="!modelPath" class="h-100 d-flex flex-column justify-center align-center">
|
|
|
+ 暂无可用3D模型数据
|
|
|
+ </div>
|
|
|
+ <Viewer
|
|
|
+ v-else
|
|
|
+ ref="modelRef"
|
|
|
+ class="h-100"
|
|
|
+ :path="modelPath"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+</style>
|