bill 4 mesiacov pred
rodič
commit
8cb0cc2cc8

+ 2 - 2
src/layout/model-list/sign.vue

@@ -57,7 +57,6 @@ const props = defineProps<ModelProps>();
 const active = computed(
   () => custom.currentModel === props.model && currentModel.value === fuseModel
 );
-const supportPano = ref(false);
 // if (sceneModel) {
 //   sceneModel.bus.on("loadDone", () => {
 //     supportPano.value = sceneModel.supportPano();
@@ -70,9 +69,10 @@ type ModelEmits = {
   (e: "click", mode: "pano" | "fuse"): void;
 };
 defineEmits<ModelEmits>();
-const show = getFuseModelShowVariable(props.model);
 onMounted(() => console.error("mount", custom.showModelsMap.get(props.model)));
 
+const supportPano = ref(false);
+const show = getFuseModelShowVariable(props.model);
 watchEffect(() => {
   if (!show.value) {
     supportPano.value = false;

+ 25 - 5
src/sdk/association/fuseMode.ts

@@ -1,5 +1,5 @@
 import { SDK, SceneModel, ModelAttrRange } from "../sdk";
-import { toRaw, watch, reactive, ref } from "vue";
+import { toRaw, watch, reactive, ref, watchEffect } from "vue";
 import { custom, getResource } from "@/env";
 import {
   diffArrayChange,
@@ -179,13 +179,13 @@ export const activeModel = (status: {
   if (model && status.active === oldStatus.active) {
     if (status.showMode === "pano") {
       if (model) {
-        model.changeSelect(false)
+        // model.changeSelect(false)
         model.flyInPano();
       }
     } else {
       if (model) {
         model.flyOutPano();
-        custom.currentModel === status.active && model.changeSelect(true)
+        // custom.currentModel === status.active && model.changeSelect(true)
       }
     }
   } else {
@@ -193,13 +193,13 @@ export const activeModel = (status: {
       if (oldStatus.showMode === "pano") {
         if (oldModel) {
           oldModel.flyOutPano();
-          custom.currentModel === oldStatus.active && oldModel.changeSelect(true)
+          // custom.currentModel === oldStatus.active && oldModel.changeSelect(true)
         }
       }
     }
     if (status.showMode === "pano") {
       if (model) {
-        model.changeSelect(false)
+        // model.changeSelect(false)
         model.flyInPano();
       }
     } else {
@@ -301,3 +301,23 @@ export const associationModels = (sdk: SDK) => {
     );
   });
 };
+
+
+export const getSupportPano = (model: FuseModel) => {
+const supportPano = ref(false);
+const show = getFuseModelShowVariable(model);
+watchEffect(() => {
+  if (!show.value) {
+    supportPano.value = false;
+    return;
+  }
+  const sceneModel = getSceneModel(model);
+  const support = sceneModel?.supportPano();
+  supportPano.value = !!support;
+
+  sceneModel?.bus.on("loadDone", () => {
+    supportPano.value = sceneModel?.supportPano();
+  });
+});
+return supportPano
+}

+ 6 - 2
src/views/merge/index.vue

@@ -1,6 +1,10 @@
 <template>
   <RightPano
-    v-if="custom.currentModel && active && custom.showMode === 'fuse'"
+    v-if="
+      custom.currentModel &&
+      active &&
+      (custom.showMode === 'fuse' || !getSceneModel(custom.currentModel)?.supportPano())
+    "
     class="merge-layout"
   >
     <div class="actions-group">
@@ -59,7 +63,7 @@ import { RoutesName, router } from "@/router";
 import { RightPano } from "@/layout";
 import { autoSaveFuseModels, defaultFuseModelAttrs, isOld } from "@/store";
 import { asyncTimeout, togetherCallback } from "@/utils";
-import { sdk, getSceneModel, modelRange, getFuseModel } from "@/sdk";
+import { sdk, getSceneModel, modelRange, getFuseModel, getSupportPano } from "@/sdk";
 import { useViewStack, useActive } from "@/hook";
 import {
   showLeftPanoStack,