zhangjie 9 місяців тому
батько
коміт
96bb0cda5e

+ 1 - 0
components.d.ts

@@ -26,6 +26,7 @@ declare module '@vue/runtime-core' {
     ASlider: typeof import('ant-design-vue/es')['Slider']
     ASpin: typeof import('ant-design-vue/es')['Spin']
     ASwitch: typeof import('ant-design-vue/es')['Switch']
+    ATable: typeof import('ant-design-vue/es')['Table']
     ATextarea: typeof import('ant-design-vue/es')['Textarea']
     ATooltip: typeof import('ant-design-vue/es')['Tooltip']
     CommonMarkHeader: typeof import('./src/components/CommonMarkHeader.vue')['default']

+ 9 - 1
src/api/markPage.ts

@@ -188,10 +188,18 @@ export async function doUnselectiveType() {
   });
 }
 
+/** 获取评卷任务 */
+export async function getMarkTask(id: string) {
+  return httpApp.post<boolean>(
+    "/api/admin/mark/task/get_mark_track",
+    {},
+    { params: { id } }
+  );
+}
 /** 打回评卷任务 */
 export async function doRejectTask(params: {
   id: string;
   rejectReason: string;
 }) {
-  return httpApp.post<boolean>("/api/admin/mark/task/reject", params);
+  return httpApp.post<boolean>("/api/admin/mark/task/reject", {}, { params });
 }

+ 6 - 21
src/features/reject/Reject.vue

@@ -47,53 +47,38 @@ import MarkBody from "../student/studentInspect/MarkBody.vue";
 import RejectBoard from "./RejectBoard.vue";
 import { message } from "ant-design-vue";
 
-import { getHistoryTask } from "@/api/markPage";
+import { getMarkTask } from "@/api/markPage";
 import vls from "@/utils/storage";
 import { doLogout } from "@/api/markPage";
 
-// groupNumber,studentId,paperNumber,examId,secretNumber,studentCode, studentName,courseCode,courseName
+// taskId
 const rejectParam = vls.get("reject", {});
 
 function logout() {
   doLogout();
 }
 
