|
@@ -39,14 +39,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { computed, ref, watchEffect } from 'vue'
|
|
|
+import { computed, ref, watchEffect, watch } from 'vue'
|
|
|
import UIBubble from 'bill/components/bubble/index.vue'
|
|
|
import Images from '@/views/tagging/images.vue'
|
|
|
import Preview, { MediaType } from '../static-preview/index.vue'
|
|
|
-import { Tagging, getTaggingStyle } from '@/store';
|
|
|
+import { Tagging, getTaggingStyle, getModel } from '@/store';
|
|
|
import { getFileUrl } from '@/utils'
|
|
|
import { sdk } from '@/sdk'
|
|
|
-import { custom, showTaggingPositionsStack } from '@/env'
|
|
|
+import { custom } from '@/env'
|
|
|
|
|
|
export type SignProps = { tagging: Tagging, scenePos: Tagging['positions'][number], show?: boolean }
|
|
|
|
|
@@ -65,23 +65,27 @@ const updatePosStyle = () => {
|
|
|
}
|
|
|
}
|
|
|
watchEffect(updatePosStyle)
|
|
|
+sdk.sceneBus.on('cameraChange', updatePosStyle)
|
|
|
+const model = getModel(props.scenePos.modelId)
|
|
|
+model && watch(model, updatePosStyle, { deep: true })
|
|
|
+
|
|
|
+
|
|
|
const showContent = computed(() => {
|
|
|
return !~pullIndex.value
|
|
|
- && (
|
|
|
- isHover.value || show.value
|
|
|
- || custom.showTaggingPositions.has(props.scenePos)
|
|
|
- )
|
|
|
+ && (isHover.value || custom.showTaggingPositions.has(props.scenePos))
|
|
|
})
|
|
|
-sdk.sceneBus.on('cameraChange', updatePosStyle)
|
|
|
|
|
|
const taggingStyle = getTaggingStyle(props.tagging.styleId)
|
|
|
|
|
|
const pullIndex = ref(-1)
|
|
|
const isHover = ref(false)
|
|
|
-const show = ref(false)
|
|
|
|
|
|
const iconClickHandler = () => {
|
|
|
- show.value = !show.value
|
|
|
+ if (custom.showTaggingPositions.has(props.scenePos)) {
|
|
|
+ custom.showTaggingPositions.delete(props.scenePos)
|
|
|
+ } else {
|
|
|
+ custom.showTaggingPositions.add(props.scenePos)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
</script>
|
|
@@ -90,6 +94,7 @@ const iconClickHandler = () => {
|
|
|
.hot-item {
|
|
|
pointer-events: all;
|
|
|
position: absolute;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
cursor: pointer;
|
|
|
|
|
|
> img {
|