index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <Container
  3. :upload-resourse="uploadResourse"
  4. v-model:full="full"
  5. :ref="(d: any) => (draw = d?.draw)"
  6. >
  7. <template #header>
  8. <Header @selectVR="(scene) => (vrScene = scene)" v-if="inited" />
  9. </template>
  10. <template #slide>
  11. <Slide v-if="inited" />
  12. </template>
  13. <template #cover>
  14. <ShowVR :scene="vrScene" v-if="vrScene" ref="vr" @close="vrScene = undefined" />
  15. </template>
  16. </Container>
  17. <Dialog />
  18. </template>
  19. <script lang="ts" setup>
  20. import Header from "./header.vue";
  21. import Slide from "./slide.vue";
  22. import Container from "../../../components/container/container.vue";
  23. import ShowVR from "../../../components/show-vr.vue";
  24. import { uploadResourse } from "../../req";
  25. import { ref, watch } from "vue";
  26. import { Draw } from "../../../components/container/use-draw";
  27. import { Scene } from "../../../platform/platform-resource";
  28. import Dialog from "../../../dialog/dialog.vue";
  29. import { tabulationData, refreshTabulationData } from "../../store";
  30. const full = ref(false);
  31. const draw = ref<Draw>();
  32. const vrScene = ref<Scene>();
  33. const inited = ref(false);
  34. const init = async (draw: Draw) => {
  35. await refreshTabulationData();
  36. draw.config.showCompass = true;
  37. draw.config.showGrid = false;
  38. draw.config.showLabelLine = false;
  39. draw.config.showComponentSize = false;
  40. draw.store.setStore(tabulationData.value.store);
  41. inited.value = true;
  42. };
  43. watch(draw, (draw) => draw && init(draw));
  44. </script>