bill 4 tháng trước cách đây
mục cha
commit
1914da55c2

+ 2 - 4
src/components/drawing/hook.ts

@@ -554,6 +554,7 @@ export const useDrag = (
   const invMat = useViewerInvertTransform();
 
   const init = (shape: EntityShape, dom: HTMLDivElement, ndx: number) => {
+    console.log(shape)
     shape.on("pointerenter.drag", () => {
       if (downing) return;
       const pop = cursor.push("pointer");
@@ -617,10 +618,7 @@ export const useDrag = (
           ? [...shape.value]
           : [shape.value]
         : [];
-      if (shapes.some((item) => !item)) {
-        return [];
-      }
-      return shapes;
+      return shapes.filter((item) => !!item)
     },
     (shapes, _, onCleanup) => {
       onCleanup(

+ 3 - 0
src/env/index.ts

@@ -19,6 +19,8 @@ export const showMonitorsStack = stackFactory(ref<boolean>(true));
 export const showPathsStack = stackFactory(ref<boolean>(true));
 export const showSearchStack = stackFactory(ref<boolean>(true));
 export const showPathStack = stackFactory(ref<Path["id"]>());
+export const showModeTabStack = stackFactory(ref<boolean>(true));
+
 export const showMeasuresStack = stackFactory(ref<boolean>(true));
 export const showViewSettingStack = stackFactory(ref<boolean>(true));
 export const currentModelStack = stackFactory(ref<FuseModel | null>(null));
@@ -37,6 +39,7 @@ export const custom = flatStacksValue({
   showToolbar: showToolbarStack,
   showRightPano: showRightPanoStack,
   showLeftPano: showLeftPanoStack,
+  showModeTab: showModeTabStack,
   moundLeftPano: moundLeftPanoStack,
   showLeftCtrlPano: showLeftCtrlPanoStack,
   shwoRightCtrlPano: showRightCtrlPanoStack,

+ 1 - 1
src/layout/model-list/index.vue

@@ -20,7 +20,7 @@
     </template>
   </List>
 
-  <Teleport to="#left-pano" v-if="panoModel && currentModel === fuseModel">
+  <Teleport to="#left-pano" v-if="panoModel && currentModel === fuseModel && custom.showLeftPano">
     <div class="mode-tab strengthen">
       <div
         class="mode-icon-layout"

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

@@ -56,8 +56,8 @@ export const playScenePath = async (
     return Message.error('路径所在模型被隐藏活删除,无法播放');
   }
 
-  showPathsStack.push(ref(false))
-  showPathStack.push(ref(path.id))
+  // showPathsStack.push(ref(false))
+  // showPathStack.push(ref(path.id))
 
   
   let initPose: any;
@@ -86,8 +86,8 @@ export const playScenePath = async (
     }
   }, forceFull)
 
-  showPathsStack.pop()
-  showPathStack.pop()
+  // showPathsStack.pop()
+  // showPathStack.pop()
 }
 
 export const pauseScenePath = pauseScene

+ 4 - 1
src/store/path.ts

@@ -65,7 +65,10 @@ export const createPath = (path: Partial<Path> = {}): Path => {
 
 
 let bcPaths: Paths = []
-export const getBackupPaths = () => bcPaths
+export const getBackupPaths = () => {
+  console.log('bcPaths', bcPaths)
+  return bcPaths
+}
 export const backupPaths = () => {
   bcPaths = JSON.parse(JSON.stringify(paths.value))
 }

+ 1 - 1
src/store/sys.ts

@@ -123,10 +123,10 @@ export const autoSetModeCallback = <T extends object>(
     });
 
   const saveCallback = async () => {
-    leaveCallback && sysBus.off("leave", leaveCallback, { last });
     isSave = true;
     try {
       await setting.save();
+      leaveCallback && sysBus.off("leave", leaveCallback, { last });
       setting.backup && setting.backup();
       isSave = false;
     } catch (e) {

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

@@ -59,8 +59,10 @@ import { amMap, getAMKey, currentTime, play } from "@/sdk/association/animation"
 import { sdk, AnimationModel3D } from "@/sdk";
 import {
   showBottomBarStack,
+  showHeadBarStack,
   showLeftCtrlPanoStack,
   showLeftPanoStack,
+  showModeTabStack,
   showRightPanoStack,
   showSearchStack,
 } from "@/env";
@@ -78,7 +80,9 @@ useViewStack(() => {
     showBottomBarStack.push(ref(true)),
     showRightPanoStack.push(showRight),
     showLeftPanoStack.push(ref(true)),
+    showHeadBarStack.push(computed(() => !play.value)),
     showLeftCtrlPanoStack.push(computed(() => !play.value)),
+    showModeTabStack.push(computed(() => !play.value)),
     showSearchStack.push(computed(() => !play.value)),
     watchEffect((onCleanup) => {
       const cleanups: any[] = [];
@@ -259,7 +263,9 @@ const changeSelect = ({ select, unSelect }: Record<string, AnimationModel[]>) =>
     )
   );
 };
-
+onUnmounted(() => {
+  changeSelect({ select: ams.value, unSelect: [] });
+});
 const deleteAm = (am: AnimationModel) => {
   if (am === focusAM.value) {
     activeAttrib.value = undefined;
@@ -271,7 +277,7 @@ const deleteAm = (am: AnimationModel) => {
 let unMount: () => void;
 onUnmounted(
   clickListener(
-    document.querySelector("#layout-app") as HTMLDivElement,
+    document.querySelector("#layout-app .scene-canvas") as HTMLDivElement,
     (pixel) => {
       const pos = sdk.getPositionByScreen(pixel);
       if (!focusAM.value) return;

+ 1 - 1
src/views/guide/guide/sign.vue

@@ -59,7 +59,7 @@ const isEditTitle = useFocus(computed(() => inputRef.value?.vmRef.root));
 watchEffect(() => {
   if (!isEditTitle.value && !props.guide.title.length) {
     isEditTitle.value = true;
-    Message.warning("测量名称不可为空");
+    Message.warning("导览名称不可为空");
   }
 });
 

+ 1 - 1
src/views/guide/path/sign.vue

@@ -67,7 +67,7 @@ const actions = {
 let isCoverClick = false;
 const playHandler = () => {
   isCoverClick = true;
-  node.value?.focus(true);
+  // node.value?.focus(true);
   flyPlayPath(props.path);
 };
 const focus = ref(false);

+ 12 - 3
src/views/registration/index.vue

@@ -72,7 +72,7 @@ import { ControlPanl } from "@/components/control-panl/";
 import { modelRange, getSceneModel, sdk } from "@/sdk";
 import { diffArrayChange } from "@/utils";
 import { useViewStack } from "@/hook";
-import { autoSaveFuseModels, getFuseModel, leave } from "@/store";
+import { autoSaveFuseModels, getFuseModel, leave, selectPaths } from "@/store";
 import { router, RoutesName } from "@/router";
 import {
   currentModelStack,
@@ -85,6 +85,8 @@ import {
 
 import type { ControlExpose } from "@/components/control-panl";
 import { mergeFuns } from "@/components/drawing/hook";
+import { ams } from "@/store/animation";
+import { amMap, getAMKey } from "@/sdk/association/animation";
 
 const isCurrent = computed(
   () => router.currentRoute.value.name === RoutesName.registration
@@ -143,15 +145,22 @@ watchEffect((onCleanup) => {
   if (smodel) {
     smodel.enterAlignment();
     selectOptions.value = [options[0]];
+    const selects = [...selectPaths.selects.value];
+    selectPaths.all.value = false;
+    ams.value.forEach((item) => amMap[getAMKey(item)]?.am?.changeShow(false));
     onCleanup(
       mergeFuns(
         () => {
           smodel.leaveTransform();
           smodel.leaveAlignment();
         },
+        () => {
+          ams.value.forEach((item) => amMap[getAMKey(item)]?.am?.changeShow(true));
+        },
         currentModelStack.push(model as any),
-        showPathStack.push(ref(undefined)),
-        showPathsStack.push(ref(false)),
+        // showPathStack.push(ref(undefined)),
+        // showPathsStack.push(ref(false)),
+        () => selects.forEach((item) => selectPaths.updateSelect(item, true)),
         showTaggingsStack.push(ref(false))
       )
     );