Эх сурвалжийг харах

回评任务的w和h突然变为0的兼容处理

刘洋 2 жил өмнө
parent
commit
17bbb7671b

+ 17 - 17
src/devLoginParams.ts

@@ -9,30 +9,30 @@
 // export const markerId="419";
 
 /** 244 评卷员 */
-// export const LOGIN_CONFIG = {
-//   isAdmin: false,
-//   forceChange: true,
-//   loginName: "1-339-5-1",
-//   // loginName: "liuyang",
-//   password: "123456",
-//   examId: "1",
-//   markerId: "147",
-//   // markerId: "482",
-//   // markerId: "483",
-// };
 export const LOGIN_CONFIG = {
   isAdmin: false,
-  forceChange: false,
-  loginName: "spj111-01",
-  // loginName: "spj432-01",
+  forceChange: true,
+  loginName: "1-339-5-1",
   // loginName: "liuyang",
   password: "123456",
-  examId: "232",
-  markerId: "2688",
-  // markerId: "2692",
+  examId: "1",
+  markerId: "178",
   // markerId: "482",
   // markerId: "483",
 };
+// export const LOGIN_CONFIG = {
+//   isAdmin: false,
+//   forceChange: false,
+//   loginName: "spj111-01",
+//   // loginName: "spj432-01",
+//   // loginName: "liuyang",
+//   password: "123456",
+//   examId: "232",
+//   markerId: "2688",
+//   // markerId: "2692",
+//   // markerId: "482",
+//   // markerId: "483",
+// };
 /** 224 管理员 */
 // export const LOGIN_CONFIG = {
 //   isAdmin: true,

+ 2 - 0
src/features/mark/CommonMarkBody.vue

@@ -460,6 +460,8 @@ async function processSplitConfig() {
 // should not render twice at the same time
 let renderLock = false;
 const renderPaperAndMark = async () => {
+  console.log('renderPagerAndMark=>store.curTask:',store.currentTask);
+  
   if (!store.currentTask) return;
   if (!store.isScanImage) return;
   if (renderLock) {

+ 10 - 3
src/features/mark/MarkHistory.vue

@@ -116,7 +116,8 @@ import {
 } from "@ant-design/icons-vue";
 import { cloneDeep } from "lodash-es";
 import EventBus from "@/plugins/eventBus";
-import { addFileServerPrefixToTask } from "@/utils/utils";
+import { addFileServerPrefixToTask,preDrawImage} from "@/utils/utils";
+import { message } from "ant-design-vue";
 
 const {
   title = "回评",
@@ -253,14 +254,20 @@ async function updateHistoryTask({
     let data = cloneDeep(res.data) ;
     data = data.map(addFileServerPrefixToTask);
     store.historyTasks = data;
-    replaceCurrentTask(store.historyTasks[0]);
+    replaceCurrentTask(store.historyTasks[0]).catch((err)=>{
+      console.log(err);
+      void message.error('切换至回评任务失败');
+    });
   }
   if(!res?.data || !res?.data.length){
     store.globalMask = false;
   }
 }
 
-function replaceCurrentTask(task: Task | undefined) {
+async function replaceCurrentTask(task: Task | undefined) {
+  if (store.isScanImage) {
+    await preDrawImage(task);
+  }
   store.currentTask = task;
 }
 

+ 3 - 1
src/utils/utils.ts

@@ -167,7 +167,9 @@ export async function getDataUrlForSplitConfig(
   return dataurl;
 }
 
-export async function preDrawImage(_currentTask: Task) {
+export async function preDrawImage(_currentTask: Task | undefined) {
+  console.log('preDrawImage=>curTask:',store.currentTask);
+  
   if (!_currentTask?.libraryId) return;
 
   let maxSliceWidth = 0; // 最大的裁切块宽度,图片容器以此为准

+ 1 - 1
vite.config.ts

@@ -3,7 +3,7 @@ import vue from "@vitejs/plugin-vue";
 import ViteComponents from "unplugin-vue-components/vite";
 import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
 
-const SERVER_URL = "http://192.168.10.225";
+const SERVER_URL = "http://192.168.10.224";
 const path = require("path");
 
 function mockDevLogin(): Plugin {