刘洋 8 luni în urmă
părinte
comite
af87475b09

+ 32 - 1
src/render/views/BaseDataConfig/StuImportFileDialog.vue

@@ -21,9 +21,14 @@
         >
       </template>
     </qm-low-form>
-    <my-modal v-model:open="showProgressDialog" title="考生导入进度">
+    <my-modal
+      v-model:open="showProgressDialog"
+      title="考生导入进度"
+      @cancel="progressClose"
+    >
       <p>{{ curFileName }}</p>
       <a-progress :percent="progress" :status="progressStatus" />
+      <p class="color-warning">{{ errMsg }}</p>
     </my-modal>
   </my-modal>
 </template>
@@ -41,6 +46,7 @@ const progressStatus = ref<
   "active" | "success" | "normal" | "exception" | undefined
 >("active"); // 'exception' 'normal' 'success'
 const progress = ref(0);
+const errMsg = ref("");
 const curFileName = ref("");
 const emit = defineEmits(["success"]);
 
@@ -66,10 +72,35 @@ const submitHandle = () => {
         let taskId = res.taskId;
         showProgressDialog.value = true;
         // visible.value = false;
+        watchProgress({ taskId });
       }
     );
   });
 };
+const watchProgress = (obj: { taskId: string }) => {
+  if (!showProgressDialog.value) return;
+  importStuProgress(obj).then((res: any) => {
+    if (res?.progress == 100 && res?.success) {
+      progressStatus.value = "success";
+      errMsg.value = "";
+      window.$message.success("导入成功");
+    } else {
+      if (res?.errMsg) {
+        progressStatus.value = "exception";
+        errMsg.value = res?.errMsg;
+      } else {
+        setTimeout(() => {
+          watchProgress(obj);
+        }, 3000);
+      }
+    }
+  });
+};
+const progressClose = () => {
+  if (progressStatus.value === "success") {
+    visible.value = false;
+  }
+};
 const downloadTpl = () => {
   exportStu({ examId: userStore.curExam?.id });
 };

+ 1 - 1
src/render/views/DataCheck/QuestionPanel.vue

@@ -14,7 +14,7 @@
         {{ info.examSite }}
       </a-descriptions-item>
       <a-descriptions-item label="卷型号" :span="6">
-        <template v-if="simple">
+        <template v-if="simple || hideMissExamRadio">
           {{ info.paperType }}
         </template>
         <template v-else>

+ 9 - 3
src/render/views/ScanManage/ImageView.vue

@@ -106,6 +106,7 @@ import {
 
 const imageTypeOptions = enum2Options(IMAGE_TYPE);
 const dataCheckStore = useDataCheckStore();
+dataCheckStore.resetInfo();
 function onImageTypeChange() {
   dataCheckStore.setInfo({
     imageType: imageType.value,
@@ -163,8 +164,9 @@ function parseStudentPage(student: any) {
       dataList.value.push({
         ...page,
         paperId: paper.id as number,
-        pageIndex,
+        pageIndex: page.index,
         paperIndex,
+        paperNumber: paper.number,
         studentIndex: 0,
         studentId: student.id,
         examId: userStore.curExam?.id,
@@ -313,12 +315,16 @@ watch(
 
 async function onQuestionsChange() {
   if (!dataCheckStore.curPage) return;
-  dataCheckStore.curPage.question = [...questions.value];
+  // dataCheckStore.curPage.question = [...questions.value];
+  dataCheckStore.curPage.question.result = [...questions.value];
 
   await dataCheckStore
     .updateField({
       field: "QUESTION",
-      value: questions.value,
+      value: JSON.stringify({
+        type: dataCheckStore.curPage?.question?.type,
+        result: questions.value,
+      }),
     })
     .catch(() => {});
 }