bill преди 2 години
родител
ревизия
e3e14639b6
променени са 3 файла, в които са добавени 7 реда и са изтрити 5 реда
  1. 4 2
      src/hook/useGraphic.ts
  2. 1 1
      src/store/sync.ts
  3. 2 2
      src/views/roads/tabulation.vue

+ 4 - 2
src/hook/useGraphic.ts

@@ -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" }
     );
   });

+ 1 - 1
src/store/sync.ts

@@ -62,7 +62,7 @@ export const api = !global.android
           paths[paths.length - 1].includes(type)
         );
         if (notBase64) {
-          // await new Promise((resolve) => setTimeout(resolve, 2000));
+          await new Promise((resolve) => setTimeout(resolve, 2000));
           return baseURL + url;
         } else {
           const data = await axios.get(url, { responseType: "blob" });

+ 2 - 2
src/views/roads/tabulation.vue

@@ -200,8 +200,8 @@ const onBack = () => {
   });
 };
 
-// const downMode = ref(false);
-const downMode = ref(true);
+const downMode = ref(false);
+// const downMode = ref(true);
 const layoutRef = ref<HTMLDivElement>();
 const getLayoutImage = async () => {
   downMode.value = true;