Преглед изворни кода

回评对图片的异步问题的自测修复

刘洋 пре 2 година
родитељ
комит
b82c4cced5

+ 5 - 3
src/devLoginParams.ts

@@ -12,11 +12,13 @@
 export const LOGIN_CONFIG = {
   isAdmin: false,
   forceChange: true,
-  loginName: "1-339-5-1",
+  loginName: "411402137YB-1-242",
+  // loginName: "spj432-01",
   // loginName: "liuyang",
   password: "123456",
-  examId: "1",
-  markerId: "178",
+  examId: "592",
+  markerId: "28480",
+  // markerId: "2692",
   // markerId: "482",
   // markerId: "483",
 };

+ 1 - 1
src/features/mark/CommonMarkBody.vue

@@ -515,7 +515,7 @@ const renderPaperAndMark = async () => {
 watch(
   () => store.currentTask,
   () => {
-    setTimeout(renderPaperAndMark,1)
+    setTimeout(renderPaperAndMark,50)
   }
 );
 //#endregion : 计算裁切图和裁切图上的分数轨迹和特殊标记轨迹

+ 2 - 1
src/features/mark/MarkHistory.vue

@@ -269,11 +269,12 @@ async function updateHistoryTask({
 
 async function replaceCurrentTask(task: Task | undefined) {
   console.log('replaceCurrentTask:',task);
-  store.currentTask = task;
   
   if (store.isScanImage && !!task) {
     await preDrawImage(task);
   }
+  store.currentTask = task;
+
 }
 
 function previousPage() {

+ 2 - 1
src/utils/utils.ts

@@ -174,7 +174,8 @@ export async function preDrawImage(_currentTask: Task | undefined) {
 
   let maxSliceWidth = 0; // 最大的裁切块宽度,图片容器以此为准
 
-  const hasSliceConfig = store.currentTask?.sliceConfig?.length;
+  // const hasSliceConfig = store.currentTask?.sliceConfig?.length;
+  const hasSliceConfig = _currentTask?.sliceConfig?.length;
 
   const images = [];