浏览代码

bug修改

zhangjie 3 年之前
父节点
当前提交
5aed59d49f

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

@@ -64,6 +64,7 @@
               />
             </div>
             <div class="image-view-actions">
+              <Button disabled>{{ image.level }}</Button>
               <Button
                 type="error"
                 size="small"
@@ -223,6 +224,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 +283,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

@@ -525,9 +525,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) {

+ 7 - 39
src/modules/grading/marker/MarkerStandard.vue

@@ -125,7 +125,6 @@ export default {
       curLevel: "",
       paperList: [],
       papers: [],
-      isLoading: false,
       // change standard
       levelModalIsShow: false,
       curChangePaper: {},
@@ -142,16 +141,12 @@ export default {
     ...mapState("marker", ["IS_MARK_LEADER"])
   },
   methods: {
-    async visibleChange(visible) {
+    visibleChange(visible) {
       if (!visible) return;
 
-      if (!this.paperList.length) {
-        await this.getPaperList();
-      }
-      this.updatePapers();
+      this.getPaperList();
     },
     async getPaperList() {
-      this.isLoading = true;
       const datas = {
         questionId: this.questionId,
         level: "",
@@ -161,13 +156,15 @@ export default {
         size: 1000
       };
       const data = await paperList(datas).catch(() => {});
-      this.isLoading = false;
       if (!data) return;
       this.paperList = data.data.map(item => {
         item.title = `NO.${item.sn}`;
         item.loading = false;
         return item;
       });
+      this.paperList.sort((a, b) => (a.level < b.level ? -1 : 1));
+
+      this.updatePapers();
     },
     updatePapers() {
       if (this.curLevel) {
@@ -178,34 +175,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();
@@ -228,7 +197,7 @@ export default {
           const res = await cancelStandardPaper(paper.id).catch(() => {});
           paper.loading = false;
           if (!res) return;
-          this.updateLevelPapers(paper.level);
+          this.getPaperList();
         }
       });
     },
@@ -261,9 +230,8 @@ export default {
       if (!result) return;
 
       this.$Message.success("操作成功!");
-      await this.getPaperList();
+      this.getPaperList();
       this.cancelChange();
-      this.updatePapers();
     },
     cancelChange() {
       this.curSelectLevel = null;