فهرست منبع

feat: 普通阅卷轨迹图

zhangjie 7 ماه پیش
والد
کامیت
3e6d67323b
2فایلهای تغییر یافته به همراه66 افزوده شده و 3 حذف شده
  1. 57 3
      src/features/student/studentInspect/MarkBody.vue
  2. 9 0
      src/types/index.ts

+ 57 - 3
src/features/student/studentInspect/MarkBody.vue

@@ -580,7 +580,16 @@ function parseMarkDetailList(): Array<MarkDetailItem[]> {
     const userMap: UserMapType = {};
     // 大题分成两个部分给两个人评 与 大题被两人同时评 是不一样的
     const isDoubleMark = !groupQuestions.some((question) => {
-      const userIds = question.trackList.map((track) => track.userId);
+      let userIds = question.trackList.map((track) => track.userId);
+      if (
+        !userIds.length &&
+        question.markerList &&
+        question.markerList.length
+      ) {
+        userIds = question.markerList
+          .filter((marker) => !marker.header)
+          .map((marker) => marker.userId);
+      }
       const uids = new Set(userIds);
       return uids.size === 1;
     });
@@ -608,6 +617,32 @@ function parseMarkDetailList(): Array<MarkDetailItem[]> {
           });
         }
       });
+
+      // 普通模式没有轨迹
+      if (
+        !question.trackList.length &&
+        question.markerList &&
+        question.markerList.length
+      ) {
+        question.markerList
+          .filter((marker) => !marker.header)
+          .forEach((marker) => {
+            if (!userMap[marker.userId]) {
+              userMap[marker.userId] = {
+                userId: marker.userId,
+                userName: marker.userName,
+                color: marker.header ? "green" : "red",
+                prename: "",
+                scores: [],
+                score: 0,
+              };
+            }
+            userMap[marker.userId].scores.push({
+              score: marker.score,
+              subNumber: question.subNumber,
+            });
+          });
+      }
     });
 
     const users = Object.values(userMap).map((user, index) => {
@@ -673,8 +708,8 @@ function parseMarkDetailList(): Array<MarkDetailItem[]> {
     });
 
     const isDoubleMark = Object.keys(userMap).length > 1;
-    const users = Object.values(userMap).map((user, index) => {
-      const zhs = ["一", "二", "三"];
+    const zhs = ["一", "二", "三"];
+    let users = Object.values(userMap).map((user, index) => {
       let prename = "";
       if (isArbitration) {
         prename = "仲裁";
@@ -688,6 +723,25 @@ function parseMarkDetailList(): Array<MarkDetailItem[]> {
       };
     });
 
+    // 普通模式没有轨迹
+    if (!tList.length && question.markerList && question.markerList.length) {
+      let markers = question.markerList.filter((marker) => marker.header);
+      if (!markers.length) {
+        markers = question.markerList.filter((marker) => !marker.header);
+      }
+      users = markers.map((item, index) => {
+        return {
+          userId: item.markerId,
+          userName: item.markerName,
+          color: item.header ? "green" : "red",
+          prename:
+            question.markerList.length > 1 ? `${zhs[index] || ""}评` : "评卷员",
+          scores: [],
+          score: item.score,
+        };
+      });
+    }
+
     dataList[imgIndex].push({
       mainNumber: question.mainNumber,
       subNumber: question.subNumber,

+ 9 - 0
src/types/index.ts

@@ -305,6 +305,15 @@ interface RawQuestion {
   uncalculate: boolean;
   /** 选做题分组 */
   selectiveIndex: number | null;
+  /** 无轨迹情况下评卷员打分信息 */
+  markerList: null | Array<{
+    // 是否是科组长
+    header: boolean;
+    loginName: string;
+    score: number;
+    userId: string;
+    userName: string;
+  }>;
   rejected?: boolean;
   questionName?: string;
   headerTrack?: Array<Track>;