zhangjie 2 tahun lalu
induk
melakukan
857e99f6a1

+ 2 - 2
src/api.js

@@ -300,8 +300,8 @@ export const publishScoreTask = ({ subjectId, questionId, taskList }) => {
   );
 };
 // grading-standard-paper-manage
-export const cancelStandardPaper = paperIds => {
-  return $patch(`/api/papers/batch/cancelSample`, { paperIds }, "json");
+export const cancelStandardPaper = ({ paperIds, stage }) => {
+  return $patch(`/api/papers/batch/cancelSample`, { paperIds, stage }, "json");
 };
 
 // grading-detail ------------------------->

+ 2 - 2
src/components/EchartRender.vue

@@ -251,7 +251,7 @@ export default {
           top: "10%",
           bottom: "12%",
           left: 40,
-          right: "3%"
+          right: 20
         },
         tooltip: {
           show: true,
@@ -261,7 +261,7 @@ export default {
         },
         legend: {
           data: datas.map(data => data.name),
-          right: "3%",
+          right: 20,
           itemWidth: 14,
           textStyle: {
             color: "#9d9c9c",

+ 5 - 2
src/modules/grading/components/GradeAction.vue

@@ -57,7 +57,10 @@
         </div>
       </div>
     </div>
-    <div v-if="ribbonSet.keyboardMark" class="action-grade-keyboard">
+    <div
+      v-if="ribbonSet.keyboardMark && rights.gradeList"
+      class="action-grade-keyboard"
+    >
       <div class="keyboard-input">{{ keyInput }}</div>
       <div class="keyboard-clear" @click="clearKeyInput">
         <Icon type="md-trash" />
@@ -432,7 +435,7 @@ export default {
         ? this.curPaperOrTask.redoLevel
         : this.curPaperOrTaskLevel;
       if (levelName) {
-        this.curLevel = this.levels.find(item => item.name === levelName);
+        this.curLevel = this.levels.find(item => item.name === levelName) || {};
       } else {
         this.curLevel = {};
       }

+ 8 - 2
src/modules/grading/components/GradeActionRough.vue

@@ -167,7 +167,12 @@
         </div>
       </div>
     </div>
-    <div v-if="ribbonSet.keyboardMark" class="action-grade-keyboard">
+    <div
+      v-if="
+        ribbonSet.keyboardMark && (rights.roughLevelList || rights.levelList)
+      "
+      class="action-grade-keyboard"
+    >
       <div class="keyboard-input">{{ keyInput }}</div>
       <div class="keyboard-clear" @click="clearKeyInput">
         <Icon type="md-trash" />
@@ -554,7 +559,8 @@ export default {
         ? this.curPaperOrTask.redoLevel
         : this.curPaperOrTaskLevel;
       if (levelName) {
-        this.curLevel = this.levelList.find(item => item.name === levelName);
+        this.curLevel =
+          this.levelList.find(item => item.name === levelName) || {};
       } else {
         this.curLevel = {};
       }

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

@@ -68,6 +68,7 @@
               :stage="curSubject.stage"
               @to-review="toReview"
               @to-select="selectMultiplePaper"
+              @on-mark="markChange"
             ></marker-image-view>
           </div>
         </div>
@@ -125,6 +126,26 @@
       @on-close="carouseImagePreviewClose"
       ref="CarouselPapersPreview"
     ></simple-image-preview>
+    <!-- level-change-modal-info -->
+    <Modal
+      v-model="levelChangeModalIsShow"
+      width="400"
+      footer-hide
+      :z-index="2001"
+      :closable="false"
+      :mask-closable="false"
+    >
+      <div class="ivu-modal-confirm">
+        <div class="ivu-modal-confirm-body">
+          <div>{{ levelChangeTips }}</div>
+        </div>
+        <div class="ivu-modal-confirm-footer">
+          <Button type="primary" @click="levelChangeModalIsShow = false"
+            >确定</Button
+          >
+        </div>
+      </div>
+    </Modal>
   </div>
 </template>
 
@@ -139,6 +160,7 @@ import GradeAction from "../components/GradeAction";
 import GradeActionRough from "../components/GradeActionRough";
 import SimpleImagePreview from "@/components/SimpleImagePreview";
 import GradeRibbon from "../components/GradeRibbon";
+import { levelNameTransform } from "@/plugins/utils";
 
 import {
   markerTaskList,
@@ -209,7 +231,10 @@ export default {
       carouselType: "",
       carouselPapers: [],
       curCarouselPaperIndex: 0,
-      isFullscreenMarking: false
+      isFullscreenMarking: false,
+      // tips-modal
+      levelChangeTips: "",
+      levelChangeModalIsShow: false
     };
   },
   computed: {
@@ -511,6 +536,17 @@ export default {
       this.selectPaper(this.curPaperIndex);
     },
     // paper view action
+    markChange(mark) {
+      const spos = this.steps.otherStep.findIndex(
+        item => item.type === "markPaper"
+      );
+      if (spos === -1) return;
+      if (mark) {
+        this.steps.otherStep[spos].count++;
+      } else {
+        this.steps.otherStep[spos].count--;
+      }
+    },
     toReview(data) {
       this.setShortcut(["action"]);
       this.isFullscreenMarking = true;
@@ -528,8 +564,22 @@ export default {
       } else if (index < 0) {
         nindex = 0;
       }
+      const lastPaper = { ...this.curPaper };
       this.curPaperIndex = nindex;
       this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
+
+      // 待评时,检查当前试卷是否已经切换粗档位
+      if (
+        this.IS_ROUGH_THIN_LEVEL &&
+        this.curStep.type === "undo" &&
+        this.curPaper["roughLevel"] &&
+        this.curPaper["roughLevel"] !== lastPaper["roughLevel"]
+      ) {
+        this.levelChangeTips = `即将分档粗档位:${levelNameTransform(
+          this.curPaper.roughLevel
+        )}`;
+        this.levelChangeModalIsShow = true;
+      }
     },
     async toPrevPaper() {
       if (this.curPaperIndex === 0) {

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

@@ -146,6 +146,7 @@ export default {
       this.loading = false;
       if (!res) return;
       this.image.mark = !this.image.mark;
+      this.$emit("on-mark", this.image.mark);
     },
     toSelect() {
       if (this.image.sample || !this.IS_LEVEL) return;

+ 4 - 1
src/modules/grading/marker/MarkerStandard.vue

@@ -212,7 +212,10 @@ export default {
         content: "确定要取消当前标准卷吗?",
         onOk: async () => {
           paper.loading = true;
-          const res = await cancelStandardPaper(paper.id).catch(() => {});
+          const res = await cancelStandardPaper({
+            paperIds: paper.id,
+            stage: this.stage
+          }).catch(() => {});
           paper.loading = false;
           if (!res) return;
           this.getPaperList();

+ 4 - 1
src/modules/mark/components/MarkAction.vue

@@ -103,7 +103,10 @@
         </div>
       </div>
     </div>
-    <div v-if="ribbonSet.keyboardMark" class="action-grade-keyboard">
+    <div
+      v-if="ribbonSet.keyboardMark && (rights.levelList || rights.gradeList)"
+      class="action-grade-keyboard"
+    >
       <div class="keyboard-input">{{ keyInput }}</div>
       <div class="keyboard-clear" @click="clearKeyInput">
         <Icon type="md-trash" />

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

@@ -48,6 +48,7 @@
               :data="paper"
               :stage="stage"
               @to-review="toReview"
+              @on-mark="markChange"
             ></marker-image-view>
           </div>
         </div>
@@ -407,6 +408,17 @@ export default {
       await this.getStepLevels();
       this.toPage(1);
     },
+    markChange(mark) {
+      const spos = this.steps.otherStep.findIndex(
+        item => item.type === "markPaper"
+      );
+      if (spos === -1) return;
+      if (mark) {
+        this.steps.otherStep[spos].count++;
+      } else {
+        this.steps.otherStep[spos].count--;
+      }
+    },
     toReview(data) {
       this.setShortcut(["action"]);
       this.isFullscreenMarking = true;