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

feat: 云阅卷1.3.8需求变更
1. 评卷页面显示打回原因
2. 数据检查页面样式调整
3. 数据检查答题数据增加exist字段过滤

chenhao 2 жил өмнө
parent
commit
5cf4726014

+ 7 - 4
src/devLogin.ts

@@ -1,4 +1,4 @@
-// @ts-ignore 
+// @ts-ignore
 import { LOGIN_CONFIG } from "@/devLoginParams";
 
 const { loginName, password, examId, markerId, isAdmin, forceChange } =
@@ -30,9 +30,12 @@ export async function initLogin() {
         });
         console.log("markerId: ", await res.text());
       }
-
-      const url = isAdmin ? "/admin/exam/select" : "/mark/subject-select";
-      return fetch(url, { body: f, method: "POST" });
+      return new Promise((resove) => {
+        setTimeout(() => {
+          const url = isAdmin ? "/admin/exam/select" : "/mark/subject-select";
+          resove(fetch(url, { body: f, method: "POST" }));
+        }, 1000);
+      });
     });
   // .then(() => {
   //   console.log("login completed");

+ 46 - 7
src/features/admin/confirmPaper/ConfirmPaper.vue

@@ -63,8 +63,8 @@
             <a-input
               v-if="student"
               v-model:value="student.paperType"
+              class="normal-input"
               :maxlength="1"
-              style="width: 40px"
             />
           </div>
 
@@ -73,18 +73,26 @@
               v-for="group in answersComputed"
               :key="group.mainNumber"
               class="tw-mt-2"
+              :class="{ hide: !group.subs?.filter((s) => s.exist).length }"
             >
               <h2>
                 {{ group.mainNumber }}、{{ group.mainTitle }} ({{
                   group.subs.length
                 }})
               </h2>
-              <div class="tw-flex tw-flex-wrap tw-gap-4">
-                <div v-for="question in group.subs" :key="question.subNumber">
-                  <span>{{ question.subNumber }}. </span>
+              <div class="tw-flex tw-flex-wrap tw-gap-2">
+                <div
+                  v-for="question in group.subs"
+                  :key="question.subNumber"
+                  :class="{ hide: !question.exist }"
+                >
+                  <span class="question-number">{{ question.subNumber }} </span>
                   <a-input
+                    class="normal-input"
+                    :class="{
+                      'long-input': group.mainTitle.match(/多选|多项|不定项/),
+                    }"
                     :value="question.answer"
-                    style="width: 40px"
                     :maxLength="
                       group.mainTitle.match(/多选|多项|不定项/) ? 100 : 1
                     "
@@ -260,7 +268,7 @@ async function getSetting() {
   }
 
   setting.fileServer = res.data.fileServer;
-  setting.studentIds = res.data.studentIds;
+  setting.studentIds = res.data.studentIds || [];
 }
 
 async function getNextStudent() {
@@ -353,7 +361,7 @@ async function saveStudentAnswer() {
     void message.error("保存失败,请刷新页面。");
   } else {
     void message.success("保存成功");
-    await getNextStudent()
+    await getNextStudent();
   }
 
   if (setting.studentIds.length === 0) {
@@ -452,6 +460,31 @@ function rotateRight() {
 </script>
 
 <style scoped>
+.question-number {
+  display: inline-block;
+  width: 22px;
+  text-align: right;
+  font-size: 12px;
+  font-weight: normal;
+  color: #474966;
+  line-height: 14px;
+  margin-right: 0.5em;
+}
+.normal-input {
+  width: 36px;
+  height: 32px;
+  background: #edf2fa;
+  border-radius: 6px;
+  border: 1px solid #c8ced8;
+  font-size: 14px;
+  font-weight: normal;
+  color: #474966;
+  text-align: center;
+}
+.normal-input.long-input {
+  width: 94px;
+  padding: 4px;
+}
 .header-container {
   position: relative;
   height: 56px;
@@ -482,4 +515,10 @@ function rotateRight() {
   background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
   transform: inherit;
 }
+
+.hide {
+  display: none;
+  visibility: hidden;
+  opacity: 0;
+}
 </style>

+ 2 - 0
src/features/admin/confirmPaper/check.d.ts

@@ -23,6 +23,8 @@ export type StudentInfo = {
     mainNumber: number;
     subNumber: string;
     answer: string;
+    /** 试卷结构中是否有此数据 */
+    exist: boolean
   }[];
   titles: { [index: number]: string };
 };

+ 56 - 2
src/features/mark/Mark.vue

@@ -72,11 +72,11 @@ import MarkBody from "./MarkBody.vue";
 import { useTimers } from "@/setups/useTimers";
 import MarkHistory from "./MarkHistory.vue";
 import MarkBoardTrack from "./MarkBoardTrack.vue";
-import type { Question } from "@/types";
+import type { Question, Task } from "@/types";
 import MarkBoardKeyBoard from "./MarkBoardKeyBoard.vue";
 import MarkBoardMouse from "./MarkBoardMouse.vue";
 import { debounce, isEmpty, isNumber } from "lodash-es";
-import { message } from "ant-design-vue";
+import { message, Modal } from "ant-design-vue";
 import AnswerModal from "./AnswerModal.vue";
 import PaperModal from "./PaperModal.vue";
 import MinimapModal from "./MinimapModal.vue";
@@ -228,6 +228,51 @@ watch(
   { deep: true }
 );
 
+const showRejectedReason = (task: Task) => {
+  if (task.rejected && task.rejectReason) {
+    const [reasonType,reasonDesc] = task.rejectReason.split(':')
+    Modal.info({
+      title: null,
+      closable: false,
+      maskClosable: false,
+      centered: true,
+      icon: null,
+      okText: "知道了",
+      wrapClassName: "custom-modal-info",
+      zIndex: 9999,
+      bodyStyle: {
+        padding: "15px",
+      },
+      content: () =>
+        h(
+          "div",
+          {
+            style: {
+              fontSize: "14px",
+              color: "var(--app-main-text-color)",
+            },
+          },
+          [
+            h("div", { style: { marginBottom: "8px" } }, [
+              h(
+                "span",
+                { style: { fontWeight: "bold", marginRight: "0.5em" } },
+                "打回原因: "
+              ),
+              h("span", reasonType),
+            ]),
+            h("div", { style: { fontWeight: "bold" } }, "详情描述: "),
+            h(
+              "div",
+              { style: { padding: "4px 2px" } },
+              reasonDesc
+            ),
+          ]
+        ),
+    });
+  }
+};
+
 // 切换currentTask
 watch(
   () => store.currentTask,
@@ -235,6 +280,9 @@ watch(
     // 重置当前选择的quesiton和score
     store.currentQuestion = undefined;
     store.currentScore = undefined;
+    if (store.currentTask) {
+      showRejectedReason(store.currentTask);
+    }
   }
 );
 
@@ -402,6 +450,12 @@ const saveTaskToServer = async () => {
 };
 </script>
 
+<style>
+.custom-modal-info .ant-modal-content {
+  border-radius: 4px;
+}
+</style>
+
 <style scoped>
 .my-container {
   width: 100%;

+ 2 - 0
src/types/index.ts

@@ -201,6 +201,8 @@ interface RawTask {
   previous: boolean;
   /** 是否是打回 */
   rejected: boolean;
+  /** 打回原因 冒号拼接的 */
+  rejectReason: string
   message: string | null;
 }