|
@@ -80,7 +80,7 @@ import ZoomPaper from "@/components/ZoomPaper.vue";
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
useMarkResult?: boolean;
|
|
useMarkResult?: boolean;
|
|
makeTrack: Function;
|
|
makeTrack: Function;
|
|
- store: MarkStore; // 实际上不是同一个store!!! 最新的统一成一个相同的store了. 停止使用,看是否无影响。
|
|
|
|
|
|
+ store: MarkStore; // 以前不是一个类型的store,现在变成一样的了,所以这个可以删掉了,并且可以优化这个组件的使用
|
|
}>();
|
|
}>();
|
|
|
|
|
|
const emit = defineEmits(["error"]);
|
|
const emit = defineEmits(["error"]);
|
|
@@ -147,19 +147,6 @@ let sliceImagesWithTrackList: Array<SliceImage> = reactive([]);
|
|
let maxSliceWidth = 0; // 最大的裁切块宽度,图片容器以此为准
|
|
let maxSliceWidth = 0; // 最大的裁切块宽度,图片容器以此为准
|
|
let theFinalHeight = 0; // 最终宽度,用来定位轨迹在第几张图片,不包括image-seperator高度
|
|
let theFinalHeight = 0; // 最终宽度,用来定位轨迹在第几张图片,不包括image-seperator高度
|
|
|
|
|
|
-async function getImageUsingDataUrl(
|
|
|
|
- dataUrl: string
|
|
|
|
-): Promise<HTMLImageElement> {
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- const image = new Image();
|
|
|
|
- image.src = dataUrl;
|
|
|
|
- image.onload = function () {
|
|
|
|
- resolve(image);
|
|
|
|
- };
|
|
|
|
- image.onerror = reject;
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
async function processSliceConfig() {
|
|
async function processSliceConfig() {
|
|
let markResult = store.currentTask?.markResult as MarkResult;
|
|
let markResult = store.currentTask?.markResult as MarkResult;
|
|
if (useMarkResult) {
|
|
if (useMarkResult) {
|
|
@@ -229,7 +216,7 @@ async function processSliceConfig() {
|
|
(t) => t.offsetIndex === indexInSliceUrls
|
|
(t) => t.offsetIndex === indexInSliceUrls
|
|
);
|
|
);
|
|
|
|
|
|
- const sliceImageRendered = await getImageUsingDataUrl(dataUrl!);
|
|
|
|
|
|
+ const sliceImageRendered = await loadImage(dataUrl!);
|
|
tempSliceImagesWithTrackList.push({
|
|
tempSliceImagesWithTrackList.push({
|
|
url: dataUrl!,
|
|
url: dataUrl!,
|
|
indexInSliceUrls: sliceConfig.i,
|
|
indexInSliceUrls: sliceConfig.i,
|
|
@@ -360,7 +347,7 @@ async function processSplitConfig() {
|
|
const thisImageTagList = tagLists.filter(
|
|
const thisImageTagList = tagLists.filter(
|
|
(t) => t.offsetIndex === indexInSliceUrls
|
|
(t) => t.offsetIndex === indexInSliceUrls
|
|
);
|
|
);
|
|
- const sliceImageRendered = await getImageUsingDataUrl(dataUrl!);
|
|
|
|
|
|
+ const sliceImageRendered = await loadImage(dataUrl!);
|
|
tempSliceImagesWithTrackList.push({
|
|
tempSliceImagesWithTrackList.push({
|
|
url: dataUrl!,
|
|
url: dataUrl!,
|
|
indexInSliceUrls: store.currentTask.sliceUrls.indexOf(url) + 1,
|
|
indexInSliceUrls: store.currentTask.sliceUrls.indexOf(url) + 1,
|