zhangjie 1 жил өмнө
parent
commit
a9ded6c6e6

+ 33 - 18
src/features/arbitrate/Arbitrate.vue

@@ -109,18 +109,18 @@ async function updateTask() {
     res = await getOneOfStuTask();
   }
   void message.success({
-    content: res.data.studentId ? "获取成功" : "无任务",
+    content: res.data ? "获取成功" : "当前评卷任务",
     key: mkey,
   });
 
-  if (res.data.studentId) {
+  if (res.data) {
     let rawTask = res.data;
     rawTask.sheetUrls = rawTask.sheetUrls || [];
     // rawTask.sheetUrls = ["/1-1.jpg", "/1-2.jpg"];
     rawTask.sliceUrls = [...rawTask.sheetUrls];
     store.currentTask = rawTask;
   } else {
-    store.message = res.data.message || "无任务";
+    store.message = "当前评卷任务";
   }
 }
 
@@ -176,9 +176,9 @@ const saveTaskToServer = async (
   if (!store.currentTask) return;
   const markResult = store.currentTask.markResult;
   if (!markResult) return;
-  console.log("save inspect task to server");
+
   const mkey = "save_task_key";
-  void message.loading({ content: "保存评卷任务...", key: mkey });
+
   let res;
   if (unselective) {
     res = await saveArbitrateTask(
@@ -195,6 +195,7 @@ const saveTaskToServer = async (
       error: string;
     };
     const errors: SubmitError[] = [];
+
     markResult.scoreList.forEach((score, index) => {
       if (!store.currentTask) return;
       const question = store.currentTask.questionList[index];
@@ -235,19 +236,33 @@ const saveTaskToServer = async (
       specialTagList
     );
   }
-  if (res.data.success && store.currentTask) {
-    void message.success({ content: "仲裁成功", key: mkey, duration: 2 });
-    if (!store.historyOpen) {
-      store.currentTask = undefined;
-      if (!isSingleStudent) await fetchTask();
-    } else {
-      EventBus.emit("should-reload-history");
-    }
-  } else if (res.data.message) {
-    console.log(res.data.message);
-    void message.error({ content: res.data.message, key: mkey, duration: 10 });
-  } else if (!store.currentTask) {
-    void message.warn({ content: "暂无新任务", key: mkey, duration: 10 });
+  if (!res.data.success) {
+    void message.error({
+      content: res.data.message || "仲裁失败,请重新尝试!",
+      key: mkey,
+      duration: 5,
+    });
+    return;
+  }
+
+  if (isSingleStudent) {
+    void message.success({
+      content: "仲裁成功,页面将在3秒钟之后关闭",
+      key: mkey,
+      duration: 2,
+    });
+    setTimeout(() => {
+      window.close();
+    }, 3000);
+    return;
+  }
+
+  void message.success({ content: "仲裁成功", key: mkey, duration: 2 });
+  if (!store.historyOpen) {
+    store.currentTask = undefined;
+    await fetchTask();
+  } else {
+    EventBus.emit("should-reload-history");
   }
 };
 

+ 4 - 1
src/features/check/MarkBody.vue

@@ -282,8 +282,11 @@ onUnmounted(() => {
 
 .cursor.cursor--initialized {
   display: block;
+  opacity: 0;
+}
+.cursor.cursor--focused-view {
+  opacity: 1;
 }
-
 .cursor .text {
   font-size: 2rem;
   opacity: 0;