|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div
|
|
|
- v-if="show && posStyle"
|
|
|
+ v-if="task3D && show && posStyle"
|
|
|
class="hot-item pc"
|
|
|
:style="posStyle"
|
|
|
@mouseenter="isHover = true"
|
|
|
@@ -78,6 +78,7 @@ import type { Tagging, TaggingPosition } from "@/store";
|
|
|
import { useCameraChange, usePixel } from "@/hook/use-pixel";
|
|
|
import { inRevise } from "bill/utils";
|
|
|
import { defStyleType } from "@/api";
|
|
|
+import mitt from "mitt";
|
|
|
|
|
|
export type SignProps = { tagging: Tagging; scenePos: TaggingPosition; show?: boolean };
|
|
|
|
|
|
@@ -94,7 +95,6 @@ const emit = defineEmits<{
|
|
|
const desc = ref<HTMLDivElement>();
|
|
|
const showDesc = computed(() => {
|
|
|
const a = desc.value?.innerText.trim();
|
|
|
- console.error("--aaa->", desc.value, a);
|
|
|
return a;
|
|
|
});
|
|
|
|
|
|
@@ -112,15 +112,34 @@ const queryItems = computed(() =>
|
|
|
}))
|
|
|
);
|
|
|
const taggingStyle = computed(() => getTaggingStyle(props.tagging.styleId));
|
|
|
-const tag = markRaw(
|
|
|
- sdk.createTagging({
|
|
|
- ...props.scenePos,
|
|
|
- title: props.tagging.title,
|
|
|
- position: props.scenePos.localPos,
|
|
|
- canMove: false,
|
|
|
- image: getFileUrl(taggingStyle.value!.icon),
|
|
|
- })
|
|
|
-) as TaggingPositionNode;
|
|
|
+let task3D = sdk.createTagging({
|
|
|
+ ...props.scenePos,
|
|
|
+ title: props.tagging.title,
|
|
|
+ position: props.scenePos.localPos,
|
|
|
+ canMove: false,
|
|
|
+ image: getFileUrl(taggingStyle.value!.icon),
|
|
|
+});
|
|
|
+if (!task3D) {
|
|
|
+ emit("delete");
|
|
|
+}
|
|
|
+const emptyfn = () => {};
|
|
|
+const tag = (task3D
|
|
|
+ ? markRaw(task3D)
|
|
|
+ : {
|
|
|
+ changeCanMove: emptyfn,
|
|
|
+ changeMat: emptyfn,
|
|
|
+ changeFontSize: emptyfn,
|
|
|
+ changeTitle: emptyfn,
|
|
|
+ visibilityTitle: emptyfn,
|
|
|
+ changeType: emptyfn,
|
|
|
+ changeImage: emptyfn,
|
|
|
+ changePosition: emptyfn,
|
|
|
+ changeLineHeight: emptyfn,
|
|
|
+ visibility: emptyfn,
|
|
|
+ getImageCenter: emptyfn,
|
|
|
+ bus: mitt(),
|
|
|
+ destroy: emptyfn,
|
|
|
+ }) as TaggingPositionNode;
|
|
|
const showDelete = ref(false);
|
|
|
tag.showDelete = (show) => {
|
|
|
showDelete.value = show;
|
|
|
@@ -308,6 +327,7 @@ defineExpose(tag);
|
|
|
p {
|
|
|
margin-bottom: 10px;
|
|
|
display: flex;
|
|
|
+
|
|
|
span {
|
|
|
flex: 0 0 auto;
|
|
|
}
|