zhangjie 4 年之前
父节点
当前提交
7de3ce12b1

+ 13 - 0
src/assets/styles/common-component.less

@@ -142,6 +142,19 @@
     left: -1000px;
   }
 
+  &-none {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    color: #e0e0e0;
+    text-align: center;
+    font-size: 20px;
+    > i {
+      font-size: 30px;
+    }
+  }
+
   // view-ui
   .ivu-modal-content {
     background: transparent;

+ 15 - 0
src/assets/styles/main.less

@@ -221,6 +221,21 @@
       margin: auto;
       cursor: pointer;
     }
+    > .image-info {
+      display: block;
+      position: absolute;
+      bottom: 5px;
+      left: 50%;
+      transform: translateX(-50%);
+      z-index: 9;
+      padding: 5px 8px;
+      line-height: 1;
+      border-radius: @box-border-radius-small;
+      background-color: rgba(255, 255, 255, 0.8);
+      font-size: 16px;
+      color: rgba(255, 112, 129, 1);
+      font-weight: 600;
+    }
   }
   &-actions {
     margin-top: 20px;

+ 1 - 1
src/assets/styles/mark.less

@@ -178,7 +178,7 @@
 // modify-unformal-grading-task
 .modify-unformal-grading-task {
   .task-body {
-    height: 90px;
+    min-height: 90px;
     text-align: center;
   }
   .task-tips {

+ 7 - 3
src/components/SimpleImagePreview.vue

@@ -33,7 +33,7 @@
           { [`${prefixCls}-imgs-nosition`]: nosition }
         ]"
         :style="styles"
-        v-show="!loading"
+        v-show="!loading && curImage.imgSrc"
         v-if="modalIsShow"
       >
         <img
@@ -42,6 +42,10 @@
           ref="PreviewImgDetail"
         />
       </div>
+      <div :class="[`${prefixCls}-none`]" v-if="!curImage.imgSrc">
+        <Icon type="md-image" />
+        <p>暂无数据</p>
+      </div>
     </div>
 
     <div :class="[`${prefixCls}-footer`]">
@@ -88,8 +92,8 @@ export default {
   },
   watch: {
     "curImage.imgSrc": {
-      handler() {
-        this.loading = true;
+      handler(val) {
+        if (val) this.loading = true;
       }
     }
   },

+ 2 - 2
src/constants/enumerate.js

@@ -30,8 +30,8 @@ export const LEVEL_TYPE = {
 
 // student score
 export const CODE_TYPE = {
-  examNumber: "考号",
-  paper: "试卷号",
+  examNumber: "试卷考号",
+  paper: "试卷号",
   task: "任务密号"
 };
 

+ 30 - 3
src/modules/grading/GradingDetail.vue

@@ -69,13 +69,22 @@
           <grade-standard-paper
             :levels="levels"
             :question-id="filter.questionId"
-            @on-paper-click="toViewCarouselPaper"
+            @on-paper-click="
+              (index, papers) => {
+                toViewCarouselPaper(index, papers, 'sample');
+              }
+            "
+            @on-paper-change="standardPaperChange"
             v-if="levels.length && filter.questionId"
             ref="GradeStandardPaper"
           ></grade-standard-paper>
           <grade-history-paper
             :question-id="filter.questionId"
-            @on-paper-click="toViewCarouselPaper"
+            @on-paper-click="
+              (index, papers) => {
+                toViewCarouselPaper(index, papers, 'history');
+              }
+            "
             v-if="filter.questionId && !IS_ADMIN"
             ref="GradeHistoryPaper"
           ></grade-history-paper>
@@ -236,6 +245,7 @@ export default {
       levelInfo: {},
       markers: [],
       // carousel paper review,
+      carouselType: "",
       carouselPapers: [],
       curCarouselPaperIndex: 0,
       isFullscreenMarking: false,
@@ -484,7 +494,8 @@ export default {
       this.toActionNextPaper();
     },
     // paper carousel
-    toViewCarouselPaper(paperIndex, papers) {
+    toViewCarouselPaper(paperIndex, papers, type) {
+      this.carouselType = type;
       this.isFullscreenMarking = true;
       this.carouselPapers = papers;
       this.selectCarouselPaper(paperIndex);
@@ -497,6 +508,10 @@ export default {
       this.curPaper = { ...this.carouselPapers[index] };
     },
     toCarousePaper(type) {
+      if (this.carouselType === "sample") {
+        this.toSampleCarousePaper(type);
+        return;
+      }
       if (type === "prev" && this.curCarouselPaperIndex > 0) {
         this.curCarouselPaperIndex--;
       } else if (
@@ -507,10 +522,22 @@ export default {
       }
       this.selectCarouselPaper(this.curCarouselPaperIndex);
     },
+    toSampleCarousePaper(type) {
+      if (type === "prev") {
+        this.$refs.GradeStandardPaper.$refs.PaperCarousel.handleLeft();
+      } else if (type === "next") {
+        this.$refs.GradeStandardPaper.$refs.PaperCarousel.handleRight();
+      }
+    },
     carouseImagePreviewClose() {
       this.isFullscreenMarking = false;
+      this.carouselType = "";
       this.selectPaper(this.curPaperIndex);
     },
+    standardPaperChange(curPaper) {
+      if (!this.isFullscreenMarking) return;
+      this.curPaper = { ...curPaper };
+    },
     // export
     toExport() {
       this.isDownload = true;

+ 32 - 3
src/modules/grading/GradingOperation.vue

@@ -91,13 +91,23 @@
               <grade-standard-paper
                 :levels="levels"
                 :question-id="filter.questionId"
-                @on-paper-click="toViewCarouselPaper"
+                @on-paper-click="
+                  (index, papers) => {
+                    toViewCarouselPaper(index, papers, 'sample');
+                  }
+                "
+                @on-paper-change="standardPaperChange"
                 v-if="levels.length && filter.questionId"
+                ref="GradeStandardPaper"
               ></grade-standard-paper>
               <div class="detail-papers-carousel-split"></div>
               <grade-history-paper
                 :question-id="filter.questionId"
-                @on-paper-click="toViewCarouselPaper"
+                @on-paper-click="
+                  (index, papers) => {
+                    toViewCarouselPaper(index, papers, 'history');
+                  }
+                "
                 v-if="filter.questionId"
                 ref="GradeHistoryPaper"
               ></grade-history-paper>
@@ -125,6 +135,7 @@
                       'image-view-actions',
                       { 'image-view-selected': image.selected }
                     ]"
+                    title="选中批量分档"
                     @click="selectMultiplePaper(image)"
                   ></div>
                 </div>
@@ -247,6 +258,7 @@ export default {
       multiplebtnClicked: false,
       multipleGradingList: [],
       // carousel paper review,
+      carouselType: "",
       carouselPapers: [],
       curCarouselPaperIndex: 0,
       isFullscreenMarking: false
@@ -506,7 +518,8 @@ export default {
       this.$refs.GradeHistoryPaper.updatePapers();
     },
     // paper carousel
-    toViewCarouselPaper(paperIndex, papers) {
+    toViewCarouselPaper(paperIndex, papers, type) {
+      this.carouselType = type;
       this.isFullscreenMarking = true;
       this.carouselPapers = papers;
       this.selectCarouselPaper(paperIndex);
@@ -519,6 +532,10 @@ export default {
       this.curPaper = { ...this.carouselPapers[index] };
     },
     toCarousePaper(type) {
+      if (this.carouselType === "sample") {
+        this.toSampleCarousePaper(type);
+        return;
+      }
       if (type === "prev" && this.curCarouselPaperIndex > 0) {
         this.curCarouselPaperIndex--;
       } else if (
@@ -529,9 +546,21 @@ export default {
       }
       this.selectCarouselPaper(this.curCarouselPaperIndex);
     },
+    toSampleCarousePaper(type) {
+      if (type === "prev") {
+        this.$refs.GradeStandardPaper.$refs.PaperCarousel.handleLeft();
+      } else if (type === "next") {
+        this.$refs.GradeStandardPaper.$refs.PaperCarousel.handleRight();
+      }
+    },
     carouseImagePreviewClose() {
       this.isFullscreenMarking = false;
+      this.carouselType = "";
       this.selectPaper(this.curPaperIndex);
+    },
+    standardPaperChange(curPaper) {
+      if (!this.isFullscreenMarking) return;
+      this.curPaper = { ...curPaper };
     }
   }
 };

+ 7 - 1
src/modules/grading/components/GradeAction.vue

@@ -36,7 +36,9 @@
         <span>试卷考号:</span><span>{{ curPaperOrTask.examNumber }}</span>
       </p>
       <p>
-        <span>试卷密号:</span><span>NO.{{ curPaperOrTask.sn }}</span>
+        <span v-if="IS_MARKER">任务密号:</span>
+        <span v-else>试卷密号:</span>
+        <span>NO.{{ curPaperOrTask.sn }}</span>
       </p>
     </div>
     <!-- 档位信息 -->
@@ -340,6 +342,10 @@ export default {
       this.$emit("on-pass");
     },
     searchCode() {
+      if (!this.filter.code || !this.filter.codeType) {
+        this.$Message.error("请设置密号类型和密号!");
+        return;
+      }
       this.$emit("on-code-search", this.filter);
     }
   },

+ 4 - 2
src/modules/grading/components/GradeHistoryPaper.vue

@@ -37,7 +37,8 @@ export default {
   },
   computed: {
     title() {
-      return this.curPaper.sn ? `NO.${this.curPaper.sn}` : "";
+      return this.curPaper.result ? `已评  ${this.curPaper.result}` : "";
+      // return this.curPaper.sn ? `NO.${this.curPaper.sn}` : "";
     }
   },
   watch: {
@@ -60,7 +61,8 @@ export default {
 
       this.papers = await actionHistory(datas);
       this.$nextTick(() => {
-        this.$refs.PaperCarousel.updateIndex();
+        const index = this.papers.length ? this.papers.length - 1 : 0;
+        this.$refs.PaperCarousel.setCurPaper(index);
       });
     },
     setCurPaper(paper) {

+ 4 - 0
src/modules/grading/components/GradeStandardPaper.vue

@@ -16,6 +16,7 @@
       @on-prev-end="prevLevel"
       @on-next-end="nextLevel"
       @on-paper-click="paperClick"
+      @on-paper-change="paperChange"
       ref="PaperCarousel"
     ></paper-carousel>
     <div class="carousel-loading" v-if="isLoading">
@@ -140,6 +141,9 @@ export default {
     },
     paperClick(paperIndex, papers) {
       this.$emit("on-paper-click", paperIndex, papers);
+    },
+    paperChange(curPaper) {
+      this.$emit("on-paper-change", curPaper);
     }
   }
 };

+ 3 - 3
src/modules/main/PaperManage.vue

@@ -49,7 +49,6 @@
             v-model="paperType"
             @on-change="typeChange"
             placeholder="类型"
-            clearable
           >
             <Option
               v-for="(val, key) in CAFA_EXCEPTION_TYPE"
@@ -139,8 +138,8 @@ export default {
         missing: null
       },
       SORT_RULE_TYPE,
-      CAFA_EXCEPTION_TYPE,
-      paperType: null,
+      CAFA_EXCEPTION_TYPE: {},
+      paperType: "2",
       current: 1,
       size: this.GLOBAL.pageSize,
       total: 0,
@@ -153,6 +152,7 @@ export default {
     };
   },
   mounted() {
+    this.CAFA_EXCEPTION_TYPE = { ...CAFA_EXCEPTION_TYPE, 2: "全部" };
     this.getSubjects();
   },
   methods: {

+ 3 - 0
src/modules/mark/MarkDetail.vue

@@ -82,6 +82,9 @@
                   :alt="image.title"
                   @click="toReview(index)"
                 />
+                <span class="image-info" v-if="image.score || image.score === 0"
+                  >{{ image.score }}分</span
+                >
               </div>
             </div>
           </div>

+ 23 - 9
src/modules/mark/components/MarkAction.vue

@@ -8,10 +8,10 @@
         placeholder="密号类型"
       >
         <Option
-          v-for="(val, key) in CODE_TYPE"
-          :key="key"
-          :value="key"
-          :label="val"
+          v-for="item in codeTypes"
+          :key="item.key"
+          :value="item.key"
+          :label="item.val"
         ></Option>
       </Select>
       <Input
@@ -58,7 +58,9 @@
         <span>试卷考号:</span><span>{{ curPaperOrTask.examNumber }}</span>
       </p>
       <p>
-        <span>试卷密号:</span><span>NO.{{ curPaperOrTask.sn }}</span>
+        <span v-if="IS_MARKER">任务密号:</span>
+        <span v-else>试卷密号:</span>
+        <span>NO.{{ curPaperOrTask.sn }}</span>
       </p>
     </div>
     <!-- 改档信息 -->
@@ -261,12 +263,12 @@ export default {
       },
       roleRight: {
         ADMIN: {
-          done: ["search", "gradeHis", "gradeInfo", "markInfo"],
+          done: ["search", "markHis", "gradeInfo", "markInfo"],
           shift: ["search", "gradeChangeSearch", "gradeChange"]
         },
         MARK_LEADER: {
           undo: ["search", "gradeList", "gradeInfo", "markInfo"],
-          done: ["search", "gradeList", "gradeHis", "gradeInfo", "markInfo"],
+          done: ["search", "gradeList", "markHis", "gradeInfo", "markInfo"],
           shift: ["search", "gradeList", "gradeChange"]
         },
         MARKER: {
@@ -280,7 +282,7 @@ export default {
         codeType: "examNumber",
         code: ""
       },
-      CODE_TYPE,
+      codeTypes: [],
       CHANGE_LEVEL_STATUS,
       applyChangeLevelStatus: null,
       stepDict: {
@@ -317,6 +319,14 @@ export default {
     }
   },
   mounted() {
+    this.codeTypes = Object.entries(CODE_TYPE)
+      .map(([key, val]) => {
+        return {
+          key,
+          val
+        };
+      })
+      .filter(item => this.IS_ADMIN || item.key !== "examNumber");
     this.rebuildRight();
   },
   methods: {
@@ -355,7 +365,7 @@ export default {
             : this.curLevel.name;
         this.updateScoreList();
       }
-      if (this.rights.gradeHis) {
+      if (this.rights.markHis) {
         this.getMarkHistory();
       }
     },
@@ -408,6 +418,10 @@ export default {
       this.$emit("on-pass");
     },
     searchCode() {
+      if (!this.filter.code || !this.filter.codeType) {
+        this.$Message.error("请设置密号类型和密号!");
+        return;
+      }
       this.$emit("on-code-search", this.filter);
     },
     searchGradeChange() {