Ver Fonte

bug fix

zhangjie há 1 ano atrás
pai
commit
1fd28080d6

+ 6 - 0
src/modules/grading/components/GradeRibbon.vue

@@ -1,6 +1,9 @@
 <template>
   <div class="grade-ribbon">
     <div class="ribbon-list">
+      <div class="ribbon-item" title="刷新" @click="toFresh">
+        <Icon type="md-refresh" />
+      </div>
       <div class="ribbon-item" title="消息" @click="toNotice">
         <Icon type="md-notifications" />
       </div>
@@ -35,6 +38,9 @@ export default {
     },
     toSet() {
       this.$refs.RibbonSetDialog.open();
+    },
+    toFresh() {
+      location.reload();
     }
   }
 };

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

@@ -102,6 +102,7 @@
         }
       "
       @on-close="historyClose"
+      @on-mark="historyMarkChange"
       ref="MarkerHistory"
     ></marker-history>
     <!-- MarkerStandard -->
@@ -719,6 +720,11 @@ export default {
       this.selectPaper(this.curPaperIndex);
       this.setShortcut(["page", "action"]);
     },
+    historyMarkChange() {
+      this.getStepLevels();
+      this.getList();
+      this.$refs.MarkerHistory.updatePapers();
+    },
     toStandard() {
       this.setShortcut([]);
       this.$refs.MarkerStandard.open();

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

@@ -93,6 +93,7 @@
         }
       "
       @on-close="historyClose"
+      @on-mark="historyMarkChange"
       ref="MarkerHistory"
     ></marker-history>
     <!-- MarkerStandard -->

+ 31 - 2
src/modules/grading/marker/MarkerHistory.vue

@@ -31,6 +31,11 @@
             >
               NO.{{ paper.sn }}
             </div>
+            <div class="image-action">
+              <div :class="['image-action-li']" @click="toMark(paper)">
+                <Icon :class="{ 'mark-act': paper.mark }" type="md-bookmark" />
+              </div>
+            </div>
           </marker-image-view>
         </div>
       </div>
@@ -42,7 +47,7 @@
 <script>
 import { mapState } from "vuex";
 
-import { actionHistory, actionLeaderHistory } from "@/api";
+import { actionHistory, actionLeaderHistory, markTask, markPaper } from "@/api";
 import MarkerImageView from "./MarkerImageView";
 
 export default {
@@ -59,13 +64,15 @@ export default {
   components: { MarkerImageView },
   data() {
     return {
+      curUserRoleType: this.$ls.get("user", { role: "" }).role,
       modalIsShow: false,
       workId: "",
       subject: "",
       subjectId: this.$route.params.subjectId,
       userId: "",
       curPaper: {},
-      papers: []
+      papers: [],
+      loading: false
     };
   },
   computed: {
@@ -148,6 +155,28 @@ export default {
       });
       this.papers = [...this.papers, ...papers].slice(-5);
     },
+    async toMark(paper) {
+      if (this.loading) return;
+      this.loading = true;
+      let res = null;
+      if (this.curUserRoleType === "MARK_LEADER") {
+        res = await markPaper({
+          paperId: paper.id,
+          isMark: !paper.mark,
+          role: this.curUserRoleType
+        }).catch(() => {});
+      } else {
+        res = await markTask({
+          markTaskId: paper.id,
+          isMark: !paper.mark,
+          stage: this.stage
+        }).catch(() => {});
+      }
+      this.loading = false;
+      if (!res) return;
+      paper.mark = !paper.mark;
+      this.$emit("on-mark", paper.mark);
+    },
     cancel() {
       this.modalIsShow = false;
     },

+ 6 - 0
src/modules/mark/leader/LeaderMarking.vue

@@ -72,6 +72,7 @@
         }
       "
       @on-close="historyClose"
+      @on-mark="historyMarkChange"
       ref="MarkerHistory"
     ></marker-history>
     <!-- image-preview -->
@@ -519,6 +520,11 @@ export default {
       this.selectPaper(this.curPaperIndex);
       this.setShortcut(["page", "action"]);
     },
+    historyMarkChange() {
+      this.getStepLevels();
+      this.getList();
+      this.$refs.MarkerHistory.updatePapers();
+    },
     toProgress() {
       this.setShortcut([]);
       this.$refs.LeaderProgress.open();

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

@@ -69,6 +69,7 @@
         }
       "
       @on-close="historyClose"
+      @on-mark="historyMarkChange"
       ref="MarkerHistory"
     ></marker-history>
     <!-- image-preview -->

+ 2 - 2
src/modules/quality/Quality.vue

@@ -129,7 +129,7 @@
           <image-action-list
             v-if="papers.length"
             :data="papers"
-            :column-number="4"
+            :column-number="5"
             :actions="imageListActions"
             @on-review="toReview"
             ref="ImageActionList"
@@ -188,7 +188,7 @@ export default {
       SORT_RULE_TYPE,
       CAFA_EXCEPTION_TYPE: {},
       current: 1,
-      size: 8,
+      size: 10,
       total: 0,
       totalPage: 0,
       papers: [],