浏览代码

api md -progress

zhangjie 5 年之前
父节点
当前提交
0d5fafa224

二进制
public/templates/关联考生信息表-模板.xlsx


二进制
public/templates/考生信息表-模板.xlsx


二进制
public/templates/考生导入模板.xlsx


+ 22 - 10
src/api.js

@@ -22,7 +22,7 @@ export const updateWork = datas => {
   return $put(`/api/admin/works/${datas.id}`, datas, "json");
 };
 export const createWork = datas => {
-  return $post("/api/admin/works", datas);
+  return $post("/api/admin/works", datas, "json");
 };
 export const activeWork = workId => {
   return $patch(`/api/admin/works/${workId}`, {});
@@ -49,9 +49,7 @@ export const absentPaper = imageId => {
 
 // client-monitor
 export const clientMonitorList = datas => {
-  // TODO:
-  // return $get("/api/papers/listByQuestion", datas);
-  return Promise.resolve(datas);
+  return $get("/api/marklog/equipmentMonitor", datas);
 };
 
 // student-manage
@@ -197,18 +195,24 @@ export const markUserList = ({ workId, subjectId }) => {
   return $get("/api/markers", { workId, subject: subjectId });
 };
 // grading-progress
-export const gradingProgressDetail = subjectId => {
-  // TODO:
-  return $get(`/api/marksubjects/${subjectId}/markergroups`, {});
+export const gradingProgressDetail = ({ workId, subject }) => {
+  return $get("/api/markers/stat/progress", { workId, subject });
+};
+export const areaStatProgress = subjectId => {
+  return $get(`/api/marksubjects/${subjectId}/areaProgress`);
 };
 export const createTryGradingTask = datas => {
   // TODO:
   return $post(`/api/marksubjects/${datas.subjectId}/markergroups`, datas);
 };
-export const createGradingTask = datas => {
-  // TODO:
-  return $post(`/api/marksubjects/${datas.subjectId}/markergroups`, datas);
+// grade-task
+export const checkMissionStatus = ({ workId, subject }) => {
+  return $get("/api/trial/checkMissionStatus", { workId, subject });
+};
+export const createGradingTask = ({ subjectId, taskCount, questionId }) => {
+  return $patch(`/api/marksubjects/${subjectId}`, { taskCount, questionId });
 };
+
 // grading-detail
 // level relate
 export const workLevelList = workId => {
@@ -226,10 +230,18 @@ export const paperList = datas => {
   // ?questionId=64&level=A&page=0&size=6&sort=secretNumber&isSample=true
   return $get("/api/papers", datas);
 };
+export const markerPaperList = datas => {
+  // ?stage=LEVEL&markerId=49&size=6&page=0&sort=updatedOn,desc&questionId=73&isSample=false&level=C
+  return $get("/api/marktasks", datas);
+};
 // grade or mark history
 export const markHistoryList = (paperId, stage) => {
   return $get(`/api/papers/${paperId}/marktasks`, { stage });
 };
+// marker-status-info
+export const markerDetail = userId => {
+  return $get(`/api/markers/${userId}`);
+};
 
 // mark -------------------------->
 // mark-progress

+ 3 - 0
src/assets/styles/mark.less

@@ -169,6 +169,9 @@
     }
     &-list {
       padding: 0 0 15px 0;
+      .image-view-list {
+        min-height: 500px;
+      }
     }
 
     &-col-3 {

+ 10 - 4
src/components/common/ImportFile/ImportFile.vue

@@ -94,6 +94,15 @@ export default {
     addFilenameParam: {
       type: String,
       default: "fileName"
+    },
+    uploadSuccessHandle: {
+      type: Function,
+      default(response) {
+        return {
+          success: true,
+          msg: "导入成功!"
+        };
+      }
     }
   },
   data() {
@@ -137,10 +146,7 @@ export default {
     },
     handleSuccess(response) {
       if (response) {
-        this.res = {
-          success: true,
-          msg: "导入成功!"
-        };
+        this.res = this.uploadSuccessHandle(response);
         this.$emit("upload-success", response);
       } else {
         this.res = {

+ 1 - 1
src/modules/client-set/ClientParamSet.vue

@@ -237,7 +237,7 @@ export default {
       await updateCollectParams(this.modalForm).catch(() => {
         result = false;
       });
-      this.isSubmit = true;
+      this.isSubmit = false;
       if (!result) return;
       this.$Message.success("保存成功!");
     }

+ 50 - 10
src/modules/grading/GradingDetail.vue

@@ -28,7 +28,10 @@
       <!-- detail-papers -->
       <div :class="detailPapersClasses">
         <div class="detail-papers-carousel">
-          <grade-standard-paper ref="GradeStandardPaper"></grade-standard-paper>
+          <grade-standard-paper
+            :levels="levels"
+            ref="GradeStandardPaper"
+          ></grade-standard-paper>
           <paper-carousel
             :papers="papers"
             v-if="!IS_ADMIN"
@@ -52,7 +55,7 @@
               </div>
             </div>
           </div>
-          <div class="part-page">
+          <div class="part-page" v-if="total > size">
             <Page
               :current="current"
               :total="total"
@@ -112,6 +115,7 @@ import GradeAnalysis from "./components/GradeAnalysis";
 // 管理员(ADMIN),科组长(MARK_LEADER),评卷员(MARKER)
 // 管理员:标准卷,试卷列表,操作盘
 // 科组长:标准卷,操作记录,试卷列表,操作盘(定档,标准卷,打回)
+// TIP:不考虑评卷员的情况
 // 评卷员:标准卷,操作记录,试卷列表,操作盘(只分档)
 
 export default {
@@ -128,10 +132,20 @@ export default {
     return {
       filter: {
         questionId: "",
-        level: "",
         sort: "secretNumber",
         isSample: false
       },
+      typeFilter: {
+        level: {
+          level: ""
+        },
+        reject: {
+          reject: true
+        },
+        arbitrate: {
+          arbi: true
+        }
+      },
       workId: this.$route.params.workId,
       subjectId: this.$route.params.subjectId,
       subject: "",
@@ -140,7 +154,7 @@ export default {
       size: 6,
       total: 0,
       totalPage: 1,
-      curStep: {},
+      curStep: { type: "analysis", name: "analysis" },
       curStandardGradeId: "",
       steps: [],
       levels: [],
@@ -170,7 +184,7 @@ export default {
   mounted() {
     this.subject = this.subjectId.split("-")[1];
     this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
-    // this.initData();
+    this.initData();
   },
   methods: {
     async initData() {
@@ -182,10 +196,14 @@ export default {
     async getList() {
       const datas = {
         ...this.filter,
+        ...this.typeFilter[this.curStep.type],
         page: this.current - 1,
         size: this.size
       };
-      const data = await paperList(datas);
+      if (this.curStep.type === "level") datas.level = this.curStep.name;
+
+      let data = [];
+      data = await paperList(datas);
       this.papers = data.data.map(paper => {
         paper.title = paper.examNumber;
         return paper;
@@ -198,6 +216,26 @@ export default {
     },
     async getStepLevels() {
       const data = await levelStatData(this.subjectId, this.filter.questionId);
+      const undoIndex = data.findIndex(item => item.id === null);
+      let otherStep = [];
+      if (undoIndex !== -1) {
+        const undo = { ...data[undoIndex] };
+        data.splice(undoIndex, 1);
+
+        otherStep.push({
+          name: "仲裁",
+          count: undo.arbitrated,
+          type: "arbitrate"
+        });
+
+        if (this.IS_MARK_LEADER) {
+          otherStep.push({
+            name: "打回",
+            count: undo.rejected,
+            type: "reject"
+          });
+        }
+      }
       let levelMenu = data.map(item => {
         return {
           ...item,
@@ -205,9 +243,7 @@ export default {
           type: "level"
         };
       });
-      this.steps = levelMenu;
-      // TODO:根据角色构建不同的导航栏
-      // 切换默认导航
+      this.steps = [...levelMenu, ...otherStep];
     },
     async getWorkLevels() {
       const data = await workLevelList(this.workId);
@@ -221,7 +257,10 @@ export default {
       });
     },
     async getAreaList() {
-      const data = await areaList(this.workId, this.subject);
+      const data = await areaList({
+        workId: this.workId,
+        subject: this.subject
+      });
       this.areas = data.map(item => {
         return {
           id: item.id,
@@ -242,6 +281,7 @@ export default {
     },
     stepChange(step) {
       this.curStep = step;
+      this.toPage(1);
     },
     toReview(index) {
       this.curPaper = { ...this.papers[index] };

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

@@ -1,15 +1,326 @@
 <template>
   <div class="grading-operation">
-    grading-operation
+    <grade-step
+      :steps="steps"
+      @on-change="stepChange"
+      ref="GradeStep"
+    ></grade-step>
+    <div class="detail-body" v-if="curStep.name !== 'analysis'">
+      <div class="detail-filter">
+        <Form ref="FilterForm" label-position="left" inline>
+          <FormItem>
+            <Select v-model="filter.questionId" placeholder="请选择考区">
+              <Option
+                v-for="area in areas"
+                :key="area.id"
+                :value="area.id"
+                :label="area.areaName"
+              ></Option>
+            </Select>
+          </FormItem>
+          <FormItem>
+            <Button type="primary" icon="ios-search" @click="toPage(1)"
+              >查询</Button
+            >
+          </FormItem>
+        </Form>
+      </div>
+      <!-- detail-papers -->
+      <div :class="detailPapersClasses">
+        <div class="detail-papers-carousel">
+          <grade-standard-paper ref="GradeStandardPaper"></grade-standard-paper>
+          <paper-carousel
+            :papers="papers"
+            v-if="!IS_ADMIN"
+            ref="PaperCarousel"
+          ></paper-carousel>
+        </div>
+        <div class="detail-papers-list">
+          <div :class="imageViewClasses">
+            <div
+              class="image-view"
+              v-for="(image, index) in papers"
+              :key="index"
+            >
+              <h5 class="image-view-title">{{ image.title }}</h5>
+              <div class="image-view-contain">
+                <img
+                  :src="image.thumbSrc"
+                  :alt="image.title"
+                  @click="toReview(index)"
+                />
+              </div>
+            </div>
+          </div>
+          <div class="part-page" v-if="total > size">
+            <Page
+              :current="current"
+              :total="total"
+              :page-size="size"
+              show-total
+              show-elevator
+              :show-sizer="IS_MARKER"
+              :page-size-opts="[4, 6, 8]"
+              @on-page-size-change="pageSizeChange"
+              @on-change="toPage"
+            ></Page>
+          </div>
+        </div>
+      </div>
+      <!-- detail-aciton -->
+      <div class="detail-action">
+        <grade-action
+          :paper="curPaper"
+          :levels="levels"
+          :step="curStep"
+          :user-role="curUserRoleType"
+          @on-confirm="gradeCurPaper"
+          ref="GradeAction"
+          v-if="curPaper.id && curStep.name"
+        ></grade-action>
+      </div>
+    </div>
+    <div class="detail-body" v-else>
+      <grade-analysis ref="GradeAnalysis"></grade-analysis>
+    </div>
+
+    <!-- image-preview -->
+    <image-preview
+      class="grading-detail-image-preview"
+      :image-list="papers"
+      :init-index="curPaperIndex"
+      @on-prev="paperPrev"
+      @on-next="paperNext"
+      @on-page-prev="prevPage"
+      @on-page-next="nextPage"
+      header-hide
+      ref="ImagePreview"
+      v-if="papers.length"
+    ></image-preview>
   </div>
 </template>
 
 <script>
+import {
+  paperList,
+  markerPaperList,
+  levelStatData,
+  areaList,
+  workLevelList
+} from "@/api";
+import ImagePreview from "@/components/common/ImagePreview";
+import GradeStep from "./components/GradeStep";
+import GradeStandardPaper from "./components/GradeStandardPaper";
+import PaperCarousel from "./components/PaperCarousel";
+import GradeAction from "./components/GradeAction";
+import GradeAnalysis from "./components/GradeAnalysis";
+// 三种情况:
+// 管理员(ADMIN),科组长(MARK_LEADER),评卷员(MARKER)
+// 评卷员:标准卷,操作记录,试卷列表,操作盘(只分档)
+
+// TIP:不考虑管理员\科组长的情况
+// 管理员:标准卷,试卷列表,操作盘
+// 科组长:标准卷,操作记录,试卷列表,操作盘(定档,标准卷,打回)
+
 export default {
   name: "grading-operation",
+  components: {
+    ImagePreview,
+    PaperCarousel,
+    GradeStep,
+    GradeStandardPaper,
+    GradeAction,
+    GradeAnalysis
+  },
   data() {
-    return {};
+    return {
+      filter: {
+        questionId: "",
+        level: "",
+        sort: "secretNumber",
+        isSample: false
+      },
+      workId: this.$route.params.workId,
+      subjectId: this.$route.params.subjectId,
+      subject: "",
+      curUserRoleType: "MARKER",
+      current: 1,
+      size: 6,
+      total: 0,
+      totalPage: 1,
+      curStep: { type: "analysis", name: "analysis" },
+      curStandardGradeId: "",
+      steps: [],
+      levels: [],
+      areas: [],
+      papers: [],
+      curPaper: {},
+      curPaperIndex: 0
+    };
+  },
+  computed: {
+    detailPapersClasses() {
+      return ["detail-papers", `detail-papers-col-${1 + this.size / 2}`];
+    },
+    imageViewClasses() {
+      return ["image-view-list", `image-view-list-${this.size / 2}`];
+    },
+    IS_ADMIN() {
+      return this.curUserRoleType === "ADMIN";
+    },
+    IS_MARKER() {
+      return this.curUserRoleType === "MARKER";
+    },
+    IS_MARK_LEADER() {
+      return this.curUserRoleType === "MARK_LEADER";
+    }
   },
-  methods: {}
+  mounted() {
+    this.subject = this.subjectId.split("-")[1];
+    this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    this.initData();
+  },
+  methods: {
+    async initData() {
+      await this.getAreaList();
+      this.filter.questionId = this.areas[0].id;
+      this.getStepLevels();
+      this.getWorkLevels();
+    },
+    async getList() {
+      const datas = {
+        ...this.filter,
+        page: this.current - 1,
+        size: this.size
+      };
+      let data = [];
+      if (this.IS_MARKER) {
+        datas.sort = "updatedOn,desc";
+        datas.markerId = this.$ls.get("user").id;
+        data = await markerPaperList(datas);
+      } else {
+        data = await paperList(datas);
+      }
+      this.papers = data.data.map(paper => {
+        paper.title = paper.examNumber;
+        return paper;
+      });
+      this.total = data.totalCount;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    async getStepLevels() {
+      const data = await levelStatData(this.subjectId, this.filter.questionId);
+      const undoIndex = data.findIndex(item => item.id === null);
+      let otherStep = [];
+      if (undoIndex !== -1) {
+        const undo = { ...data[undoIndex] };
+        data.splice(undoIndex, 1);
+
+        otherStep.push({
+          name: "仲裁",
+          count: undo.arbitrated,
+          type: "arbitrate"
+        });
+
+        if (this.IS_MARK_LEADER) {
+          otherStep.push({
+            name: "打回",
+            count: undo.rejected,
+            type: "reject"
+          });
+        }
+      }
+      let levelMenu = data.map(item => {
+        return {
+          ...item,
+          name: item.id,
+          type: "level"
+        };
+      });
+      this.steps = [...levelMenu, ...otherStep];
+    },
+    async getWorkLevels() {
+      const data = await workLevelList(this.workId);
+      this.levels = data.map(item => {
+        return {
+          id: item.id,
+          name: item.code,
+          minScore: item.minScore,
+          maxScore: item.maxScore
+        };
+      });
+    },
+    async getAreaList() {
+      const data = await areaList({
+        workId: this.workId,
+        subject: this.subject
+      });
+      this.areas = data.map(item => {
+        return {
+          id: item.id,
+          areaName: item.areaName,
+          areaCode: item.areaCode
+        };
+      });
+    },
+    pageSizeChange(size) {
+      this.size = size;
+      this.toPage(1);
+      this.initData();
+      this.$nextTick(() => {
+        this.$refs.GradeStandardPaper.$refs.Carousel.handleResize();
+        this.$refs.PaperCarousel &&
+          this.$refs.PaperCarousel.$refs.Carousel.handleResize();
+      });
+    },
+    stepChange(step) {
+      this.curStep = step;
+      if (step.type === "level") this.filter.level = step.name;
+      this.initData();
+    },
+    toReview(index) {
+      this.curPaper = { ...this.papers[index] };
+      this.curPaperIndex = index;
+      this.$refs.ImagePreview.open();
+    },
+    paperPrev(index) {
+      this.curPaper = { ...this.papers[index] };
+      this.curPaperIndex = index;
+    },
+    paperNext(index) {
+      this.curPaper = { ...this.papers[index] };
+      this.curPaperIndex = index;
+    },
+    prevPage() {
+      if (this.current === 1) {
+        this.$Message.warning("当前已经是第一条数据了");
+        return;
+      }
+      this.current--;
+      this.getList();
+    },
+    nextPage() {
+      if (this.current === this.totalPage) {
+        this.$Message.warning("当前已经是最后一条数据了");
+        return;
+      }
+      this.current++;
+      this.getList();
+    },
+    gradeCurPaper(grade) {
+      // TODO:to grade
+
+      this.$refs.ImagePreview.showNext();
+      // if (this.curPaperIndex === this.size - 1) {
+      //   this.nextPage();
+      //   return;
+      // } else {
+      //   this.paperNext(this.curPaperIndex + 1);
+      // }
+    }
+  }
 };
 </script>

+ 106 - 76
src/modules/grading/GradingProgress.vue

@@ -6,11 +6,17 @@
     </div>
     <div class="part-box-head">
       <div class="part-box-head-left">
-        <Button type="primary" @click="toGrading">正评任务创建</Button>
-        <Button type="primary" @click="toTryGrading">试评任务创建</Button>
-        <Button type="primary" @click="toMark">进入打分阶段</Button>
+        <Button type="primary" @click="toGrading" v-if="showGradingBtn"
+          >正评任务创建</Button
+        >
+        <Button type="primary" @click="toTryGrading" v-if="showTryGradingBtn"
+          >试评任务创建</Button
+        >
+        <Button type="primary" @click="toMark" v-if="showMarkBtn"
+          >进入打分阶段</Button
+        >
       </div>
-      <div class="part-box-head-right">
+      <div class="part-box-head-right" v-if="curSubject.stage !== 'INIT'">
         <Button type="primary" icon="md-download" @click="toExportStandard"
           >导出标准卷信息</Button
         >
@@ -22,31 +28,31 @@
     <div class="part-box">
       <div class="progress-table">
         <table class="table table-noborder">
-          <tr v-for="(area, aindex) in areaInfos" :key="aindex">
-            <td style="width: 12%">{{ area.name }}</td>
+          <tr v-for="(item, aindex) in areaProgress" :key="aindex">
+            <td style="width: 12%">{{ item.areaName }}</td>
             <td style="width: 60%;">
               <progress-line
-                :sum="area.sum"
-                :current="area.current"
+                :sum="item.totalCount"
+                :current="item.successCount"
               ></progress-line>
             </td>
-            <td style="width: 14%;">进度:{{ area.progress }}%</td>
+            <td style="width: 14%;">进度:{{ item.progress }}%</td>
             <td style="width: 14%;"></td>
           </tr>
         </table>
       </div>
       <div class="progress-table">
         <table class="table table-noborder">
-          <tr v-for="(area, aindex) in userInfos" :key="aindex">
-            <td style="width: 12%">{{ area.name }}</td>
+          <tr v-for="(item, aindex) in markerProgress" :key="aindex">
+            <td style="width: 12%">{{ item.markerName }}</td>
             <td style="width: 60%;">
               <progress-line
-                :sum="area.sum"
-                :current="area.current"
+                :sum="item.totalCount"
+                :current="item.successCount"
               ></progress-line>
             </td>
-            <td style="width: 14%;">进度:{{ area.progress }}%</td>
-            <td style="width: 14%;">打回:{{ area.arbitration }}</td>
+            <td style="width: 14%;">进度:{{ item.progress }}%</td>
+            <td style="width: 14%;">打回:{{ item.rejectedCount }}</td>
           </tr>
         </table>
       </div>
@@ -58,6 +64,8 @@
     ></modify-unformal-grading-task>
     <!-- modify-formal-grading-task -->
     <modify-formal-grading-task
+      :subject-id="subjectId"
+      @confirm="getData"
       ref="ModifyFormalGradingTask"
     ></modify-formal-grading-task>
   </div>
@@ -67,7 +75,8 @@
 import ProgressLine from "./components/ProgressLine";
 import ModifyUnformalGradingTask from "./components/ModifyUnformalGradingTask";
 import ModifyFormalGradingTask from "./components/ModifyFormalGradingTask";
-import { gradingProgressDetail } from "@/api";
+import { gradingProgressDetail, subjectDetail } from "@/api";
+import { SUBJECT_STAGE } from "@/constants/enumerate";
 
 export default {
   name: "grading-progress",
@@ -79,70 +88,91 @@ export default {
   data() {
     return {
       subjectId: this.$route.params.subjectId,
-      stepName: "采集阶段",
-      stepProgress: "95.56%",
-      areaInfos: [
-        {
-          name: "总体进度",
-          sum: 5500,
-          current: 0,
-          progress: 0
-        },
-        {
-          name: "考区1进度",
-          sum: 1000,
-          current: 990,
-          progress: 100
-        },
-        {
-          name: "考区2进度",
-          sum: 5500,
-          current: 2000,
-          progress: 45.45
-        },
-        {
-          name: "考区3进度",
-          sum: 5500,
-          current: 2000,
-          progress: 45.45
-        }
-      ],
-      userInfos: [
-        {
-          name: "科组长",
-          sum: 5500,
-          current: 2000,
-          arbitration: 10,
-          progress: 45.45
-        },
-        {
-          name: "评卷员1",
-          sum: 5500,
-          current: 2000,
-          arbitration: 10,
-          progress: 45.45
-        },
-        {
-          name: "评卷员2",
-          sum: 5500,
-          current: 2000,
-          arbitration: 10,
-          progress: 45.45
-        },
-        {
-          name: "评卷员3",
-          sum: 5500,
-          current: 2000,
-          arbitration: 10,
-          progress: 45.45
-        }
-      ]
+      workId: "",
+      subject: "",
+      stepName: "",
+      stepProgress: "",
+      curSubject: {},
+      SUBJECT_STAGE,
+      totalProgress: {},
+      areaProgress: [],
+      markerProgress: []
     };
   },
+  computed: {
+    showGradingBtn() {
+      return (
+        (this.curSubject.stage == "INIT" &&
+          this.curSubject.test !== 2 &&
+          !this.curSubject.formal) ||
+        (this.curSubject.stage == "LEVEL" &&
+          this.stepProgress !== 100 &&
+          this.curSubject.test === 0 &&
+          this.curSubject.formal)
+      );
+    },
+    showTryGradingBtn() {
+      return (
+        (this.curSubject.stage == "LEVEL" && this.stepProgress === 100) ||
+        (this.curSubject.stage == "SCORE" && !this.curSubject.allLevel)
+      );
+    },
+    showMarkBtn() {
+      return (
+        (this.curSubject.stage == "INIT" &&
+          this.curSubject.test !== 2 &&
+          !this.curSubject.formal) ||
+        (this.curSubject.stage == "LEVEL" && this.curSubject.test === 2)
+      );
+    }
+  },
+  mounted() {
+    const ids = this.subjectId.split("-");
+    this.workId = ids[0];
+    this.subject = ids[1];
+    this.getData();
+  },
   methods: {
     async getData() {
-      const data = await gradingProgressDetail(this.subjectId);
-      console.log(data);
+      await this.getSubjectDetail();
+      this.getProgressDetail();
+    },
+    async getProgressDetail() {
+      const data = await gradingProgressDetail({
+        workId: this.workId,
+        subject: this.subject
+      });
+      this.totalProgress = data.totalProgress;
+      this.stepProgress = data.totalProgress.progress.toFixed(2) + "%";
+      const totalInfo = {
+        successCount: data.totalProgress.successCount,
+        totalCount: data.totalProgress.totalCount,
+        progress: data.totalProgress.progress.toFixed(2),
+        areaName: "总体进度"
+      };
+      if (this.curSubject.stage === "INIT") {
+        this.areaProgress = [totalInfo];
+        this.markerProgress = [];
+      } else {
+        this.areaProgress = [totalInfo, ...this.addProgress(data.areaProgress)];
+        this.markerProgress = this.addProgress(data.markerProgress);
+      }
+    },
+    addProgress(data) {
+      return data.map(item => {
+        item.successCount = item.totalCount - item.leftCount;
+        item.progress = item.totalCount
+          ? ((100 * item.successCount) / item.totalCount).toFixed(2)
+          : "0.00";
+        return item;
+      });
+    },
+    async getSubjectDetail() {
+      this.curSubject = await subjectDetail(this.subjectId);
+      this.stepName =
+        this.curSubject.test === 2
+          ? "试评"
+          : this.SUBJECT_STAGE[this.curSubject.stage];
     },
     toGrading() {
       this.$refs.ModifyFormalGradingTask.open();

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

@@ -177,7 +177,7 @@ export default {
         MARKER: {
           done: ["gradeList", "paperState", "paperInfo", "gradeInfo"],
           undo: ["gradeList", "paperState", "paperInfo"],
-          refuse: ["gradeList", "paperState", "paperInfo", "gradeInfo"]
+          reject: ["gradeList", "paperState", "paperInfo", "gradeInfo"]
         }
       },
       filter: {

+ 25 - 21
src/modules/grading/components/GradeStandardPaper.vue

@@ -2,20 +2,22 @@
   <div class="grade-standard-paper paper-carousel">
     <div class="carousel-title">
       <h3>标准卷</h3>
-      <Select v-model="curStandardGradeId">
+      <Select v-model="curLevel" @on-change="getPapers">
         <Option
           v-for="(level, gindex) in levels"
           :key="gindex"
           :value="level.id"
-          :label="level.name"
+          :label="level.code"
         ></Option>
       </Select>
     </div>
     <div class="carousel-body">
+      <!-- 换一个轮播组件 -->
       <Carousel
         v-model="curPaperIndex"
         arrow="always"
         dots="none"
+        :loop="false"
         ref="Carousel"
       >
         <CarouselItem v-for="(paper, pindex) in papers" :key="pindex">
@@ -29,14 +31,21 @@
 </template>
 
 <script>
-import { papers } from "@/constants/apiTempData";
+import { paperList } from "@/api";
 
 export default {
   name: "grade-standard-paper",
+  props: {
+    levels: {
+      type: Array,
+      default() {
+        return [];
+      }
+    }
+  },
   data() {
     return {
-      curStandardGradeId: "",
-      levels: [],
+      curLevel: "",
       papers: [],
       curPaperIndex: 0
     };
@@ -45,22 +54,17 @@ export default {
     this.initData();
   },
   methods: {
-    initData() {
-      this.papers = papers.slice(4, 8).map((item, index) => {
-        return {
-          ...item,
-          title: item.examNumber,
-          score: "95",
-          grade: "A"
-        };
-      });
-
-      this.levels = "ABCDEFGHIJK".split("").map((item, index) => {
-        return {
-          id: index,
-          name: item
-        };
-      });
+    async getPapers() {
+      const datas = {
+        level: this.curLevel,
+        sort: "secretNumber",
+        isSample: true,
+        page: 0,
+        size: 100
+      };
+      const data = await paperList(datas);
+      this.papers = data.data;
+      this.curPaperIndex = 0;
     }
   }
 };

+ 18 - 11
src/modules/grading/components/GradeStep.vue

@@ -18,15 +18,22 @@
           :class="['step-item', { 'step-act': curStep.name === step.name }]"
           @click="selectStep(step)"
         >
-          <p>
-            <span>{{ step.gcount }}/</span><span>{{ step.gpercent }}%</span
-            ><span>({{ step.pt }}%)</span>
-          </p>
-          <p class="step-name">{{ step.name }}</p>
-          <p>
-            <span>{{ step.count }}/</span><span>{{ step.percent }}%</span
-            ><span>({{ step.kdpt }}%)</span>
-          </p>
+          <div v-if="step.type === 'level'">
+            <p>
+              <span>{{ step.gcount }}/</span><span>{{ step.gpercent }}%</span
+              ><span>({{ step.pt }}%)</span>
+            </p>
+            <p class="step-name">{{ step.name }}</p>
+            <p>
+              <span>{{ step.count }}/</span><span>{{ step.percent }}%</span
+              ><span>({{ step.kdpt }}%)</span>
+            </p>
+          </div>
+          <div v-else>
+            <p>{{ step.count }}</p>
+            <p class="step-name">{{ step.name }}</p>
+            <p>{{ step.count }}</p>
+          </div>
         </td>
       </tr>
     </table>
@@ -50,7 +57,7 @@ export default {
   },
   data() {
     return {
-      curStep: { name: "" }
+      curStep: { type: "analysis", name: "analysis" }
     };
   },
   methods: {
@@ -59,7 +66,7 @@ export default {
       this.$emit("on-change", this.curStep);
     },
     selectAnalysis() {
-      this.selectStep({ name: "analysis" });
+      this.selectStep({ type: "analysis", name: "analysis" });
     }
   }
 };

+ 55 - 20
src/modules/grading/components/ModifyFormalGradingTask.vue

@@ -13,19 +13,28 @@
       :key="modalForm.id"
       :label-width="120"
     >
-      <FormItem prop="areaCode" label="考区">
-        <Select v-model="modalForm.areaCode" placeholder="请选择考区">
-          <Option value=""></Option>
+      <FormItem prop="questionId" label="考区">
+        <Select
+          v-model="modalForm.questionId"
+          @on-change="areaChange"
+          placeholder="请选择考区"
+        >
+          <Option
+            v-for="(item, index) in areas"
+            :key="index"
+            :value="item.questionId"
+            :label="item.areaName"
+          ></Option>
         </Select>
       </FormItem>
       <FormItem label="已评数量">
-        <Input v-model.trim="modalForm.gradedCount" readonly></Input>
+        <Input v-model.trim="modalForm.successCount" readonly></Input>
       </FormItem>
       <FormItem label="待评数量">
         <Input v-model.trim="modalForm.waitCount" readonly></Input>
       </FormItem>
       <FormItem label="整体进度">
-        <Input v-model.trim="modalForm.gradedProgress" readonly></Input>
+        <Input v-model.trim="modalForm.progress" readonly></Input>
       </FormItem>
       <FormItem prop="taskCount" label="分配任务数量">
         <InputNumber
@@ -48,29 +57,33 @@
 </template>
 
 <script>
-import { createTryGradingTask } from "@/api";
+import { checkMissionStatus, createGradingTask, areaStatProgress } from "@/api";
 import { numberValidator } from "@/plugins/formRules";
 
 const initModalForm = {
-  areaCode: "",
-  taskCount: null
+  questionId: null,
+  totalCount: 0,
+  successCount: 0,
+  waitCount: 0,
+  progress: 0,
+  taskCount: 1
 };
 
 export default {
   name: "modify-formal-grading-task",
+  props: {
+    subjectId: {
+      type: String,
+      required: true
+    }
+  },
   data() {
     return {
       modalIsShow: false,
       isSubmit: false,
       modalForm: { ...initModalForm },
+      areas: [],
       rules: {
-        areaCode: [
-          {
-            required: true,
-            message: "请选择考区",
-            trigger: "change"
-          }
-        ],
         taskCount: numberValidator("请输入分配任务数量")
       }
     };
@@ -78,9 +91,22 @@ export default {
   methods: {
     visibleChange(visible) {
       if (visible) {
-        this.modalForm = { ...initModalForm };
+        this.getArea();
       }
     },
+    async getArea() {
+      const data = await areaStatProgress(this.subjectId);
+      this.areas = data;
+      this.modalForm.questionId = data[data.length - 1].questionId;
+      this.areaChange();
+    },
+    areaChange() {
+      const curArea = this.areas.find(
+        item => item.questionId === this.modalForm.questionId
+      );
+      this.modalForm = Object.assign({}, initModalForm, curArea);
+      this.modalForm.progress += "%";
+    },
     cancel() {
       this.modalIsShow = false;
     },
@@ -92,14 +118,23 @@ export default {
       if (!valid) return;
 
       if (this.isSubmit) return;
+
+      const ids = this.subjectId.split("-");
+      await checkMissionStatus({ workId: ids[0], subject: ids[1] });
+
       this.isSubmit = true;
-      const data = await createTryGradingTask(this.modalForm).catch(() => {
-        this.isSubmit = false;
+      let result = true;
+      await createGradingTask({
+        subjectId: this.subjectId,
+        taskCount: this.modalForm.taskCount,
+        questionId: this.modalForm.questionId
+      }).catch(() => {
+        result = false;
       });
 
-      if (!data) return;
-
       this.isSubmit = false;
+      if (!result) return;
+
       this.$Message.success("发布任务成功!");
       this.$emit("modified");
       this.cancel();

+ 5 - 15
src/modules/main/ClientMonitor.vue

@@ -46,21 +46,11 @@ export default {
         page: this.current - 1,
         size: this.size
       });
-      console.log(data);
-
-      this.papers = "#"
-        .repeat(10)
-        .split("")
-        .map((item, index) => {
-          return {
-            id: index,
-            title: `Scan ${index}`,
-            url:
-              "http://127.0.0.1:9000/api/file/image/download/33/1/833/1?random=fa8244bb-8ec4-46c1-a16e-1bd6f3b8848e",
-            thumbSrc:
-              "http://127.0.0.1:9000/api/file/image/download/33/1/833/2?random=497cc903-c01a-458a-9b4e-82b391cef176"
-          };
-        });
+      this.papers = data.data.map(item => {
+        item.title = item.createUserName;
+        return item;
+      });
+      this.total = data.totalCount;
     },
     toPage(page) {
       this.current = page;

+ 0 - 1
src/modules/main/PaperManage.vue

@@ -98,7 +98,6 @@ export default {
       filter: {
         workId: this.$route.params.workId,
         name: "",
-        schoolId: "",
         areaCode: "",
         startNumber: null,
         endNumber: null,

+ 35 - 14
src/modules/main/StudentManage.vue

@@ -118,7 +118,7 @@
       :download-filename="downloadStudentTemplateFilename"
       :headers="headers"
       :format="['xls', 'xlsx']"
-      @upload-success="fileUploaded"
+      :upload-success-handle="uploadStudentSuccess"
       ref="ExportStudent"
     >
     </import-file>
@@ -131,7 +131,7 @@
       :download-filename="downloadRelateTemplateFilename"
       :headers="headers"
       :format="['xls', 'xlsx']"
-      @upload-success="fileUploaded"
+      :upload-success-handle="uploadStudentSuccess"
       ref="ExportRelate"
     >
     </import-file>
@@ -247,12 +247,12 @@ export default {
       uploadData: {
         workId: this.$route.params.workId
       },
-      uploadStudentUrl: this.GLOBAL.domain + "/import/students",
-      downloadStudentTemplateUrl: "/templates/考生导入模板.xlsx",
-      downloadStudentTemplateFilename: "考生导入模板.xls",
-      uploadRelateUrl: "",
-      downloadRelateTemplateUrl: "/templates/考生导入模板.xlsx",
-      downloadRelateTemplateFilename: "要下载的文件.xls"
+      uploadStudentUrl: this.GLOBAL.domain + "/api/import/students",
+      downloadStudentTemplateUrl: "/templates/考生信息表-模板.xlsx",
+      downloadStudentTemplateFilename: "考生信息表-模板.xlsx",
+      uploadRelateUrl: "/api/import/students/relateStudent",
+      downloadRelateTemplateUrl: "/templates/关联考生信息表-模板.xlsx",
+      downloadRelateTemplateFilename: "关联考生信息表-模板.xlsx"
     };
   },
   mounted() {
@@ -266,7 +266,7 @@ export default {
     async getList() {
       const datas = {
         // ...this.filter,
-        workId: this.workId,
+        workId: this.filter.workId,
         page: this.current - 1,
         size: this.size
       };
@@ -302,15 +302,36 @@ export default {
         this.columns.splice(this.columns.length - 1, 0, column);
       });
     },
-    toUploadStudentPaper(row) {
-      console.log(row);
-    },
     toEdit(row) {
       this.curStudent = row;
       this.$refs.ModifyStudent.open();
     },
-    fileUploaded(response) {
-      console.log(response);
+    uploadStudentSuccess(response) {
+      if (response && !response.length) {
+        return {
+          success: true,
+          msg: "导入成功!"
+        };
+      }
+      var errorInfos = response
+        .filter(function(item) {
+          return !!item.excelErrorType;
+        })
+        .map(function(item) {
+          return "第" + item.row + "行," + item.excelErrorType;
+        })
+        .join(";");
+      if (errorInfos) {
+        return {
+          success: false,
+          msg: errorInfos
+        };
+      } else {
+        return {
+          success: true,
+          msg: "导入成功!"
+        };
+      }
     },
     toDelete(row) {
       this.$Modal.confirm({

+ 1 - 1
src/modules/main/WorkOverview.vue

@@ -125,7 +125,7 @@ export default {
       window.open(url);
     },
     toCommit(subject) {
-      const routerName = subject.markStage === "LEVEL" ? "Grading" : "Mark";
+      const routerName = subject.markStage === "SCORE" ? "Mark" : "Grading";
       this.$router.push({
         name: routerName,
         params: { workId: this.workId, subjectId: subject.subjectId }