Quellcode durchsuchen

解决前端档位重复统计问题

zhangjie vor 2 Jahren
Ursprung
Commit
c4cecbd2d8

+ 17 - 0
src/modules/grading/marker/MarkerGrading.vue

@@ -187,6 +187,7 @@ export default {
       papers: [],
       curPaper: {},
       curPaperIndex: 0,
+      cacheUpdateLevelInfos: null,
       // multiple grading
       multiplebtnClicked: false,
       multipleGradingList: [],
@@ -335,7 +336,23 @@ export default {
         this.setCurStep(curStep);
       }
     },
+    checkStepActionIsRepeat(infos) {
+      const nextCacheUpdateLevelInfos = JSON.stringify(infos);
+      const isRepeat = nextCacheUpdateLevelInfos === this.cacheUpdateLevelInfos;
+      if (!isRepeat) this.cacheUpdateLevelInfos = nextCacheUpdateLevelInfos;
+      return isRepeat;
+    },
     updateStepLevel(curStep, curLevel, count) {
+      if (
+        this.checkStepActionIsRepeat({
+          curStepType: curStep.type,
+          curStepName: curStep.name,
+          curLevel,
+          count
+        })
+      )
+        return;
+
       if (curStep.type === "done") {
         const lpos = this.steps.levelStep.findIndex(
           item => item.name === curStep.name

+ 17 - 0
src/modules/mark/marker/MarkerMarking.vue

@@ -178,6 +178,7 @@ export default {
       curPaper: {},
       curPaperIndex: 0,
       paramsSetReady: false,
+      cacheUpdateLevelInfos: null,
       // carousel paper review,
       carouselType: "",
       carouselPapers: [],
@@ -349,7 +350,23 @@ export default {
         this.setCurStep(curStep);
       }
     },
+    checkStepActionIsRepeat(infos) {
+      const nextCacheUpdateLevelInfos = JSON.stringify(infos);
+      const isRepeat = nextCacheUpdateLevelInfos === this.cacheUpdateLevelInfos;
+      if (!isRepeat) this.cacheUpdateLevelInfos = nextCacheUpdateLevelInfos;
+      return isRepeat;
+    },
     updateStepLevel(curStep, { curLevel, manualScore = 0 }, count = 1) {
+      if (
+        this.checkStepActionIsRepeat({
+          curStepType: curStep.type,
+          curLevel,
+          manualScore,
+          count
+        })
+      )
+        return;
+
       if (curStep.type === "done") {
         const spos = this.steps.otherStep.findIndex(
           item => item.type === "manualScore"