Browse Source

bug修改

zhangjie 3 years ago
parent
commit
3219542387

+ 6 - 3
src/modules/grading/GradingStandardPaperManage.vue

@@ -55,7 +55,9 @@
           :key="index"
         >
           <div class="image-view-container">
-            <h5 class="image-view-title">{{ image.title }}</h5>
+            <h5 class="image-view-title">
+              {{ image.title }}
+            </h5>
             <div class="image-view-contain">
               <img
                 :src="image.thumbSrc"
@@ -64,6 +66,7 @@
               />
             </div>
             <div class="image-view-actions">
+              <Button disabled>{{ image.level }}</Button>
               <Button
                 type="error"
                 size="small"
@@ -223,6 +226,7 @@ export default {
         item.loading = false;
         return item;
       });
+      this.paperList.sort((a, b) => (a.level < b.level ? -1 : 1));
     },
     switchLevel(index) {
       this.curLevelIndex = index;
@@ -281,9 +285,8 @@ export default {
       if (!result) return;
 
       this.$Message.success("操作成功!");
-      await this.getPaperList();
       this.cancelChange();
-      this.updatePapers();
+      this.search();
     },
     cancelChange() {
       this.curSelectLevel = null;

+ 0 - 3
src/modules/grading/leader/LeaderGrading.vue

@@ -528,9 +528,6 @@ export default {
       this.$refs.ModifyLeaderGrading.open();
     },
     async leaderGradingSuccess(datas, paper) {
-      if (datas.action === "sampling" && this.$refs.MarkerStandard) {
-        this.$refs.MarkerStandard.updateLevelPapers(datas.level);
-      }
       this.getStepLevels();
 
       if (this.multipleGradingList && this.multipleGradingList.length) {

+ 5 - 35
src/modules/grading/marker/MarkerStandard.vue

@@ -151,10 +151,7 @@ export default {
     async visibleChange(visible) {
       if (!visible) return;
 
-      if (!this.paperList.length) {
-        await this.getPaperList();
-      }
-      this.updatePapers();
+      this.getPaperList();
     },
     async getPaperList() {
       this.isLoading = true;
@@ -174,6 +171,8 @@ export default {
         item.loading = false;
         return item;
       });
+      this.paperList.sort((a, b) => (a.level < b.level ? -1 : 1));
+      this.updatePapers();
     },
     updatePapers() {
       if (this.curLevel) {
@@ -184,34 +183,6 @@ export default {
         this.papers = this.paperList;
       }
     },
-    async updateLevelPapers(levelName) {
-      const datas = {
-        questionId: this.questionId,
-        level: levelName,
-        sort: "secretNumber",
-        isSample: true,
-        page: 0,
-        size: 100
-      };
-      const data = await paperList(datas).catch(() => {});
-      this.isLoading = false;
-      if (!data) return;
-
-      this.paperList = this.paperList.filter(
-        paper => paper.level !== levelName
-      );
-
-      const papers = data.data.map(item => {
-        item.title = `NO.${item.sn}`;
-        item.loading = false;
-        return item;
-      });
-      this.paperList = [...this.paperList, ...papers];
-
-      if (this.curLevel === levelName) {
-        this.papers = papers;
-      }
-    },
     setCurLevel(levelName) {
       this.curLevel = levelName;
       this.updatePapers();
@@ -234,7 +205,7 @@ export default {
           const res = await cancelStandardPaper(paper.id).catch(() => {});
           paper.loading = false;
           if (!res) return;
-          this.updateLevelPapers(paper.level);
+          this.getPaperList();
         }
       });
     },
@@ -267,9 +238,8 @@ export default {
       if (!result) return;
 
       this.$Message.success("操作成功!");
-      await this.getPaperList();
+      this.getPaperList();
       this.cancelChange();
-      this.updatePapers();
     },
     cancelChange() {
       this.curSelectLevel = null;