Browse Source

Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

xushiting 2 years ago
parent
commit
533ee349bf

File diff suppressed because it is too large
+ 13684 - 13661
public/static/lib/potree/potree.js


File diff suppressed because it is too large
+ 1 - 1
public/static/lib/potree/potree.js.map


+ 4 - 0
src/assets/public.scss

@@ -12,6 +12,10 @@ a {
 #app {
   width: 100%;
   height: 100%;
+  position: absolute;
+  overflow: hidden;
+  left: 0;
+  top: 0;
 }
 
 .clear-float::after {

+ 4 - 0
src/sdk/laser/core/enter.js

@@ -81,6 +81,10 @@ var enter = ({
 
     sceneBus.on("visible", (v) => {
         viewer.visible = v;
+        
+        /* if(v){
+            viewer.dispatchEvent('content_changed') //避免白屏
+        } */
         //console.log('sceneBus visible', v)
     });
 

+ 18 - 5
src/views/scene/container.vue

@@ -5,22 +5,32 @@
 </template>
 
 <script setup lang="ts">
-import {onMounted, ref, watchEffect} from "vue";
+import {onActivated, onDeactivated, onMounted, ref, watchEffect} from "vue";
 import {customMap, disabledMap, setupLaser, useLoading, useParams} from "@/hook";
 import {store} from "@/store";
 import {currentApp} from "@/store/app";
-import {axios} from "@/dbo/";
 import {Loading} from '@kankan/components/index'
-import {Mode} from "@/sdk";
+import {LaserSDK, Mode} from "@/sdk";
 import {api} from "@/store/sync";
 
 const emit = defineEmits<{ (e: 'loaded'): void }>()
 const sceneLayoutRef = ref<HTMLCanvasElement>();
+const active = ref(true)
+
+onActivated(() => active.value = true)
+onDeactivated(() => active.value = false)
+
+const handlerSDK = (sdk: LaserSDK) => {
+  watchEffect(() => {
+    console.log("visible", active.value)
+    sdk.scene.emit("visible", active.value)
+  })
+}
 
 onMounted(async () => {
   console.log(currentApp.basePath);
   console.log("加载场景数据")
-  await useLoading(
+  const sdk = await useLoading(
     setupLaser({
       sceneSelector: sceneLayoutRef.value,
       num: useParams().m,
@@ -40,7 +50,6 @@ onMounted(async () => {
   setTimeout(() => {
     watchEffect(() => {
       const doms = Array.from(sceneLayoutRef.value.querySelectorAll("#navCube, #home")) as HTMLElement[]
-      console.log("====>", disabledMap.mode)
       if (!disabledMap.mode) {
         if (customMap.mode === Mode.pano) {
           doms.forEach(dom => {
@@ -52,11 +61,14 @@ onMounted(async () => {
           })
         }
       }
+      handlerSDK(sdk)
     })
     Loading.hideAll()
   }, 1000)
 });
 
+
+
 </script>
 
 <style scoped lang="scss">
@@ -83,6 +95,7 @@ onMounted(async () => {
 .canvas-layout  {
   #navCube,
   #home {
+    position: absolute !important;
     right: var(--boundMargin) !important;
     top: var(--boundMargin) !important;
   }

+ 5 - 5
src/views/scene/menus/menus.ts

@@ -27,11 +27,11 @@ export enum menuEnum {
 }
 
 export const menus: MenuRaw[] = [
-  {
-    icon: "save",
-    text: "保存",
-    key: menuEnum.SAVE
-  },
+  // {
+  //   icon: "save",
+  //   text: "保存",
+  //   key: menuEnum.SAVE
+  // },
   {
     icon: "clear",
     text: "清除",