Parcourir la source

科组长打分

zhangjie il y a 3 ans
Parent
commit
9d6fbb5fbd

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

@@ -22,6 +22,7 @@
   .header-part {
     display: inline-block;
     vertical-align: top;
+    min-width: 80px;
     padding: 0 15px;
     margin-left: 10px;
     background: @color-background;

+ 1 - 1
src/constants/authority.js

@@ -221,7 +221,7 @@ export const checkRouterValid = (roleCode, routerName) => {
       "MarkerGrading",
       "MarkerMarking"
     ],
-    MARK_LEADER: () => ["LeaderGrading", "leaderMark"],
+    MARK_LEADER: () => ["LeaderGrading", "LeaderMarking"],
     INSPECTION: () => inspection.map(item => item.name),
     QC: () => ["Quality"]
   };

+ 12 - 4
src/modules/grading/leader/LeaderGrading.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="marker-grading">
     <marker-header
+      v-if="curSubject.id"
       @area-change="areaChange"
       @step-change="stepChange"
       @page-set-change="pageSetChange"
@@ -72,6 +73,7 @@
           <div class="marker-image-content">
             <marker-image-view
               :data="paper"
+              :can-select="ACTION_CAN_BATCH"
               @to-review="toReview(index)"
               @to-select="selectMultiplePaper"
             ></marker-image-view>
@@ -222,6 +224,12 @@ export default {
     ]),
     markerImageListClasses() {
       return ["marker-image-list", `marker-image-list-${this.page.size}`];
+    },
+    IS_TEST() {
+      return this.curSubject.test === 2;
+    },
+    ACTION_CAN_BATCH() {
+      return this.curStep.type === "done" && !this.paramsSet.paperStage;
     }
   },
   created() {
@@ -237,10 +245,10 @@ export default {
       "setCurSubject",
       "clearState"
     ]),
