Ver Fonte

Merge branch 'hotfix_release_v1.3.9_20230113' of http://git.qmth.com.cn/markingcloud/stmms-web into hotfix_release_v1.3.9_20230217

刘洋 há 2 anos atrás
pai
commit
f999c56386

+ 25 - 12
src/devLoginParams.ts

@@ -9,14 +9,27 @@
 // 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: "178",
+  // markerId: "482",
+  // markerId: "483",
+};
 // export const LOGIN_CONFIG = {
 //   isAdmin: false,
-//   forceChange: true,
-//   loginName: "1-339-5-1",
+//   forceChange: false,
+//   loginName: "spj111-01",
+//   // loginName: "spj432-01",
 //   // loginName: "liuyang",
 //   password: "123456",
-//   examId: "1",
-//   markerId: "147",
+//   examId: "232",
+//   markerId: "2688",
+//   // markerId: "2692",
 //   // markerId: "482",
 //   // markerId: "483",
 // };
@@ -36,14 +49,14 @@
 //   // markerId: "483",
 // };
 /** 224 管理员 */
-export const LOGIN_CONFIG = {
-  isAdmin: true,
-  forceChange: true,
-  loginName: "admin-test",
-  password: "123456",
-  examId: "1",
-  markerId: "339",
-};
+// export const LOGIN_CONFIG = {
+//   isAdmin: true,
+//   forceChange: true,
+//   loginName: "admin-test",
+//   password: "123456",
+//   examId: "1",
+//   markerId: "339",
+// };
 
 /** 255 评卷员 */
 // export const LOGIN_CONFIG = {

+ 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) {

+ 15 - 6
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 = "回评",
@@ -162,16 +163,16 @@ const currentTaskChange = async () => {
       });
     } catch (e) {
       // 恢复以前的行为,取回评失败则评卷任务为空
-      replaceCurrentTask(undefined);
+      await replaceCurrentTask(undefined);
     } finally {
       // store.globalMask = false;
       if(store.setting?.examType !== 'SCAN_IMAGE'){
         store.globalMask = false;
       }
     }
-    replaceCurrentTask(store.historyTasks[0]);
+    await replaceCurrentTask(store.historyTasks[0]);
   } else {
-    replaceCurrentTask(store.tasks[0]);
+    await replaceCurrentTask(store.tasks[0]);
     store.historyTasks.splice(0);
     secretNumberInput = "";
     currentPage = 1;
@@ -256,15 +257,23 @@ 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) {
+  console.log('replaceCurrentTask:',task);
   store.currentTask = task;
+  
+  if (store.isScanImage && !!task) {
+    await preDrawImage(task);
+  }
 }
 
 function previousPage() {

+ 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; // 最大的裁切块宽度,图片容器以此为准

+ 2 - 2
vite.config.ts

@@ -3,8 +3,8 @@ 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.224";
-// const SERVER_URL = "https://www.markingcloud.com";
+// const SERVER_URL = "http://192.168.10.224";
+const SERVER_URL = "https://www.markingcloud.com";
 const path = require("path");
 
 function mockDevLogin(): Plugin {