zhangjie 2 rokov pred
rodič
commit
5edcf02d35

+ 2 - 3
src/api.js

@@ -119,7 +119,6 @@ export const enableSubject = subjectId => {
 };
 // param-set
 export const getParamsSet = async workId => {
-  // TODO:所有使用param的地方都要修改
   const data = await $get("/api/param/getParam", { workId });
   let result = {};
   const keys = [
@@ -286,8 +285,8 @@ export const createGradingTask = ({ subjectId, taskCount, questionId }) => {
   );
 };
 // 进入打分阶段,和上面掉的同一个接口,分开是为了便于区分
-export const gotoScoreStep = subjectId => {
-  return $patch(`/api/marksubjects/${subjectId}`, {}, "json");
+export const gotoNextStage = ({ workId, subject }) => {
+  return $post(`/api/marksubjects/go_next_stage`, { workId, subject });
 };
 // 打分任务发布
 export const publishScoreTask = ({ subjectId, questionId, taskList }) => {

+ 0 - 7
src/assets/styles/base.less

@@ -139,13 +139,6 @@ body {
     display: flex;
     align-items: stretch;
     justify-content: space-between;
-
-    &-right {
-      padding-bottom: 10px;
-      white-space: nowrap;
-      display: flex;
-      align-items: flex-end;
-    }
   }
 }
 .part-title {

+ 1 - 0
src/constants/enumerate.js

@@ -18,6 +18,7 @@ export const BOOLEAN_TYPE = {
 // subject step
 export const SUBJECT_STAGE = {
   INIT: "采集阶段",
+  ROUGH_LEVEL: "粗分档阶段",
   LEVEL: "分档阶段",
   SCORE: "打分阶段"
 };

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

@@ -30,6 +30,7 @@
           ></grade-standard-paper>
           <grade-history-paper
             :question-id="filter.questionId"
+            :stage="curSubject.stage"
             @on-paper-click="
               (index, papers) => {
                 toViewCarouselPaper(index, papers, 'history');
@@ -157,6 +158,7 @@
     <modify-leader-grading
       :level-info="levelInfo"
       :markers="markers"
+      :stage="curSubject.stage"
       @modified="leaderGradingSuccess"
       @canceled="leaderGradingCancel"
       ref="ModifyLeaderGrading"
@@ -418,7 +420,7 @@ export default {
 
       const data = await markHistoryList(
         this.multipleGradingList[0].id,
-        "LEVEL"
+        this.curSubject.stage
       ).catch(() => {});
       this.multiplebtnClicked = false;
       if (!data) return;
@@ -504,7 +506,7 @@ export default {
         params.codeType,
         params.code,
         this.filter.questionId,
-        "LEVEL"
+        this.curSubject.stage
       );
       if (!data) {
         this.$Message.error("没有查找到结果!");
@@ -526,7 +528,7 @@ export default {
           level: levelInfo.selectedLevel,
           originLevel: levelInfo.curLevel,
           paperIds: levelInfo.paperIds,
-          stage: "LEVEL"
+          stage: this.curSubject.stage
         };
         if (datas.action === "reject") {
           datas.range = markers.map(item => item.id).join();

+ 9 - 2
src/modules/grading/GradingOperation.vue

@@ -175,6 +175,7 @@ import {
   markerTaskList,
   markerLevelTotalStatData,
   getParamsSet,
+  subjectDetail,
   workLevelList,
   paperSelectLevelOrScore,
   paperSelectLevelBatch,
@@ -269,11 +270,17 @@ export default {
   methods: {
     async initData() {
       await this.getParamsSetInfo();
+      await this.getSubjectDetail();
       await this.getWorkLevels();
     },
     async getParamsSetInfo() {
       this.paramsSet = await getParamsSet(this.workId);
     },
+    async getSubjectDetail() {
+      const curSubject = await subjectDetail(this.subjectId);
+      this.curSubject = curSubject || {};
+      this.filter.stage = this.curSubject.stage;
+    },
     async getList() {
       this.multipleGradingList = [];
       const datas = {
@@ -425,7 +432,7 @@ export default {
       const papers = await paperSelectLevelBatch(
         this.multipleGradingList.map(item => item.id).join(), // is taskId
         level.name,
-        "LEVEL"
+        this.curSubject.stage
       ).catch(() => {
         result = false;
       });
@@ -515,7 +522,7 @@ export default {
       const paper = await paperSelectLevelOrScore(
         this.curPaper.id, // is taskId
         level.name,
-        "LEVEL"
+        this.curSubject.stage
       );
       // this.getStepLevels();
       this.updateStepLevel(this.curStep, level.name, 1);

+ 41 - 49
src/modules/grading/GradingProgress.vue

@@ -1,18 +1,20 @@
 <template>
   <div class="grading-progress">
     <div class="part-box-head" v-if="IS_ADMIN">
-      <div class="part-box-head-left" v-if="IS_LEVEL">
-        <Button shape="circle" icon="md-download" @click="toExportStandard"
-          >导出标准卷信息</Button
-        >
-        <Button shape="circle" icon="md-download" @click="toExportGrading"
-          >导出一键定档信息</Button
-        >
-      </div>
-      <div v-if="IS_SCORE" class="part-box-head-left">
-        <Button shape="circle" icon="md-download" @click="toExportChangeLevel"
-          >导出改档信息</Button
-        >
+      <div class="part-box-head-left">
+        <template v-if="IS_LEVEL">
+          <Button shape="circle" icon="md-download" @click="toExportStandard"
+            >导出标准卷信息</Button
+          >
+          <Button shape="circle" icon="md-download" @click="toExportGrading"
+            >导出一键定档信息</Button
+          >
+        </template>
+        <template v-if="IS_SCORE">
+          <Button shape="circle" icon="md-download" @click="toExportChangeLevel"
+            >导出改档信息</Button
+          >
+        </template>
       </div>
       <div class="part-box-head-right">
         <Button
@@ -39,8 +41,8 @@
           v-if="showTryGradingBtn"
           >试评任务创建</Button
         >
-        <Button shape="circle" @click="toMark" v-if="showMarkBtn"
-          >进入打分阶段
+        <Button shape="circle" @click="toNextStage"
+          >进入下一阶段
           <Icon type="arrow-right-long icon" style="margin-left:8px;" />
         </Button>
       </div>
@@ -149,7 +151,7 @@ import CleanGradingDataDialog from "./components/CleanGradingDataDialog";
 import {
   gradingProgressDetail,
   subjectDetail,
-  gotoScoreStep,
+  gotoNextStage,
   getParamsSet
 } from "@/api";
 import { SUBJECT_STAGE } from "@/constants/enumerate";
@@ -187,36 +189,16 @@ export default {
       if (this.paramsSet.collectConfig.paperStage) return false;
 
       return (
-        (this.curSubject.stage == "INIT" &&
-          this.curSubject.test !== 2 &&
-          this.totalProgress.progress > 0) ||
-        (this.curSubject.stage == "LEVEL" &&
-          this.totalProgress.progress !== 100 &&
-          this.curSubject.test === 0)
+        this.IS_LEVEL &&
+        this.curSubject.test !== 2 &&
+        this.totalProgress.progress !== 100
       );
     },
     showTryGradingBtn() {
       // 采集时已知档位,则不显示试评任务按钮
       if (this.paramsSet.collectConfig.paperStage) return false;
 
-      return (
-        (this.curSubject.stage == "INIT" &&
-          this.curSubject.test !== 2 &&
-          this.totalProgress.progress > 0) ||
-        (this.curSubject.stage == "LEVEL" && this.curSubject.test === 2)
-      );
-    },
-    showMarkBtn() {
-      // 采集时已知档位,分档阶段则可直接进入打分
-      if (this.paramsSet.collectConfig.paperStage)
-        return this.curSubject.stage == "LEVEL";
-
-      // 若不知档位,则必须分档进度为100时,才能进入打分
-      return (
-        (this.curSubject.stage == "LEVEL" &&
-          this.totalProgress.progress === 100) ||
-        (this.curSubject.stage == "SCORE" && !this.curSubject.allLevel)
-      );
+      return this.IS_LEVEL && !this.curSubject.formal;
     },
     IS_ADMIN() {
       return this.curUserRoleType === "ADMIN";
@@ -225,7 +207,10 @@ export default {
       return this.curUserRoleType === "MARK_LEADER";
     },
     IS_LEVEL() {
-      return this.curSubject.stage === "LEVEL";
+      return (
+        this.curSubject.stage === "LEVEL" ||
+        this.curSubject.stage === "ROUGH_LEVEL"
+      );
     },
     IS_SCORE() {
       return this.curSubject.stage === "SCORE";
@@ -291,18 +276,25 @@ export default {
     toTryGrading() {
       this.$refs.ModifyUnformalGradingTask.open();
     },
-    toMark() {
+    toNextStage() {
       this.$Modal.confirm({
-        content: "确定要进入打分阶段吗?",
+        content: "确定要进入下一阶段吗?",
         onOk: async () => {
-          await gotoScoreStep(this.subjectId);
-          this.$router.replace({
-            name: "Mark",
-            params: {
-              workId: this.curSubject.workId,
-              subjectId: this.subjectId
-            }
+          await gotoNextStage({
+            workId: this.curSubject.workId,
+            subject: this.curSubject.subject
           });
+          if (this.IS_SCORE) {
+            this.$router.replace({
+              name: "Mark",
+              params: {
+                workId: this.workId,
+                subjectId: this.subjectId
+              }
+            });
+          } else {
+            window.location.reload();
+          }
         }
       });
     },

+ 9 - 2
src/modules/grading/GradingStandardPaperManage.vue

@@ -138,7 +138,8 @@ import {
   sampleAreaList,
   workLevelList,
   cancelStandardPaper,
-  leaderGradingPaper
+  leaderGradingPaper,
+  subjectDetail
 } from "@/api";
 import SimpleImagePreview from "@/components/SimpleImagePreview";
 
@@ -160,6 +161,7 @@ export default {
       paperList: [],
       papers: [],
       curPaper: {},
+      curSubject: {},
       curPaperIndex: 0,
       // change standard
       modalIsShow: false,
@@ -178,6 +180,7 @@ export default {
       this.questionId = this.areas[0] && this.areas[0].id;
       if (!this.questionId) return;
       await this.getWorkLevels();
+      await this.getSubjectDetail();
       this.search();
     },
     async getWorkLevels() {
@@ -197,6 +200,10 @@ export default {
         };
       });
     },
+    async getSubjectDetail() {
+      const curSubject = await subjectDetail(this.subjectId);
+      this.curSubject = curSubject || {};
+    },
     async search() {
       this.lastQuestionId = this.questionId;
       await this.getPaperList();
@@ -275,7 +282,7 @@ export default {
         level: this.curSelectLevel,
         originLevel: this.curChangePaper.level,
         paperIds: this.curChangePaper.id,
-        stage: "LEVEL"
+        stage: this.curSubject.stage
       };
       let result = true;
       await leaderGradingPaper(datas).catch(() => {

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

@@ -318,7 +318,7 @@ export default {
     };
   },
   computed: {
-    ...mapState("marker", ["ribbonSet", "shortcutKeyStatus"]),
+    ...mapState("marker", ["ribbonSet", "shortcutKeyStatus", "curSubject"]),
     IS_ADMIN() {
       return this.curUserRoleType === "ADMIN";
     },
@@ -428,7 +428,10 @@ export default {
     },
     async getMarkHistory() {
       // 只有科组长和超管才会展示评卷记录
-      const data = await markHistoryList(this.curPaperOrTask.id, "LEVEL");
+      const data = await markHistoryList(
+        this.curPaperOrTask.id,
+        this.curSubject.stage
+      );
       this.gradingHistory = data.map(item => {
         let level = item.result || "未评";
         if (this.stepType === "reject" && !item.result) {

+ 5 - 1
src/modules/grading/components/ModifyLeaderGrading.vue

@@ -72,6 +72,10 @@ export default {
       default() {
         return [];
       }
+    },
+    stage: {
+      type: String,
+      default: "LEVEL"
     }
   },
   data() {
@@ -130,7 +134,7 @@ export default {
         level: this.levelInfo.selectedLevel,
         originLevel: this.levelInfo.curLevel,
         paperIds: this.levelInfo.paperIds,
-        stage: "LEVEL"
+        stage: this.stage
       };
       if (this.actionType === "reject")
         datas.range = this.selectedMarkers.join();

+ 160 - 158
src/modules/grading/components/ModifyUnformalGradingTask.vue

@@ -1,158 +1,160 @@
-<template>
-  <Modal
-    class="modify-unformal-grading-task"
-    v-model="modalIsShow"
-    title="创建试评任务"
-    :mask-closable="false"
-    @on-visible-change="visibleChange"
-  >
-    <div class="task-body" v-if="!unformalGradingIsRunning">
-      <upload-button
-        btn-icon="md-cloud-upload"
-        :btn-content="uploadBtnName"
-        :upload-url="uploadUrl"
-        :upload-data="uploadData"
-        :headers="headers"
-        :format="['xls', 'xlsx']"
-        :auto-upload="false"
-        @upload-success="uploadSuccess"
-        @file-change="selectedFile"
-        ref="UploadButton"
-      >
-        <Button
-          type="primary"
-          shape="circle"
-          :disabled="$refs.UploadButton && $refs.UploadButton.loading"
-          @click="startUpload"
-          style="margin-left: 10px"
-          slot="extra"
-          >开始上传</Button
-        >
-      </upload-button>
-    </div>
-    <div class="task-body" v-else>
-      <p class="task-tips">当前已经开始试评</p>
-    </div>
-    <div class="task-action" slot="footer">
-      <Button
-        shape="circle"
-        type="error"
-        :disabled="isSubmit"
-        @click="toOverTask"
-        v-if="unformalGradingIsRunning"
-        >结束并清空数据</Button
-      >
-      <Button shape="circle" @click="cancel">取消</Button>
-      <Button
-        shape="circle"
-        type="primary"
-        :disabled="isSubmit || !uploadFileIsSuccess"
-        v-if="!unformalGradingIsRunning"
-        @click="toStartTask"
-        >开始试评</Button
-      >
-    </div>
-  </Modal>
-</template>
-
-<script>
-import { createTryGradingTask, finishTryGradingTask } from "@/api";
-import UploadButton from "@/components/UploadButton";
-
-export default {
-  name: "modify-unformal-grading-task",
-  components: { UploadButton },
-  props: {
-    curSubject: {
-      type: Object,
-      default() {
-        return {};
-      }
-    }
-  },
-  data() {
-    return {
-      modalIsShow: false,
-      isSubmit: false,
-      uploadData: {},
-      headers: {
-        Authorization: this.$ls.get("user", { token: "" }).token,
-        workId: this.$route.params.workId,
-        userId: this.$ls.get("user", { id: "" }).id
-      },
-      uploadBtnName: "导入考生数据",
-      uploadUrl: this.GLOBAL.domain + "/api/import/students/batchAllForTrial",
-      uploadFileIsSuccess: false,
-      unformalGradingIsRunning: false
-    };
-  },
-  created() {
-    this.uploadData = {
-      workId: this.curSubject.workId,
-      subject: this.curSubject.subject
-    };
-  },
-  methods: {
-    visibleChange(visible) {
-      if (visible) {
-        this.uploadFileIsSuccess = false;
-        this.isSubmit = false;
-        this.unformalGradingIsRunning =
-          this.curSubject.stage == "LEVEL" && this.curSubject.test === 2;
-      }
-    },
-    cancel() {
-      this.modalIsShow = false;
-    },
-    open() {
-      this.modalIsShow = true;
-    },
-    startUpload() {
-      this.$refs.UploadButton.startUpload();
-    },
-    selectedFile(file) {
-      this.uploadBtnName = file.name;
-    },
-    uploadSuccess(response) {
-      this.uploadBtnName = "导入考生数据";
-      this.uploadFileIsSuccess = true;
-    },
-    async toStartTask() {
-      if (this.isSubmit) return;
-      this.isSubmit = true;
-      let result = true;
-      await createTryGradingTask(this.uploadData).catch(() => {
-        result = false;
-      });
-      this.isSubmit = false;
-      if (!result) return;
-
-      this.$Message.success("发布任务成功!");
-      this.$emit("modified");
-      this.cancel();
-    },
-    async toOverTask() {
-      if (this.isSubmit) return;
-      this.isSubmit = true;
-
-      this.$Modal.confirm({
-        content: "确定要结束试评任务并清空所有试评数据吗?",
-        onOk: async () => {
-          const data = await finishTryGradingTask(
-            this.uploadData
-          ).catch(() => {});
-          this.isSubmit = false;
-          if (!data) return;
-
-          this.$Message.success("操作成功!");
-          this.$emit("modified");
-          this.cancel();
-        },
-        onCancel: () => {
-          this.isSubmit = false;
-        }
-      });
-    }
-  }
-};
-</script>
+<template>
+  <Modal
+    class="modify-unformal-grading-task"
+    v-model="modalIsShow"
+    title="创建试评任务"
+    :mask-closable="false"
+    @on-visible-change="visibleChange"
+  >
+    <div class="task-body" v-if="!unformalGradingIsRunning">
+      <upload-button
+        btn-icon="md-cloud-upload"
+        :btn-content="uploadBtnName"
+        :upload-url="uploadUrl"
+        :upload-data="uploadData"
+        :headers="headers"
+        :format="['xls', 'xlsx']"
+        :auto-upload="false"
+        @upload-success="uploadSuccess"
+        @file-change="selectedFile"
+        ref="UploadButton"
+      >
+        <Button
+          type="primary"
+          shape="circle"
+          :disabled="$refs.UploadButton && $refs.UploadButton.loading"
+          @click="startUpload"
+          style="margin-left: 10px"
+          slot="extra"
+          >开始上传</Button
+        >
+      </upload-button>
+    </div>
+    <div class="task-body" v-else>
+      <p class="task-tips">当前已经开始试评</p>
+    </div>
+    <div class="task-action" slot="footer">
+      <Button
+        shape="circle"
+        type="error"
+        :disabled="isSubmit"
+        @click="toOverTask"
+        v-if="unformalGradingIsRunning"
+        >结束并清空数据</Button
+      >
+      <Button shape="circle" @click="cancel">取消</Button>
+      <Button
+        shape="circle"
+        type="primary"
+        :disabled="isSubmit || !uploadFileIsSuccess"
+        v-if="!unformalGradingIsRunning"
+        @click="toStartTask"
+        >开始试评</Button
+      >
+    </div>
+  </Modal>
+</template>
+
+<script>
+import { createTryGradingTask, finishTryGradingTask } from "@/api";
+import UploadButton from "@/components/UploadButton";
+
+export default {
+  name: "modify-unformal-grading-task",
+  components: { UploadButton },
+  props: {
+    curSubject: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      uploadData: {},
+      headers: {
+        Authorization: this.$ls.get("user", { token: "" }).token,
+        workId: this.$route.params.workId,
+        userId: this.$ls.get("user", { id: "" }).id
+      },
+      uploadBtnName: "导入考生数据",
+      uploadUrl: this.GLOBAL.domain + "/api/import/students/batchAllForTrial",
+      uploadFileIsSuccess: false,
+      unformalGradingIsRunning: false
+    };
+  },
+  created() {
+    this.uploadData = {
+      workId: this.curSubject.workId,
+      subject: this.curSubject.subject
+    };
+  },
+  methods: {
+    visibleChange(visible) {
+      if (visible) {
+        this.uploadFileIsSuccess = false;
+        this.isSubmit = false;
+        this.unformalGradingIsRunning =
+          (this.curSubject.stage === "LEVEL" ||
+            this.curSubject.stage === "ROUGH_LEVEL") &&
+          this.curSubject.test === 2;
+      }
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    startUpload() {
+      this.$refs.UploadButton.startUpload();
+    },
+    selectedFile(file) {
+      this.uploadBtnName = file.name;
+    },
+    uploadSuccess(response) {
+      this.uploadBtnName = "导入考生数据";
+      this.uploadFileIsSuccess = true;
+    },
+    async toStartTask() {
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+      let result = true;
+      await createTryGradingTask(this.uploadData).catch(() => {
+        result = false;
+      });
+      this.isSubmit = false;
+      if (!result) return;
+
+      this.$Message.success("发布任务成功!");
+      this.$emit("modified");
+      this.cancel();
+    },
+    async toOverTask() {
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+
+      this.$Modal.confirm({
+        content: "确定要结束试评任务并清空所有试评数据吗?",
+        onOk: async () => {
+          const data = await finishTryGradingTask(
+            this.uploadData
+          ).catch(() => {});
+          this.isSubmit = false;
+          if (!data) return;
+
+          this.$Message.success("操作成功!");
+          this.$emit("modified");
+          this.cancel();
+        },
+        onCancel: () => {
+          this.isSubmit = false;
+        }
+      });
+    }
+  }
+};
+</script>

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

@@ -54,6 +54,7 @@
               ref="MarkerImageView"
               :data="paper"
               :can-select="ACTION_CAN_BATCH"
+              :stage="curSubject.stage"
               @to-review="toReview"
               @to-select="selectMultiplePaper"
             ></marker-image-view>
@@ -77,6 +78,7 @@
     <!-- MarkerHistory -->
     <marker-history
       :question-id="filter.questionId"
+      :stage="curSubject.stage"
       @on-paper-click="
         (index, papers) => {
           toViewCarouselPaper(index, papers, 'history');
@@ -89,6 +91,7 @@
     <marker-standard
       :question-id="filter.questionId"
       :levels="levels"
+      :stage="curSubject.stage"
       @on-paper-click="
         (index, papers) => {
           toViewCarouselPaper(index, papers, 'sample');
@@ -103,6 +106,7 @@
       class="marker-modal"
       :level-info="levelInfo"
       :markers="markers"
+      :stage="curSubject.stage"
       @modified="leaderGradingSuccess"
       ref="ModifyLeaderGrading"
     ></modify-leader-grading>
@@ -308,7 +312,7 @@ export default {
         ...params,
         workId: this.workId,
         subject: this.subject,
-        stage: "LEVEL",
+        stage: this.curSubject.stage,
         page: this.page.current - 1,
         size: this.page.size
       };
@@ -445,7 +449,7 @@ export default {
 
       const data = await markHistoryList(
         this.multipleGradingList[0].id,
-        "LEVEL"
+        this.curSubject.stage
       ).catch(() => {
         this.multiplebtnClicked = false;
       });
@@ -537,7 +541,7 @@ export default {
         params.codeType,
         params.code,
         this.filter.questionId,
-        "LEVEL"
+        this.curSubject.stage
       );
       if (!data) {
         this.$Message.error("没有查找到结果!");
@@ -562,7 +566,7 @@ export default {
           level: levelInfo.selectedLevel,
           originLevel: levelInfo.curLevel,
           paperIds: levelInfo.paperIds,
-          stage: "LEVEL"
+          stage: this.curSubject.stage
         };
         if (datas.action === "reject") {
           datas.range = markers.map(item => item.id).join();

+ 10 - 2
src/modules/grading/leader/LeaderProgress.vue

@@ -138,13 +138,21 @@ export default {
   computed: {
     ...mapState("marker", ["paramsSet", "curSubject"]),
     IS_LEVEL() {
-      return this.curSubject.stage === "LEVEL";
+      return (
+        this.curSubject.stage === "LEVEL" ||
+        this.curSubject.stage === "ROUGH_LEVEL"
+      );
     },
     IS_SCORE() {
       return this.curSubject.stage === "SCORE";
     },
     title() {
-      return this.IS_LEVEL ? "分档进度" : "打分进度";
+      const infos = {
+        ROUGH_LEVEL: "粗分档",
+        LEVEL: "分档",
+        SCORE: "打分"
+      };
+      return infos[this.curSubject.stage] + "进度";
     }
   },
   methods: {

+ 22 - 4
src/modules/grading/marker/MarkerGrading.vue

@@ -47,6 +47,7 @@
           <div class="marker-image-content">
             <marker-image-view
               :data="paper"
+              :stage="curSubject.stage"
               @to-review="toReview"
               @to-select="selectMultiplePaper"
             ></marker-image-view>
@@ -59,6 +60,7 @@
     <!-- MarkerHistory -->
     <marker-history
       :question-id="filter.questionId"
+      :stage="curSubject.stage"
       @on-paper-click="
         (index, papers) => {
           toViewCarouselPaper(index, papers, 'history');
@@ -71,6 +73,7 @@
     <marker-standard
       :question-id="filter.questionId"
       :levels="levels"
+      :stage="curSubject.stage"
       @on-paper-click="
         (index, papers) => {
           toViewCarouselPaper(index, papers, 'sample');
@@ -125,7 +128,8 @@ import {
   paperSelectLevelOrScore,
   paperSelectLevelBatch,
   paperTaskPass,
-  getParamsSet
+  getParamsSet,
+  subjectDetail
 } from "@/api";
 
 export default {
@@ -177,7 +181,14 @@ export default {
     };
   },
   computed: {
-    ...mapState("marker", ["paramsSet", "page", "steps", "curStep", "curArea"]),
+    ...mapState("marker", [
+      "paramsSet",
+      "page",
+      "steps",
+      "curStep",
+      "curArea",
+      "curSubject"
+    ]),
     markerImageListClasses() {
       return ["marker-image-list", `marker-image-list-${this.page.size}`];
     }
@@ -195,6 +206,7 @@ export default {
   methods: {
     ...mapMutations("marker", [
       "setParamSet",
+      "setCurSubject",
       "setPage",
       "setSteps",
       "setCurArea",
@@ -205,12 +217,18 @@ export default {
     ]),
     async initData() {
       await this.getParamsSetInfo();
+      await this.getSubjectDetail();
       await this.getWorkLevels();
     },
     async getParamsSetInfo() {
       const data = await getParamsSet(this.workId);
       this.setParamSet(data || {});
     },
+    async getSubjectDetail() {
+      const curSubject = await subjectDetail(this.subjectId);
+      this.setCurSubject(curSubject || {});
+      this.filter.stage = this.curSubject.stage;
+    },
     async getList() {
       this.clearMultiplePaper();
       const datas = {
@@ -391,7 +409,7 @@ export default {
       await paperSelectLevelBatch(
         this.multipleGradingList.map(item => item.id).join(), // is taskId
         level.name,
-        "LEVEL"
+        this.curSubject.stage
       ).catch(() => {
         result = false;
       });
@@ -482,7 +500,7 @@ export default {
       const paper = await paperSelectLevelOrScore(
         this.curPaper.id, // is taskId
         level.name,
-        "LEVEL"
+        this.curSubject.stage
       );
       if (!paper) return;
 

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

@@ -266,7 +266,7 @@
 import { mapState, mapMutations } from "vuex";
 import { areaList, leaderMarkUserList, logout } from "@/api";
 import ResetPwd from "@/modules/login/ResetPwd";
-import { CODE_TYPE } from "@/constants/enumerate";
+import { CODE_TYPE, SUBJECT_STAGE } from "@/constants/enumerate";
 
 export default {
   name: "marker-header",
@@ -320,7 +320,7 @@ export default {
       "shortcutKeyStatus"
     ]),
     stageName() {
-      return this.curSubject.stage === "LEVEL" ? "分档" : "打分";
+      return SUBJECT_STAGE[this.curSubject.stage];
     },
     IS_MARK_LEADER__SCORE() {
       return this.IS_MARK_LEADER && this.curSubject.stage === "SCORE";

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

@@ -68,7 +68,7 @@ export default {
   },
   computed: {
     IS_LEVEL() {
-      return this.stage === "LEVEL";
+      return this.stage === "LEVEL" || this.stage === "ROUGH_LEVEL";
     }
   },
   created() {

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

@@ -113,6 +113,10 @@ export default {
     questionId: {
       type: [Number, String]
     },
+    stage: {
+      type: String,
+      default: "LEVEL"
+    },
     levels: {
       type: Array,
       default() {
@@ -233,7 +237,7 @@ export default {
         level: this.curSelectLevel,
         originLevel: this.curChangePaper.level,
         paperIds: this.curChangePaper.id,
-        stage: "LEVEL"
+        stage: this.stage
       };
       let result = true;
       await leaderGradingPaper(datas).catch(() => {

+ 5 - 2
src/modules/login/LoginHome.vue

@@ -152,8 +152,11 @@ export default {
       const { role, markRight } = data;
       let routerType = role;
       if (role.includes("MARK")) {
+        const levelStages = ["LEVEL", "ROUGH_LEVEL"];
         const curSubject = await subjectDetail(params.subjectId);
-        const stage = curSubject.stage;
+        const stage = levelStages.includes(curSubject.stage)
+          ? "LEVEL"
+          : curSubject.stage;
         routerType = `${role}_${stage}`;
 
         if (stage === "INIT") {
@@ -162,7 +165,7 @@ export default {
         }
         if (role === "MARKER") {
           if (
-            (stage === "LEVEL" && markRight === "ALLOW_SCORING") ||
+            (levelStages.includes(stage) && markRight === "ALLOW_SCORING") ||
             (stage === "SCORE" && markRight === "ALLOW_LEVELING")
           ) {
             this.$Message.error("您的权限不够!");

+ 131 - 128
src/modules/mark/MarkHome.vue

@@ -1,128 +1,131 @@
-<template>
-  <div class="mark-home home">
-    <view-header key="1" :show-reset-pwd="false" v-if="IS_ADMIN">
-      <div class="grading-subnav" slot="navSub">
-        <div class="grading-title">
-          <h1>{{ curSubject.name }}</h1>
-          <span>当前阶段:打分阶段</span>
-        </div>
-        <div class="home-navs">
-          <ul>
-            <li
-              :class="{ act: curNav.name === nav.name }"
-              v-for="(nav, index) in navs"
-              :key="index"
-              @click="switchNav(nav)"
-            >
-              <i
-                :class="[
-                  'icon',
-                  curNav.name === nav.name ? `${nav.icon}-act` : nav.icon
-                ]"
-                v-if="nav.icon"
-              ></i>
-              <span class="nav-item-cont">{{ nav.title }}</span>
-            </li>
-          </ul>
-        </div>
-      </div>
-    </view-header>
-    <view-header key="2" v-else>
-      <div class="home-navs" slot="navSub">
-        <ul>
-          <li
-            :class="{ act: curNav.name === nav.name }"
-            v-for="(nav, index) in navs"
-            :key="index"
-            @click="switchNav(nav)"
-          >
-            <i
-              :class="[
-                'icon',
-                curNav.name === nav.name ? `${nav.icon}-act` : nav.icon
-              ]"
-              v-if="nav.icon"
-            ></i>
-            <span class="nav-item-cont">{{ nav.title }}</span>
-          </li>
-        </ul>
-      </div>
-    </view-header>
-
-    <div class="home-body">
-      <div class="home-main">
-        <router-view />
-
-        <!-- <view-footer></view-footer> -->
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import { subjectDetail } from "@/api";
-import { mark, main } from "@/constants/authority";
-import menuMixins from "@/components/homeMenuMixins";
-import { SUBJECT_STAGE } from "@/constants/enumerate";
-import { deepCopy } from "@/plugins/utils";
-
-export default {
-  name: "mark-home",
-  mixins: [menuMixins],
-  data() {
-    return {
-      subjectId: this.$route.params.subjectId,
-      navs: [],
-      curNav: {},
-      curSubject: { name: "" },
-      SUBJECT_STAGE,
-      IS_ADMIN: true
-    };
-  },
-  watch: {
-    $route: {
-      handler(val) {
-        this.actSubNav();
-      }
-    }
-  },
-  mounted() {
-    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
-    this.IS_ADMIN = curUserRoleType === "ADMIN";
-    this.initData();
-  },
-  methods: {
-    async initData() {
-      this.curSubject = await subjectDetail(this.subjectId);
-      if (this.curSubject.stage === "LEVEL") {
-        this.$router.replace({
-          name: "Grading",
-          params: {
-            workId: this.subjectId.split("-")[0],
-            subjectId: this.subjectId
-          }
-        });
-        return;
-      }
-      this.buildNavs();
-      this.actSubNav();
-    },
-    buildNavs() {
-      this.navs = deepCopy(mark);
-      if (this.IS_ADMIN) {
-        this.navs.pop();
-        this.navs = [...main.slice(0, 2), ...this.navs];
-      } else {
-        this.navs.splice(1, 1);
-        this.navs.splice(2, 1);
-      }
-    },
-    actSubNav() {
-      const router = this.$route.matched.filter(
-        item => item.name !== "Mark"
-      )[0];
-      this.actCurNav(router);
-    }
-  }
-};
-</script>
+<template>
+  <div class="mark-home home">
+    <view-header key="1" :show-reset-pwd="false" v-if="IS_ADMIN">
+      <div class="grading-subnav" slot="navSub">
+        <div class="grading-title">
+          <h1>{{ curSubject.name }}</h1>
+          <span>当前阶段:打分阶段</span>
+        </div>
+        <div class="home-navs">
+          <ul>
+            <li
+              :class="{ act: curNav.name === nav.name }"
+              v-for="(nav, index) in navs"
+              :key="index"
+              @click="switchNav(nav)"
+            >
+              <i
+                :class="[
+                  'icon',
+                  curNav.name === nav.name ? `${nav.icon}-act` : nav.icon
+                ]"
+                v-if="nav.icon"
+              ></i>
+              <span class="nav-item-cont">{{ nav.title }}</span>
+            </li>
+          </ul>
+        </div>
+      </div>
+    </view-header>
+    <view-header key="2" v-else>
+      <div class="home-navs" slot="navSub">
+        <ul>
+          <li
+            :class="{ act: curNav.name === nav.name }"
+            v-for="(nav, index) in navs"
+            :key="index"
+            @click="switchNav(nav)"
+          >
+            <i
+              :class="[
+                'icon',
+                curNav.name === nav.name ? `${nav.icon}-act` : nav.icon
+              ]"
+              v-if="nav.icon"
+            ></i>
+            <span class="nav-item-cont">{{ nav.title }}</span>
+          </li>
+        </ul>
+      </div>
+    </view-header>
+
+    <div class="home-body">
+      <div class="home-main">
+        <router-view />
+
+        <!-- <view-footer></view-footer> -->
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { subjectDetail } from "@/api";
+import { mark, main } from "@/constants/authority";
+import menuMixins from "@/components/homeMenuMixins";
+import { SUBJECT_STAGE } from "@/constants/enumerate";
+import { deepCopy } from "@/plugins/utils";
+
+export default {
+  name: "mark-home",
+  mixins: [menuMixins],
+  data() {
+    return {
+      subjectId: this.$route.params.subjectId,
+      navs: [],
+      curNav: {},
+      curSubject: { name: "" },
+      SUBJECT_STAGE,
+      IS_ADMIN: true
+    };
+  },
+  watch: {
+    $route: {
+      handler(val) {
+        this.actSubNav();
+      }
+    }
+  },
+  mounted() {
+    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    this.IS_ADMIN = curUserRoleType === "ADMIN";
+    this.initData();
+  },
+  methods: {
+    async initData() {
+      this.curSubject = await subjectDetail(this.subjectId);
+      if (
+        this.curSubject.stage === "LEVEL" ||
+        this.curSubject.stage === "ROUGH_LEVEL"
+      ) {
+        this.$router.replace({
+          name: "Grading",
+          params: {
+            workId: this.subjectId.split("-")[0],
+            subjectId: this.subjectId
+          }
+        });
+        return;
+      }
+      this.buildNavs();
+      this.actSubNav();
+    },
+    buildNavs() {
+      this.navs = deepCopy(mark);
+      if (this.IS_ADMIN) {
+        this.navs.pop();
+        this.navs = [...main.slice(0, 2), ...this.navs];
+      } else {
+        this.navs.splice(1, 1);
+        this.navs.splice(2, 1);
+      }
+    },
+    actSubNav() {
+      const router = this.$route.matched.filter(
+        item => item.name !== "Mark"
+      )[0];
+      this.actCurNav(router);
+    }
+  }
+};
+</script>