zhangjie 3 месяцев назад
Родитель
Сommit
efd72e2de3

+ 1 - 1
src/features/track/TrackBody.vue

@@ -192,7 +192,7 @@ const { origImageUrls = "sliceUrls", onlyTrack = false } = defineProps<{
   origImageUrls?: "sheetUrls" | "sliceUrls";
   onlyTrack?: boolean;
 }>();
-const emit = defineEmits(["error", "getIsMultComments", "getScrollStatus"]);
+const emit = defineEmits(["error", "getScrollStatus"]);
 
 const { dragContainer } = useDraggable();
 

+ 3 - 3
src/features/track/composables/useTrack.ts

@@ -18,9 +18,9 @@ export default function useTrack() {
         colorMap[mId + ""] = "gray";
       }
     }
-    if (Object.keys(colorMap).length > 1) {
-      emit("getIsMultComments", true);
-    }
+    // if (Object.keys(colorMap).length > 1) {
+    //   emit("getIsMultComments", true);
+    // }
     tList = tList.map((item: Track) => {
       item.color = colorMap[item.userId + ""] || "red";
       item.isByMultMark = markerIds.length > 1;

+ 50 - 4
src/features/track/composables/useTrackTag.ts

@@ -312,6 +312,40 @@ export default function useTrackTag() {
         };
       });
 
+      // 新增仲裁和复核记录
+      const headerTrackQuestions = groupQuestions.filter(
+        (question) => question.headerTrackList?.length
+      );
+      if (headerTrackQuestions.length) {
+        const updateTypeUser = (type: "ARBITRATED" | "MARKED") => {
+          const typeQuestions = headerTrackQuestions.filter(
+            (question) => question.headerTrackList[0].headerType === type
+          );
+          typeQuestions.forEach((question) => {
+            const scores = question.headerTrackList.map((track) => {
+              return {
+                score: track.score,
+                subNumber: track.subNumber,
+              };
+            });
+            const score = calcSumPrecision(scores.map((s) => s.score));
+            const user = {
+              userId: question.headerTrackList[0].userId,
+              userName: question.headerTrackList[0].userName,
+              color: "green",
+              prename: type === "ARBITRATED" ? "仲裁" : "复核",
+              scores,
+              score,
+            };
+            users.push(user);
+          });
+        };
+        // 仲裁记录
+        updateTypeUser("ARBITRATED");
+        // 复核记录
+        updateTypeUser("MARKED");
+      }
+
       const score = calcSumPrecision(
         groupQuestions.map((item) => item.score || 0)
       );
@@ -349,16 +383,26 @@ export default function useTrackTag() {
       }
 
       const userMap: UserMapType = {};
-      const isArbitration = Boolean(question.headerTrackList?.length);
-      const tList = isArbitration
+
+      const hasHeaderTrack = question.headerTrackList?.length;
+      //  是否仲裁
+      const isArbitration =
+        hasHeaderTrack &&
+        question.headerTrackList[0].headerType === "ARBITRATED";
+      // 是否复核
+      const isReview =
+        hasHeaderTrack && question.headerTrackList[0].headerType === "MARKED";
+
+      const tList = hasHeaderTrack
         ? question.headerTrackList
         : question.markerTrackList;
+
       tList.forEach((track) => {
         if (!userMap[track.userId]) {
           userMap[track.userId] = {
             userId: track.userId,
             userName: track.userName,
-            color: track.color || "red",
+            color: hasHeaderTrack ? "green" : "red",
             prename: "",
             scores: [],
             score: 0,
@@ -369,13 +413,15 @@ export default function useTrackTag() {
           subNumber: track.subNumber,
         });
       });
-
+      // 是否双评,复核或者仲裁只会是一个人
       const isDoubleMark = Object.keys(userMap).length > 1;
       const zhs = ["一", "二", "三"];
       let users = Object.values(userMap).map((user, index) => {
         let prename = "";
         if (isArbitration) {
           prename = "仲裁";
+        } else if (isReview) {
+          prename = "复核";
         } else {
           prename = isDoubleMark ? `${zhs[index] || ""}评` : "评卷员";
         }

+ 4 - 2
src/types/index.ts

@@ -371,12 +371,12 @@ export interface Track {
   positionY: number;
   /** 是否此处未作答,未作答时,score默认是-0分 */
   unanswered: boolean;
+  // 是否是复核员复核轨迹 headTrackList没有这个属性
+  headerType: "ARBITRATED" | "MARKED" | null;
   userId?: string;
   userName?: string;
   color?: string;
   isByMultMark?: boolean;
-  // 是否是科组长评卷轨迹
-  headerMarkScore?: boolean;
 }
 
 /** 特殊标记数据 */
@@ -396,6 +396,8 @@ export interface SpecialTag {
   /** 特殊标记的字符串,勾叉 */
   tagName: string;
   tagType: "TEXT" | "CIRCLE" | "RIGHT" | "WRONG" | "HALF_RIGTH" | "LINE";
+  // 是否是复核员复核标记
+  headerType: "ARBITRATED" | "MARKED" | null;
   // 分组号
   userId?: number;
   color?: string;