|
@@ -13,6 +13,7 @@ import UIType from "@/graphic/enum/UIEvents";
|
|
|
import type { RoadPhoto } from "@/store/roadPhotos";
|
|
|
import type { AccidentPhoto } from "@/store/accidentPhotos";
|
|
|
import { api } from "@/store/sync";
|
|
|
+import { genUseLoading } from "./useLoading.js";
|
|
|
|
|
|
export type UITypeT = typeof UIType;
|
|
|
export type VectorTypeT = typeof VectorType;
|
|
@@ -58,9 +59,10 @@ export const setCanvas = async (
|
|
|
) => {
|
|
|
await import("../graphic/index.js").then((model) => {
|
|
|
drawRef.value = model.structureDraw(canvas, newsletter, graphicState);
|
|
|
+
|
|
|
watch(
|
|
|
() => data.value?.id,
|
|
|
- async (id, oldId) => {
|
|
|
+ genUseLoading(async (id, oldId) => {
|
|
|
if (data.value) {
|
|
|
oldId && drawRef.value.load.clear();
|
|
|
console.log("load", data.value);
|
|
@@ -72,7 +74,7 @@ export const setCanvas = async (
|
|
|
} else {
|
|
|
drawRef.value.load.clear();
|
|
|
}
|
|
|
- },
|
|
|
+ }) as any,
|
|
|
{ immediate: true, flush: "post" }
|
|
|
);
|
|
|
});
|