-    async initData() {
-      await this.getParamsSetInfo();
-      await this.getSubjectDetail();
-      await this.getWorkLevels();
+    initData() {
+      this.getParamsSetInfo();
+      this.getSubjectDetail();
+      this.getWorkLevels();
     },
     async getParamsSetInfo() {
       const data = await getParamsSet(this.workId);

+ 6 - 3
src/modules/grading/leader/LeaderProgress.vue

@@ -2,7 +2,7 @@
   <Modal
     v-model="modalIsShow"
     class="leader-progress marker-modal"
-    title="分档进度"
+    :title="title"
     footer-hide
     fullscreen
     :transition-names="['slide-left', 'fade']"
@@ -36,7 +36,7 @@
     </div>
 
     <div class="leader-progress-part">
-      <div colspan="3" style="text-align:left">
+      <div v-if="IS_LEVEL" colspan="3" style="text-align:left">
         仲裁:{{ kzzInfo.arbitrated }}
       </div>
       <table class="table table-dark" v-if="IS_LEVEL && markerProgress.length">
@@ -90,7 +90,7 @@
               :show-count="showPaperRelateCount"
             ></progress-line>
           </td>
-          <td>{{ item.progress }}</td>
+          <td class="td-nopad">{{ item.progress }}%</td>
           <td>{{ item.shiftCount }}</td>
           <td>{{ item.shiftScoreCount }}</td>
         </tr>
@@ -124,6 +124,9 @@ export default {
     IS_SCORE() {
       return this.curSubject.stage === "SCORE";
     },
+    title() {
+      return this.IS_LEVEL ? "分档进度" : "打分进度";
+    },
     showPaperRelateCount() {
       return !!this.paramsSet["showPaperCount"];
     }

+ 6 - 2
src/modules/grading/marker/MarkerHeader.vue

@@ -102,7 +102,7 @@
         >
           <span class="el-dropdown-link">
             <i>{{ curStep.name }}</i>
-            <i v-if="showPaperRelateCount">:{{ curStep.count }}</i>
+            <i v-if="showPaperRelateCount">:{{ curStep.count }} </i>
             <Icon type="ios-arrow-down"></Icon>
           </span>
           <DropdownMenu slot="list">
@@ -126,7 +126,7 @@
         </Dropdown>
       </div>
       <div v-if="IS_MARK_LEADER" class="header-part" @click="toProgress">
-        <p>分档进度 <Icon type="ios-arrow-down"></Icon></p>
+        <p>{{ stageName }}进度 <Icon type="ios-arrow-down"></Icon></p>
       </div>
       <div v-if="showStandard" class="header-part" @click="toStandard">
         <p>标准卷 <Icon type="ios-arrow-down"></Icon></p>
@@ -201,11 +201,15 @@ export default {
       "curStep",
       "steps",
       "curArea",
+      "curSubject",
       "areas"
     ]),
     IS_MARK_LEADER() {
       return this.curUserRoleType === "MARK_LEADER";
     },
+    stageName() {
+      return this.curSubject.stage === "LEVEL" ? "分档" : "打分";
+    },
     showPaperRelateCount() {
       return !!this.paramsSet["showPaperCount"];
     }

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

@@ -54,6 +54,10 @@ export default {
     stage: {
       type: String,
       default: "LEVEL"
+    },
+    canSelect: {
+      type: Boolean,
+      default: true
     }
   },
   computed: {

+ 1 - 1
src/modules/login/LoginHome.vue

@@ -97,7 +97,7 @@ export default {
           router: "LeaderGrading"
         },
         MARK_LEADER_SCORE: {
-          router: "Mark"
+          router: "LeaderMarking"
         },
         INSPECTION: {
           router: "Inspection"

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

@@ -359,13 +359,6 @@ export default {
       this.selectPaper(index);
       this.$refs.SimpleImagePreview.open();
     },
-    toExport() {
-      window.open(
-        this.urlAddAuthor(
-          `${this.GLOBAL.domain}/api/export/paper/${this.workId}/${this.subject}/changeLevel`
-        )
-      );
-    },
     selectPaper(index) {
       let nindex = index;
       if (!this.papers.length) {

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

@@ -0,0 +1,454 @@
+<template>
+  <div class="leader-marking marker-grading">
+    <marker-header
+      :show-standard="false"
+      :show-statistics="false"
+      @area-change="areaChange"
+      @step-change="stepChange"
+      @page-set-change="pageSetChange"
+      @to-progress="toProgress"
+      @to-history="toHistory"
+      @to-statistics="toStatistics"
+    ></marker-header>
+
+    <div
+      :class="[
+        'marker-action',
+        { 'marker-action-fullscreen': isFullscreenMarking }
+      ]"
+    >
+      <mark-action
+        :cur-paper-or-task="curPaper"
+        :levels="levels"
+        @on-leader-level="leaderSelectLevel"
+        @on-code-search="serachPaperByCode"
+        @on-grade-change-search="searchGradeChangeList"
+        v-if="curPaper.id"
+        ref="GradeAction"
+      ></mark-action>
+    </div>
+
+    <div class="marker-body">
+      <div :class="markerImageListClasses" v-if="papers.length">
+        <div
+          v-for="(paper, index) in papers"
+          :key="paper.id"
+          :class="[
+            'marker-image-item',
+            {
+              'marker-image-item-act': curPaperIndex === index
+            }
+          ]"
+        >
+          <div class="marker-image-content">
+            <marker-image-view
+              :data="paper"
+              :stage="stage"
+              @to-review="toReview(index)"
+            ></marker-image-view>
+          </div>
+        </div>
+      </div>
+      <div v-else class="marker-image-none">暂无数据</div>
+    </div>
+
+    <!-- LeaderProgress -->
+    <leader-progress ref="LeaderProgress"></leader-progress>
+    <!-- MarkerHistory -->
+    <marker-history
+      :question-id="filter.questionId"
+      :stage="stage"
+      @on-paper-click="
+        (index, papers) => {
+          toViewCarouselPaper(index, papers);
+        }
+      "
+      ref="MarkerHistory"
+    ></marker-history>
+    <!-- image-preview -->
+    <simple-image-preview
+      class="grading-operation-image-preview"
+      :cur-image="curPaper"
+      @on-prev="toPrevPaper"
+      @on-next="toNextPaper"
+      @on-close="isFullscreenMarking = false"
+      ref="SimpleImagePreview"
+    ></simple-image-preview>
+    <!-- carousel paper review -->
+    <simple-image-preview
+      class="grading-operation-image-preview"
+      :cur-image="curPaper"
+      @on-prev="toCarousePaper('prev')"
+      @on-next="toCarousePaper('next')"
+      @on-close="carouseImagePreviewClose"
+      ref="CarouselPapersPreview"
+    ></simple-image-preview>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import MarkerHeader from "../../grading/marker/MarkerHeader";
+import MarkAction from "../components/MarkAction";
+import SimpleImagePreview from "@/components/SimpleImagePreview";
+import LeaderProgress from "../../grading/leader/LeaderProgress";
+import MarkerImageView from "../../grading/marker/MarkerImageView";
+import MarkerHistory from "../../grading/marker/MarkerHistory";
+
+import {
+  paperList,
+  subjectDetail,
+  changeLevelPaperList,
+  paperManualScoreList,
+  scoreStatData,
+  workLevelList,
+  taskSnSearch,
+  markStepChangeLevel,
+  getParamsSet
+} from "@/api";
+
+export default {
+  name: "leader-marking",
+  components: {
+    MarkerHeader,
+    MarkerImageView,
+    MarkerHistory,
+    // MarkerStatistics,
+    LeaderProgress,
+    MarkAction,
+    SimpleImagePreview
+  },
+  data() {
+    return {
+      filter: {
+        questionId: "",
+        sort: "score,desc"
+      },
+      stage: "SCORE",
+      workId: this.$route.params.workId,
+      subjectId: this.$route.params.subjectId,
+      subject: "",
+      workSubject: {},
+      curUserRoleType: "",
+      applyChangeLevelStatus: 1, // 改档申请处理状态
+      levels: [],
+      papers: [],
+      curPaper: {},
+      curPaperIndex: 0,
+      // carousel paper review,
+      carouselPapers: [],
+      curCarouselPaperIndex: 0,
+      isFullscreenMarking: false
+    };
+  },
+  computed: {
+    ...mapState("marker", ["paramsSet", "page", "steps", "curStep", "curArea"]),
+    markerImageListClasses() {
+      return ["marker-image-list", `marker-image-list-${this.page.size}`];
+    },
+    showPaperRelateCount() {
+      return !!this.paramsSet["showPaperCount"];
+    }
+  },
+  created() {
+    this.subject = this.subjectId.split("-")[1];
+    this.workSubject = {
+      workId: this.workId,
+      subject: this.subject
+    };
+    this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    this.initData();
+  },
+  methods: {
+    ...mapMutations("marker", [
+      "setParamSet",
+      "setPage",
+      "setSteps",
+      "setCurArea",
+      "setCurStep",
+      "setCurSubject",
+      "clearState"
+    ]),
+    initData() {
+      this.getWorkLevels();
+      this.getSubjectDetail();
+      this.getParamsSetInfo();
+    },
+    async getParamsSetInfo() {
+      const data = await getParamsSet(this.workId);
+      this.setParamSet(data || {});
+    },
+    async getSubjectDetail() {
+      const curSubject = await subjectDetail(this.subjectId);
+      this.setCurSubject(curSubject || {});
+    },
+    async getList() {
+      let data = [];
+      if (this.curStep.type === "shift") {
+        const datas = {
+          workId: this.workId,
+          subject: this.subject,
+          questionId: this.filter.questionId,
+          status: this.applyChangeLevelStatus,
+          page: this.page.current - 1,
+          size: this.page.size
+        };
+        data = await changeLevelPaperList(datas);
+      } else if (this.curStep.type === "manualScore") {
+        const datas = {
+          workId: this.workId,
+          questionId: this.filter.questionId,
+          page: this.page.current - 1,
+          size: this.page.size
+        };
+        data = await paperManualScoreList(datas);
+      } else {
+        const datas = {
+          ...this.filter,
+          isScore: true,
+          page: this.page.current - 1,
+          size: this.page.size
+        };
+        if (this.curStep.type === "done") datas.level = this.curStep.name;
+
+        data = await paperList(datas);
+      }
+      this.papers = data.data.map(paper => {
+        paper.title = this.IS_ADMIN ? paper.examNumber : `NO.${paper.sn}`;
+        return paper;
+      });
+
+      this.setPage({
+        total: data.totalCount,
+        totalPage: data.pageCount
+      });
+    },
+    async toPage(page) {
+      this.setPage({
+        current: page
+      });
+      await this.getList();
+      this.selectPaper(this.curPaperIndex);
+    },
+    async getStepLevels() {
+      const data = await scoreStatData(this.subjectId, this.filter.questionId);
+      const undoIndex = data.findIndex(item => item.id === null);
+      let otherStep = [];
+      let undo = {
+        count: 0,
+        shift: 0
+      };
+      if (undoIndex !== -1) {
+        undo = { ...data[undoIndex] };
+        data.splice(undoIndex, 1);
+      }
+      otherStep.push({
+        name: "待评",
+        count: undo.count,
+        type: "undo"
+      });
+      otherStep.push({
+        name: "改档",
+        count: undo.shift,
+        type: "shift"
+      });
+      let levelStep = data
+        .filter(item => item.id !== "manualScore")
+        .map(item => {
+          return {
+            ...item,
+            name: item.id,
+            type: "done"
+          };
+        });
+      const msInfo = data.find(item => item.id === "manualScore");
+      if (msInfo) {
+        levelStep.push({
+          count: msInfo.count,
+          name: "输分试卷",
+          type: "manualScore"
+        });
+      }
+
+      this.setSteps({ levelStep, otherStep });
+
+      if (!this.curStep.type) {
+        this.setCurStep(levelStep[0]);
+      } else {
+        const curStep = [...levelStep, ...otherStep].find(
+          item => item.name === this.curStep.name
+        );
+        this.setCurStep(curStep);
+      }
+    },
+    async getWorkLevels() {
+      const data = await workLevelList(this.workId);
+      this.levels = data.map(item => {
+        return {
+          ...item,
+          name: item.code
+        };
+      });
+    },
+    pageSetChange() {
+      this.papers = [];
+      this.getList();
+    },
+    async stepChange(step) {
+      this.applyChangeLevelStatus = 1;
+      this.setCurStep(step);
+      this.setPage({ current: 1 });
+      this.isFullscreenMarking = false;
+      await this.getList();
+      this.getStepLevels();
+      if (this.papers.length) {
+        this.selectPaper(0);
+      } else {
+        this.curPaper = {};
+      }
+    },
+    async areaChange(curArea) {
+      this.setCurArea(curArea);
+      this.filter.questionId = curArea.id;
+      await this.getStepLevels();
+      this.toPage(1);
+    },
+    toReview(index) {
+      this.isFullscreenMarking = true;
+      this.selectPaper(index);
+      this.$refs.SimpleImagePreview.open();
+    },
+    selectPaper(index) {
+      let nindex = index;
+      if (!this.papers.length) {
+        nindex = 0;
+      } else if (index > this.papers.length - 1) {
+        nindex = this.papers.length - 1;
+      } else if (index < 0) {
+        nindex = 0;
+      }
+      this.curPaperIndex = nindex;
+      this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
+    },
+    async toPrevPaper() {
+      if (this.curPaperIndex === 0) {
+        if (this.page.current > 1) {
+          this.setPage({ current: this.page.current - 1 });
+          this.curPaperIndex = this.page.size - 1;
+          await this.getList();
+        } else {
+          this.$Message.warning("当前已经是第一条数据了");
+          return;
+        }
+      } else {
+        this.curPaperIndex--;
+      }
+
+      this.selectPaper(this.curPaperIndex);
+    },
+    async toNextPaper() {
+      if (this.curPaperIndex === this.papers.length - 1) {
+        if (this.page.current === this.page.totalPage) {
+          this.$Message.warning("当前已经是最后一条数据了");
+          return;
+        } else {
+          this.setPage({ current: this.page.current + 1 });
+          this.curPaperIndex = 0;
+          await this.getList();
+        }
+      } else {
+        this.curPaperIndex++;
+      }
+
+      this.selectPaper(this.curPaperIndex);
+    },
+    async toActionNextPaper() {
+      if (this.page.current > 1 && this.papers.length === 1) {
+        this.setPage({ current: this.page.current - 1 });
+        this.curPaperIndex = this.page.size;
+      }
+
+      await this.getList();
+      if (!this.papers.length) this.$refs.SimpleImagePreview.cancel();
+      this.selectPaper(this.curPaperIndex);
+    },
+    async serachPaperByCode(params) {
+      const data = await taskSnSearch(
+        params.codeType,
+        params.code,
+        this.filter.questionId
+      );
+      if (!data) {
+        this.$Message.error("没有查找到结果!");
+        return;
+      }
+      data.title = this.IS_ADMIN ? data.examNumber : `NO.${data.sn}`;
+      this.papers = [data];
+      this.setPage({ current: 1, total: 1, totalPage: 1 });
+      this.selectPaper(0);
+    },
+    searchGradeChangeList(applyChangeLevelStatus) {
+      this.applyChangeLevelStatus = applyChangeLevelStatus;
+      this.toPage(1);
+    },
+    leaderSelectLevel(levelInfo) {
+      const content = `确定申请由${levelInfo.curLevel}档改为${levelInfo.selectedLevel}并打回给所有老师吗?`;
+      this.$Modal.confirm({
+        content,
+        onOk: async () => {
+          await markStepChangeLevel({
+            subjectId: this.subjectId,
+            paperId: levelInfo.paperId,
+            level: levelInfo.selectedLevel,
+            userId: this.$ls.get("user", { id: "" }).id
+          });
+          this.$Message.success("申请改档成功!");
+          this.getStepLevels();
+          this.toActionNextPaper();
+        }
+      });
+    },
+    // paper carousel
+    toViewCarouselPaper(paperIndex, papers) {
+      this.isFullscreenMarking = true;
+      this.carouselPapers = papers;
+      this.selectCarouselPaper(paperIndex);
+      this.$nextTick(() => {
+        this.$refs.CarouselPapersPreview.open();
+      });
+    },
+    selectCarouselPaper(index) {
+      this.curCarouselPaperIndex = index;
+      this.curPaper = { ...this.carouselPapers[index] };
+    },
+    toCarousePaper(type) {
+      if (type === "prev" && this.curCarouselPaperIndex > 0) {
+        this.curCarouselPaperIndex--;
+      } else if (
+        type === "next" &&
+        this.curCarouselPaperIndex < this.carouselPapers.length - 1
+      ) {
+        this.curCarouselPaperIndex++;
+      }
+      this.selectCarouselPaper(this.curCarouselPaperIndex);
+    },
+    carouseImagePreviewClose() {
+      this.isFullscreenMarking = false;
+      this.selectPaper(this.curPaperIndex);
+    },
+    // header
+    toHistory() {
+      this.$refs.MarkerHistory.open();
+    },
+    toStatistics() {
+      this.$refs.MarkerStatistics.open();
+    },
+    toProgress() {
+      this.$refs.LeaderProgress.open();
+    }
+  },
+  beforeDestroy() {
+    this.clearState();
+  }
+};
+</script>

+ 7 - 4
src/modules/mark/marker/MarkerMarking.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="marker-marking marker-grading">
     <marker-header
+      v-if="paramsSetReady"
       :show-standard="false"
       :show-statistics="false"
       @area-change="areaChange"
@@ -110,7 +111,6 @@ export default {
     MarkerHeader,
     MarkerImageView,
     MarkerHistory,
-    // MarkerStatistics,
     MarkAction,
     SimpleImagePreview
   },
@@ -153,6 +153,7 @@ export default {
       papers: [],
       curPaper: {},
       curPaperIndex: 0,
+      paramsSetReady: false,
       // carousel paper review,
       carouselPapers: [],
       curCarouselPaperIndex: 0,
@@ -185,14 +186,15 @@ export default {
       "setCurStep",
       "clearState"
     ]),
-    async initData() {
-      await this.getParamsSetInfo();
-      await this.getWorkLevels();
+    initData() {
+      this.getParamsSetInfo();
+      this.getWorkLevels();
     },
     async getParamsSetInfo() {
       const data = await getParamsSet(this.workId);
       this.setParamSet(data || {});
       this.changeStage = this.paramsSet.changeStage;
+      this.paramsSetReady = true;
     },
     async getList() {
       const datas = {
@@ -288,6 +290,7 @@ export default {
       }
 
       this.setSteps({ levelStep, otherStep });
+
       if (!this.curStep.name) {
         let curStep = {};
         if (undoIndex === -1) {

+ 9 - 0
src/routers/mark.js

@@ -10,6 +10,7 @@ import ExamPaperView from "../modules/main/ExamPaperView";
 // 阅卷员打分
 import MarkOperation from "../modules/mark/MarkOperation";
 import MarkerMarking from "../modules/mark/marker/MarkerMarking";
+import LeaderMarking from "../modules/mark/leader/LeaderMarking";
 
 const markRoutes = [
   {
@@ -86,5 +87,13 @@ export default [
     meta: {
       title: "阅卷员打分"
     }
+  },
+  {
+    path: "/leader-marking/:workId(\\d+)/:subjectId",
+    name: "LeaderMarking",
+    component: LeaderMarking,
+    meta: {
+      title: "科组长打分"
+    }
   }
 ];