bill 2 年 前
コミット
9101d06ac3

+ 10 - 0
src/components/actions/index.vue

@@ -35,6 +35,16 @@ const clickHandler = (select: ActionsItem) => {
     nextTick(() => selected.value && clickHandler(selected.value))
   }
 }
+
+watch(
+  () => props.current, 
+  () => {
+    if (!props.current && selected.value) {
+      clickHandler(selected.value)
+    }
+  }
+)
+
 watch(selected, (_n, _o, onCleanup) => {
   if (selected.value?.action) {
     const cleanup = selected.value.action()

+ 11 - 2
src/components/tagging/sign.vue

@@ -53,7 +53,7 @@
 </template>
 
 <script lang="ts" setup>
-import { computed, ref, watchEffect, watch } from 'vue'
+import { computed, ref, watchEffect, watch, onUnmounted } from 'vue'
 import { router, RoutesName } from '@/router'
 import UIBubble from 'bill/components/bubble/index.vue'
 import Images from '@/views/tagging/images.vue'
@@ -62,6 +62,7 @@ import { getTaggingStyle, getFuseModel } from '@/store';
 import { getFileUrl } from '@/utils'
 import { sdk } from '@/sdk'
 import { custom, getResource } from '@/env'
+import { useViewStack } from '@/hook'
 
 import type { Tagging, TaggingPosition } from '@/store';
 
@@ -82,8 +83,16 @@ const updatePosStyle = () => {
     }
   }
 }
+
+
+useViewStack(() => {
+  sdk.sceneBus.on('cameraChange', updatePosStyle)
+  return () => {
+    sdk.sceneBus.off('cameraChange', updatePosStyle)
+  }
+})
 watchEffect(updatePosStyle)
-sdk.sceneBus.on('cameraChange', updatePosStyle)
+
 const model = getFuseModel(props.scenePos.modelId)
 model && watch(model, updatePosStyle, { deep: true })
 

+ 9 - 3
src/views/merge/index.vue

@@ -71,7 +71,7 @@ import { togetherCallback } from '@/utils'
 import { getSceneModel, modelRange } from '@/sdk'
 import { useViewStack, useActive } from '@/hook'
 import { showLeftPanoStack, custom, modelsChangeStoreStack, showRightPanoStack } from '@/env'
-import { ref, nextTick, watchEffect, computed } from 'vue'
+import { ref, nextTick, watchEffect, computed, watch } from 'vue'
 import { Dialog } from 'bill/expose-common'
 
 import Actions from '@/components/actions/index.vue'
@@ -92,10 +92,8 @@ const actionItems: ActionsProps['items'] = [
     icon: 'flip',
     text: '旋转',
     action: () => {
-      console.log('enter')
       getSceneModel(custom.currentModel)?.enterRotateMode()
       return () => {
-        console.log('leave la ')
         getSceneModel(custom.currentModel)?.leaveTransform()
       }
     }
@@ -110,6 +108,14 @@ watchEffect(() => {
   }
 })
 
+watch(
+  () => custom.currentModel, 
+  () => {
+    console.log('???')
+    currentItem.value = null;
+  }
+)
+
 const reset = async () => {
   if (custom.currentModel && await Dialog.confirm('确定恢复默认?此操作无法撤销')) {
     Object.assign(custom.currentModel, defaultFuseModelAttrs)