|
@@ -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>
|