فهرست منبع

feat: 打分阶段可以分档位评卷

zhangjie 1 ماه پیش
والد
کامیت
6e4b7a8e15

+ 8 - 1
src/api.js

@@ -327,6 +327,11 @@ export const areaList = ({ workId, subject }) => {
 export const sampleAreaList = ({ workId, subject }) => {
   return $get("/api/questions/sampleQuestions", { workId, subject });
 };
+// undoLevel
+export const undoLevelList = (datas) => {
+  // markId questionId
+  return $get("/api/marktasks/count/level", datas);
+};
 // papers
 export const paperList = (datas) => {
   // ?questionId=64&level=A&page=0&size=6&sort=secretNumber&isSample=true
@@ -337,7 +342,9 @@ export const paperManualScoreList = (datas) => {
   return $get("/api/papers/manualScore", datas);
 };
 export const markerTaskList = (datas) => {
-  // ?stage=LEVEL&markerId=49&size=6&page=0&sort=updatedOn,desc&questionId=73&isSample=false&level=C
+  // ?stage=LEVEL&markerId=49&size=6&page=0&sort=updatedOn,desc&questionId=73&isSample=false&level=C&todoLevel=A
+  // level:已评的档位
+  // todoLevel: 待评的档位
   return $get("/api/marktasks", datas);
 };
 export const markTaskPaperList = (datas) => {

+ 56 - 1
src/assets/styles/marker.less

@@ -184,6 +184,59 @@
       margin-left: 20px;
     }
   }
+
+  .header-level {
+    padding: 0;
+  }
+  .header-select {
+    border-radius: 5px;
+    width: 100px;
+    min-width: auto;
+    vertical-align: top;
+    margin-left: 10px;
+    .ivu-select-selection {
+      border-radius: 5px;
+      height: 30px;
+      border: none;
+      background: @color-background;
+      color: @color-text;
+      box-shadow: none;
+    }
+    .ivu-select-placeholder {
+      color: shade(@color-text, 20%);
+      padding-left: 15px;
+    }
+    .ivu-select-selected-value {
+      padding-left: 15px;
+    }
+
+    &:hover {
+      background-color: shade(@color-background, 20%);
+      color: @color-text-act;
+    }
+  }
+}
+.header-select-dropdown {
+  background-color: @color-background;
+  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
+
+  .ivu-select-item {
+    margin-top: 0;
+    color: @color-text;
+
+    &:not(:first-child) {
+      border-top: 1px solid @color-background-light;
+    }
+
+    &:hover {
+      background-color: @color-act1;
+    }
+
+    &.ivu-select-item-selected {
+      background-color: @color-background;
+      background-color: @color-act1;
+    }
+  }
 }
 .header-step-dropdown {
   .header-step-item {
@@ -915,7 +968,9 @@
   .ivu-dropdown-item {
     margin-top: 0;
     color: @color-text;
-    border-top: 1px solid @color-background-light;
+    &:not(:first-child) {
+      border-top: 1px solid @color-background-light;
+    }
     &:hover {
       background-color: @color-act1;
     }

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

@@ -157,6 +157,7 @@ import {
   paperSelectLevelBatch,
   paperTaskPass,
   getParamsSet,
+  subjectDetail,
 } from "@/api";
 
 export default {
@@ -243,11 +244,17 @@ export default {
       "setCurArea",
       "setCurStep",
       "setCurUserRoleType",
+      "setCurSubject",
       "clearState",
     ]),
     async initData() {
       await this.getParamsSetInfo();
       await this.getWorkLevels();
+      this.getSubjectDetail();
+    },
+    async getSubjectDetail() {
+      const curSubject = await subjectDetail(this.subjectId);
+      this.setCurSubject(curSubject || {});
     },
     async getParamsSetInfo() {
       const data = await getParamsSet(this.workId);

+ 117 - 4
src/modules/grading/marker/MarkerHeader.vue

@@ -188,7 +188,65 @@
             </div>
           </div>
         </Poptip>
-        <div class="header-part header-step">
+        <Select
+          v-model="undoLevel"
+          placeholder="待评档位"
+          clearable
+          transfer
+          class="header-select"
+          transfer-class-name="header-select-dropdown"
+          @on-change="undoLevelChange"
+        >
+          <Option
+            v-for="(option, index) in undoLevels"
+            :value="option.levelCode"
+            :key="index"
+          >
+            {{ option.levelCode }}({{ option.taskCount }})
+          </Option>
+        </Select>
+        <Select
+          v-model="stepName"
+          placeholder="分类"
+          transfer
+          class="header-select"
+          transfer-class-name="header-select-dropdown"
+          @on-change="stepClick"
+        >
+          <Option
+            v-for="step in steps.otherStep"
+            :key="step.name"
+            :value="step.name"
+            :label="
+              showPaperRelateCount
+                ? `${step.name}(${step.count})`
+                : `${step.name}`
+            "
+          >
+            <i>{{ step.name }}</i>
+            <i v-if="showPaperRelateCount">({{ step.count }})</i>
+          </Option>
+          <Option
+            v-for="step in steps.levelStep"
+            :key="step.name"
+            :value="step.name"
+            :label="
+              showPaperRelateCount
+                ? `${step.name}(${step.count})`
+                : `${step.name}`
+            "
+          >
+            <i>{{ step.name }}</i>
+            <i v-if="showPaperRelateCount && IS_MARK_LEADER__SCORE">
+              ({{ step.count }})
+            </i>
+            <i v-if="showPaperRelateCount && !IS_MARK_LEADER__SCORE">
+              ({{ step.count }} / {{ step.gcount }})
+            </i>
+          </Option>
+        </Select>
+
+        <!-- <div class="header-part header-step">
           <Dropdown
             placement="bottom"
             transfer
@@ -227,7 +285,7 @@
               </DropdownItem>
             </DropdownMenu>
           </Dropdown>
-        </div>
+        </div> -->
         <div v-if="IS_MARK_LEADER" class="header-part" @click="toProgress">
           <p>{{ stageName }}进度 <Icon type="ios-arrow-down"></Icon></p>
         </div>
@@ -314,7 +372,7 @@
 
 <script>
 import { mapState, mapMutations } from "vuex";
-import { areaList, gradingUserList, logout } from "@/api";
+import { areaList, gradingUserList, undoLevelList, logout } from "@/api";
 import ResetPwd from "@/modules/login/ResetPwd";
 import { CODE_TYPE } from "@/constants/enumerate";
 
@@ -334,6 +392,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    showUndoLevel: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {
@@ -355,6 +417,8 @@ export default {
       markFilter: {
         markerId: "",
       },
+      stepName: "",
+      undoLevel: "",
     };
   },
   computed: {
@@ -363,10 +427,13 @@ export default {
       "page",
       "curStep",
       "steps",
+      "undoLevels",
+      "curUndoLevel",
       "curArea",
       "curSubject",
       "areas",
       "IS_MARK_LEADER",
+      "IS_MARKER",
       "ribbonSet",
     ]),
     stageName() {
@@ -378,6 +445,25 @@ export default {
     showPaperRelateCount() {
       return !!this.paramsSet["showPaperCount"];
     },
+    showUndoLevelSelection() {
+      return (
+        this.showUndoLevel &&
+        this.IS_MARKER &&
+        this.curSubject.stage === "SCORE" &&
+        this.curStep.type === "undo"
+      );
+    },
+  },
+  watch: {
+    showUndoLevelSelection(val) {
+      if (val) {
+        this.getUndoLevels();
+      }
+    },
+    curStep(val, oldVal) {
+      if (val === oldVal || val === this.stepName) return;
+      this.stepName = val.name;
+    },
   },
   mounted() {
     const subjectId = this.$route.params.subjectId.split("-");
@@ -397,7 +483,13 @@ export default {
       .filter((item) => item.key !== "examNumber");
   },
   methods: {
-    ...mapMutations("marker", ["setPage", "setAreas", "setRibbonSet"]),
+    ...mapMutations("marker", [
+      "setPage",
+      "setAreas",
+      "setRibbonSet",
+      "setUndoLevels",
+      "setCurUndoLevel",
+    ]),
     async getAreaList() {
       const data = await areaList(this.filter);
       const areas = data.map((item) => {
@@ -413,6 +505,22 @@ export default {
         this.$emit("area-change", areas[0]);
       }
     },
+    async getUndoLevels() {
+      if (!this.showUndoLevelSelection || !this.curArea.id) return;
+      const data = await undoLevelList({
+        markerId: this.$ls.get("user", { id: "" }).id,
+        questionId: this.curArea.id,
+      });
+      this.setUndoLevels(data);
+
+      if (this.curUndoLevel) {
+        this.undoLevel = this.curUndoLevel.levelCode;
+        const undoLevel = this.undoLevels.find(
+          (item) => item.levelCode === this.undoLevel
+        );
+        this.setCurUndoLevel(undoLevel);
+      }
+    },
     async getLeaderMarkerList() {
       const data = await gradingUserList({
         ...this.filter,
@@ -460,6 +568,11 @@ export default {
       );
       this.$emit("step-change", curStep);
     },
+    undoLevelChange(val) {
+      const undoLevel = this.undoLevels.find((item) => item.levelCode === val);
+      this.setCurUndoLevel(undoLevel || null);
+      this.$emit("undo-level-change", undoLevel);
+    },
     changeAllSelect(selected) {
       this.allSelected = selected;
     },

+ 8 - 0
src/modules/grading/marker/store.js

@@ -8,6 +8,8 @@ const state = {
   },
   steps: {},
   curStep: { name: "", count: 0 },
+  undoLevels: [{ levelCode: "A", taskCount: 1 }], // 待评档位列表
+  curUndoLevel: null, // 当前待评档位
   areas: [],
   curArea: {},
   curSubject: {},
@@ -35,6 +37,12 @@ const mutations = {
   setCurStep(state, curStep) {
     state.curStep = curStep;
   },
+  setUndoLevels(state, undoLevels) {
+    state.undoLevels = undoLevels;
+  },
+  setCurUndoLevel(state, curUndoLevel) {
+    state.curUndoLevel = curUndoLevel;
+  },
   setAreas(state, areas) {
     state.areas = areas;
   },

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

@@ -4,8 +4,10 @@
       v-if="paramsSetReady"
       :show-standard="false"
       :show-statistics="false"
+      show-undo-level
       @area-change="areaChange"
       @step-change="stepChange"
+      @undo-level-change="undoLevelChange"
       @page-set-change="pageSetChange"
       @to-history="toHistory"
       @to-statistics="toStatistics"
@@ -173,6 +175,7 @@ import {
   markerMarkPaperList,
   paperTaskPass,
   paperSelectScoreBatch,
+  subjectDetail,
 } from "@/api";
 
 export default {
@@ -195,6 +198,7 @@ export default {
         undo: {
           sort: "paper.level",
           stage: "SCORE",
+          todoLevel: "",
         },
         done: {
           level: "",
@@ -250,6 +254,7 @@ export default {
       "steps",
       "curStep",
       "curArea",
+      "curUndoLevel",
       "ribbonSet",
     ]),
     markerImageListClasses() {
@@ -280,11 +285,17 @@ export default {
       "setCurArea",
       "setCurStep",
       "setCurUserRoleType",
+      "setCurSubject",
       "clearState",
     ]),
     initData() {
       this.getParamsSetInfo();
       this.getWorkLevels();
+      this.getSubjectDetail();
+    },
+    async getSubjectDetail() {
+      const curSubject = await subjectDetail(this.subjectId);
+      this.setCurSubject(curSubject || {});
     },
     async getParamsSetInfo() {
       const data = await getParamsSet(this.workId);
@@ -302,6 +313,10 @@ export default {
       };
       if (this.curStep.type === "done") {
         datas.level = this.curStep.name;
+      } else if (this.curStep.type === "undo") {
+        datas.todoLevel = this.curUndoLevel
+          ? this.curUndoLevel.levelCode
+          : undefined;
       }
 
       let requestAction = null;
@@ -511,6 +526,16 @@ export default {
         this.curPaper = {};
       }
     },
+    async undoLevelChange() {
+      this.setPage({ current: 1 });
+      this.isFullscreenMarking = false;
+      await this.getList();
+      if (this.papers.length) {
+        this.selectPaper(0);
+      } else {
+        this.curPaper = {};
+      }
+    },
     async areaChange(curArea) {
       this.setCurArea(curArea);
       this.filter.questionId = curArea.id;