-async function updateTask() {
+async function fetchTask() {
   const mkey = "fetch_task_key";
   void message.info({ content: "获取任务中...", duration: 1.5, key: mkey });
 
-  const { paperNumber, groupNumber, examId, secretNumber } = rejectParam;
-  const datas = {
-    secretNumber,
-    examId,
-    paperNumber,
-    groupNumber,
-    order: "marker_time",
-    sort: "DESC",
-    pageNumber: 1,
-    pageSize: 20,
-  };
-  const res = await getHistoryTask(datas);
+  const res = await getMarkTask(rejectParam.taskId);
   if (!res?.data) {
     store.message = "无数据!";
     return;
   }
 
-  const rawTask = res.data.records[0];
+  const rawTask = res.data;
   rawTask.subject = {
     code: rejectParam.courseCode,
     name: rejectParam.courseName,
   };
-  rawTask.paperNumber = paperNumber;
+  rawTask.paperNumber = rejectParam.paperNumber;
   rawTask.studentCode = rejectParam.studentCode;
   rawTask.studentName = rejectParam.studentName;
   store.currentTask = rawTask;
 }
 
-async function fetchTask() {
-  await updateTask();
-}
-
 onMounted(async () => {
   await fetchTask();
 });

+ 36 - 15
src/features/reject/RejectBoard.vue

@@ -15,28 +15,36 @@
         :key="item.mainNumber"
         class="board-question"
       >
-        <div class="board-question-head"></div>
+        <div class="board-question-head">第{{ item.mainNumber }}大题</div>
         <a-table
           :dataSource="item.subQuestions"
           :columns="columns"
           :showHeader="false"
-        />
+          :pagination="false"
+          size="small"
+        >
+        </a-table>
       </div>
     </div>
     <div class="board-footer">
-      <qm-button class="board-goback" :clickTimeout="300" @click="openModal">
+      <qm-button
+        class="board-goback"
+        :clickTimeout="300"
+        block
+        type="primary"
+        @click="openModal"
+      >
         打回
       </qm-button>
     </div>
 
     <!-- 打回原因 -->
-    <qm-dialog
-      v-if="rejectModalVisible"
-      top="10vh"
-      width="500px"
-      height="400px"
+
+    <a-modal
+      v-model:visible="rejectModalVisible"
       title="打回原因"
-      @close="closeModal"
+      top="10vh"
+      :footer="null"
     >
       <a-form
         ref="formRef"
@@ -48,18 +56,21 @@
           <a-textarea
             v-model:value="formState.rejectReason"
             showCount
+            :autosize="{ minRows: 2, maxRows: 6 }"
             :maxlength="100"
           />
         </a-form-item>
 
         <a-form-item>
-          <a-button type="primary" htmlType="submit">确定</a-button>
+          <a-button type="primary" :loading="loading" htmlType="submit"
+            >确定</a-button
+          >
           <a-button style="margin-left: 10px" @click="closeModal"
             >取消</a-button
           >
         </a-form-item>
       </a-form>
-    </qm-dialog>
+    </a-modal>
   </div>
 </template>
 
@@ -73,6 +84,7 @@ import { doRejectTask } from "@/api/markPage";
 
 interface SubQuestion {
   subNumber: string;
+  subName: string;
   score: number;
 }
 
@@ -86,8 +98,8 @@ const questions = ref<QuestionGroupItem[]>([]);
 const columns = [
   {
     title: "小题",
-    dataIndex: "subNumber",
-    key: "subNumber",
+    dataIndex: "subName",
+    key: "subName",
   },
   {
     title: "得分",
@@ -110,13 +122,14 @@ function parseQuestions() {
       };
     }
 
-    questionList[q.mainNumber].push({
+    questionList[q.mainNumber].subQuestions.push({
       subNumber: q.subNumber,
+      subName: `${q.mainNumber}-${q.subNumber}`,
       score: q.score,
     });
   });
 
-  questions.value = questionList.filter((item) => !item);
+  questions.value = questionList.filter((item) => !!item);
 }
 
 interface FormState {
@@ -139,11 +152,18 @@ function openModal() {
   rejectModalVisible.value = true;
 }
 
+const loading = ref(false);
+
 async function toReject(values: FormState) {
+  if (loading.value) return;
+  loading.value = true;
+
   const res = await doRejectTask({
     id: store.currentTask.taskId,
     rejectReason: values.rejectReason,
   }).catch(() => false);
+
+  loading.value = false;
   const mkey = "reject_task_key";
 
   if (!res) return;
@@ -158,6 +178,7 @@ async function toReject(values: FormState) {
     key: mkey,
     duration: 2,
   });
+  closeModal();
   setTimeout(() => {
     window.close();
   }, 3000);

+ 1 - 1
src/features/student/studentInspect/MarkBody.vue

@@ -262,7 +262,7 @@ async function processImage() {
   store.setting.doubleTrack = trackLists.some((item) => item.isByMultMark);
 
   // 无答题卡,模式4
-  if (!store.currentTask.cardData.length) {
+  if (!store.currentTask.cardData?.length) {
     // 只有单评才展示summary
     const summarys = store.setting.doubleTrack ? undefined : parseMode4Data();
     for (const url of urls) {

+ 8 - 3
src/styles/page.less

@@ -1274,7 +1274,7 @@
   width: 360px;
   padding: 16px;
   overflow-y: auto;
-  background-color: #fff;
+  background-color: var(--app-main-bg-color);
 
   display: flex;
   flex-direction: column;
@@ -1289,6 +1289,8 @@
     margin-bottom: 16px;
     background-color: #165dff;
     border-radius: 4px;
+    color: #fff;
+    padding: 16px;
     .flex-static;
 
     &-info {
@@ -1326,11 +1328,14 @@
       margin-bottom: 16px;
 
       &-head {
-        height: 32px;
-        padding: 10px 8px;
+        padding: 8px 15px;
         font-weight: 600;
         border-bottom: 1px solid #f0f0f0;
       }
+
+      .ant-table-cell {
+        padding-left: 15px;
+      }
     }
   }
 }