Bladeren bron

Merge branch 'v1.2.0-ga' of http://192.168.0.115:3000/bill/fuse-code into v1.2.0-ga

xzw 4 maanden geleden
bovenliggende
commit
cdbe7ae1aa

+ 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
+}

+ 5 - 4
src/sdk/association/path.ts

@@ -9,6 +9,8 @@ import { analysisPose, setPose } from ".";
 import { custom, showModeTabStack, showPathsStack, showPathStack, showSearchStack, showViewSettingStack } from "@/env";
 import { Message } from "bill/expose-common";
 import { mergeFuns } from "@/components/drawing/hook";
+import { ams } from "@/store/animation";
+import { fuseModels } from "@/store";
 
 // -----------------导览线关联--------------------
 export type PathNode = Path;
@@ -51,10 +53,9 @@ export const playScenePath = async (
   forceFull = false,
 ) => {
   const node = getPathNode(path)
-  console.log(path, node)
-  if (!node) {
-    console.error('un', path.id)
-    return Message.error('路径所在模型被隐藏活删除,无法播放');
+  // console.error('un', path.points, fuseModels.value)
+  if (!node || path.points.some(point => !fuseModels.value.some(am => am.id === point.modelId))) {
+    return Message.error('路径所在模型被删除,无法播放');
   }
 
   // showPathsStack.push(ref(false))

+ 2 - 1
src/views/animation/index.vue

@@ -187,6 +187,7 @@ watchEffect((onCleanup) => {
 
   am3d.bus.on("transformChanged", updateMat);
 
+  console.error(frameAction.value, am3d);
   switch (frameAction.value) {
     case "translate":
       am3d.enterMoveMode();
@@ -205,7 +206,7 @@ watchEffect((onCleanup) => {
 });
 
 const updateFocus = (am?: AnimationModel) => {
-  if (focusAM.value) {
+  if (focusAM.value && focusAM.value !== am) {
     asyncOper(focusAM.value, (item) => {
       item.changeSelect(false);
     });

+ 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,