Ver código fonte

fix 干掉它们

刘洋 8 meses atrás
pai
commit
cc8fb65f52

+ 8 - 0
src/render/views/AbsentCheck/index.vue

@@ -104,6 +104,14 @@ function parseStudentPageList(students: DataCheckListItem[]) {
           examId: searchModel.examId,
           kid: `${student.id}-${studentIndex}-${paperIndex}-${pageIndex}`,
         };
+        if (
+          row.question?.result?.length &&
+          Array.isArray(row.question?.result)
+        ) {
+          row.question.result = row.question.result.map((item: string) =>
+            item.replace(/[^#a-zA-Z]/g, "")
+          );
+        }
         dataList.value.push(row);
       });
     });

+ 8 - 0
src/render/views/DataCheck/index.vue

@@ -103,6 +103,14 @@ function parseStudentPageList(students: DataCheckListItem[]) {
           examId: searchModel.examId,
           kid: `${student.id}-${studentIndex}-${paperIndex}-${pageIndex}`,
         };
+        if (
+          row.question?.result?.length &&
+          Array.isArray(row.question?.result)
+        ) {
+          row.question.result = row.question.result.map((item: string) =>
+            item.replace(/[^#a-zA-Z]/g, "")
+          );
+        }
         dataList.value.push(row);
       });
     });

+ 8 - 2
src/render/views/ScanManage/ImageView.vue

@@ -171,7 +171,7 @@ function parseStudentPage(student: any) {
   student.papers.forEach((paper: any, paperIndex: number) => {
     if (!paper.pages) return;
     paper.pages.forEach((page: any, pageIndex: number) => {
-      dataList.value.push({
+      let row = {
         ...page,
         paperId: paper.id as number,
         pageIndex: page.index,
@@ -181,7 +181,13 @@ function parseStudentPage(student: any) {
         studentId: student.id,
         examId: userStore.curExam?.id,
         kid: `${student.id}-${0}-${paperIndex}-${pageIndex}`,
-      });
+      };
+      if (row.question?.result?.length && Array.isArray(row.question?.result)) {
+        row.question.result = row.question.result.map((item: string) =>
+          item.replace(/[^#a-zA-Z]/g, "")
+        );
+      }
+      dataList.value.push(row);
     });
   });
 }