index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <div class="layer">
  3. <ly-top class="top" />
  4. <div class="content">
  5. <router-view v-slot="{ Component }" v-if="isSystem">
  6. <component :is="Component" />
  7. </router-view>
  8. <template v-else>
  9. <ly-slide class="slide" :names="menuRouteNames" v-if="!hiddenSlide" />
  10. <div class="view" :class="{ full: hiddenSlide }">
  11. <div class="app-wrap m-4" v-if="!hiddenSlide">
  12. <div
  13. class="app-scene"
  14. ref="sceneRef"
  15. :style="{
  16. width: '100%',
  17. height: 'calc(100% - 24px)',
  18. // display: showScene ? 'none' : 'block'
  19. }"
  20. >
  21. <!-- @load="setupSDK($event.target)" -->
  22. <iframe
  23. v-if="sceneURL"
  24. :src="sceneURL"
  25. frameborder="0"
  26. :style="{ width: '100%', height: '100%' }"
  27. ></iframe>
  28. </div>
  29. </div>
  30. <div class="main p-4">
  31. <router-view v-slot="{ Component }">
  32. <component :is="Component" />
  33. </router-view>
  34. </div>
  35. </div>
  36. </template>
  37. </div>
  38. </div>
  39. </template>
  40. <script lang="ts" setup>
  41. import lyTop from "./top/index.vue";
  42. import lySlide from "./slide/index.vue";
  43. import { routeIsSystem, router } from "@/router";
  44. import { computed, ref } from "vue";
  45. import { menuRouteNames } from "@/app";
  46. import { updateByTreeFileLists } from "@/store/case";
  47. console.log(menuRouteNames, 'menuRouteNames', router.currentRoute.value.name);
  48. const sceneURL = ref('https://test.4dkankan.com/spg.html?m=KK-t-iN6cFCdwibf')
  49. const isSystem = computed(() => routeIsSystem());
  50. updateByTreeFileLists()
  51. const hiddenSlide = computed(
  52. () => !menuRouteNames.includes(router.currentRoute.value.name as string)
  53. );
  54. </script>
  55. <style lang="scss" scoped>
  56. .layer {
  57. position: absolute;
  58. z-index: 1;
  59. width: 100%;
  60. height: 100%;
  61. display: flex;
  62. flex-direction: column;
  63. .top {
  64. flex: 0 0 auto;
  65. }
  66. .content {
  67. flex: 1 0;
  68. display: flex;
  69. overflow: hidden;
  70. .slide {
  71. width: 16.66rem;
  72. flex: 0 0 auto;
  73. }
  74. .view {
  75. flex: 0 0 auto;
  76. width: calc(100% - 16.66rem);
  77. background-color: var(--bgColor);
  78. // flex-direction: column;
  79. display: flex;
  80. &.full {
  81. width: 100%;
  82. }
  83. .app-wrap, .app-view {
  84. width: calc(100% - 320px);
  85. height: 100%;
  86. }
  87. .player {
  88. flex: 0 0 auto;
  89. height: 32px;
  90. }
  91. .main {
  92. margin: 0 0px 10px 0;
  93. display: flex;
  94. flex-direction: column;
  95. overflow: hidden;
  96. flex: 1;
  97. background: #fff;
  98. }
  99. }
  100. }
  101. }
  102. </style>