|
@@ -53,7 +53,7 @@ interface SliceImage {
|
|
|
const { origImageUrls = "sliceUrls" } = defineProps<{
|
|
|
origImageUrls?: "sheetUrls" | "sliceUrls";
|
|
|
}>();
|
|
|
-const emit = defineEmits(["error"]);
|
|
|
+const emit = defineEmits(["error", "getIsMultComments"]);
|
|
|
|
|
|
const { dragContainer } = dragImage();
|
|
|
|
|
@@ -62,7 +62,10 @@ const { addTimeout } = useTimers();
|
|
|
let sliceImagesWithTrackList: SliceImage[] = reactive([]);
|
|
|
let maxImageWidth = 0;
|
|
|
|
|
|
-function addColorAttr(tList: (Track | SpecialTag)[]) : (Track | SpecialTag)[] {
|
|
|
+function addColorAttr(
|
|
|
+ tList: (Track | SpecialTag)[],
|
|
|
+ isTrack?: boolean
|
|
|
+): (Track | SpecialTag)[] {
|
|
|
let markerIds: (number | undefined)[] = tList
|
|
|
.map((v) => v.markerId)
|
|
|
.filter((x) => !!x);
|
|
@@ -79,6 +82,9 @@ function addColorAttr(tList: (Track | SpecialTag)[]) : (Track | SpecialTag)[] {
|
|
|
colorMap[mId + ""] = "green";
|
|
|
}
|
|
|
}
|
|
|
+ if (Object.keys(colorMap).length > 1) {
|
|
|
+ emit("getIsMultComments", true);
|
|
|
+ }
|
|
|
tList = tList.map((item: Track | SpecialTag) => {
|
|
|
item.color = colorMap[item.markerId + ""] || "red";
|
|
|
return item;
|
|
@@ -107,15 +113,17 @@ async function processImage() {
|
|
|
.map((q) => {
|
|
|
let tList = q.trackList;
|
|
|
|
|
|
- return addColorAttr(tList);
|
|
|
+ return addColorAttr(tList, true);
|
|
|
})
|
|
|
.flat();
|
|
|
const thisImageTrackList = trackLists.filter(
|
|
|
(t) => t.offsetIndex === indexInSliceUrls
|
|
|
);
|
|
|
- const thisImageTagList = addColorAttr((store.currentTask.specialTagList || [])
|
|
|
- .filter((t) => t.offsetIndex === indexInSliceUrls))
|
|
|
-
|
|
|
+ const thisImageTagList = addColorAttr(
|
|
|
+ (store.currentTask.specialTagList || []).filter(
|
|
|
+ (t) => t.offsetIndex === indexInSliceUrls
|
|
|
+ )
|
|
|
+ );
|
|
|
|
|
|
sliceImagesWithTrackList.push({
|
|
|
url,
|