tremble 3 年之前
父節點
當前提交
66a92bbe50

+ 4 - 16
packages/qjkankan-editor/src/framework/EditorMain.vue

@@ -4,14 +4,7 @@
     <!-- 左侧菜单栏 -->
     <app-menu class="app-menu"></app-menu>
     <!-- 作品预览区域。无论切换至哪个菜单页面,始终存在。-->
-    <div
-      class="app-player"
-      ref="layer"
-      v-show="$route.meta.hasPreviewArea"
-      :style="{
-        left: $route.meta.previewAreaExtraLeft + 58 + 'px'
-      }"
-    />
+    <app-play />
     <!-- 其余 -->
     <div class="app-view">
       <keep-alive>
@@ -22,11 +15,13 @@
 </template>
 <script>
 import AppMenu from "./MenuPC";
+import AppPlay from "./play/index.vue";
 
 export default {
   name: "editor-main",
   components: {
     AppMenu,
+    AppPlay
   },
   created() {},
   async mounted() {},
@@ -44,14 +39,7 @@ export default {
   > .app-menu {
     flex: 0 0 auto;
   }
-  > .app-player {
-    position: absolute;
-    top: 0;
-    height: 100%;
-    left: 58px;
-    right: 274px;
-    background-color: yellow;
-  }
+
   > .app-view {
     position: relative;
     flex: 1 0 auto;

+ 39 - 0
packages/qjkankan-editor/src/framework/play/index.vue

@@ -0,0 +1,39 @@
+<template>
+  <div
+    class="app-player"
+    ref="layer"
+    v-show="$route.meta.hasPreviewArea"
+    :style="{
+      left: $route.meta.previewAreaExtraLeft + 58 + 'px',
+    }"
+  >
+    <iframe :src="`http://192.168.20.41:8081/show.html?isEdit=1&id=${number}`" frameborder="0"></iframe>
+  </div>
+</template>
+
+<script>
+import config from "@/config";
+
+export default {
+  data() {
+    return {
+      number: config.projectNum,
+    };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.app-player {
+  position: absolute;
+  top: 0;
+  height: 100%;
+  left: 58px;
+  right: 274px;
+  z-index: 999;
+  > iframe {
+    width: 100%;
+    height: 100%;
+  }
+}
+</style>

+ 15 - 1
packages/qjkankan-view/src/components/Pano/index.vue

@@ -5,12 +5,26 @@
 <script setup>
 import { ref, onMounted, computed, watch, nextTick } from "vue";
 import { useStore } from 'vuex'
-import { useApp } from "@/app";
+import { useApp,getApp } from "@/app";
 
 const store = useStore()
 
 const currentScene = computed(() => store.getters["scene/currentScene"]);
 
+
+const loadScene = async (currentScene)=>{
+  let app = await getApp()
+  console.log(app.krpanoDom.get(`scene[scene_fd720_hhtjj9wye].content`),'currentScene');
+  // app.krpanoDom.get('xml.scene')
+  
+  // app.krpanoDom.krpano.call(`skin_loadscene('scene_${sceneCode}',${this.ccs.initVisual.vlookat},${this.ccs.initVisual.hlookat})`);
+}
+
+watch(currentScene,()=>{
+  console.log(currentScene.value,'currentScene.value');
+  loadScene(currentScene.value)
+})
+
 useApp().then((app) => {
     app.Tags.on("clickHotspot", (data) => {
       let { id } = data;

+ 11 - 4
packages/qjkankan-view/src/components/UIGather/index.vue

@@ -1,9 +1,13 @@
 <template>
-  <Logo/>
-  <Tips/>
+  <template v-if="!isEdit">
+      <Logo/>
+      <Tips/>
+      <Control />
+      <Menu />
+  </template>
+
   <List />
-  <Control />
-  <Menu />
+
 </template>
 
 <script setup>
@@ -12,6 +16,9 @@ import Tips from "./tips";
 import List from "./list";
 import Control from "./control";
 import Menu from "./menu";
+import browser from "@/utils/browser"
 
+import { ref } from "vue";
 
+const isEdit = ref(browser.urlQueryValue('isEdit'));
 </script>

+ 2 - 0
packages/qjkankan-view/src/pages/show.vue

@@ -32,6 +32,8 @@ const store = useStore();
 const show = ref(false);
 const workEnable = ref(true);
 
+
+
 const currentScene = computed(() => store.getters["scene/currentScene"]);
 
 onMounted(async () => {

+ 3 - 1
packages/qjkankan-view/src/store/modules/scene.js

@@ -66,7 +66,9 @@ export default {
         payload.children.forEach((item) => {
           state.metadata.catalogs.forEach((sub) => {
             if (item == sub.id) {
-              temp.push(sub);
+              if (state.list.some(iii=>iii.category == sub.id)) {
+                temp.push(sub);
+              }
             }
           });
         });