|
@@ -1,493 +1,493 @@
|
|
|
-<template>
|
|
|
- <div class="mark-operation grading-operation home">
|
|
|
- <view-header> </view-header>
|
|
|
- <div class="home-body">
|
|
|
- <div class="home-main grading-detail">
|
|
|
- <div class="grading-detail page-container-flex">
|
|
|
- <grade-filter
|
|
|
- ref="GradeFilter"
|
|
|
- :data="workSubject"
|
|
|
- @change="areaChange"
|
|
|
- ></grade-filter>
|
|
|
- <mark-step
|
|
|
- :steps="steps"
|
|
|
- :init-step="curStep"
|
|
|
- :show-top-number="false"
|
|
|
- @on-change="stepChange"
|
|
|
- ref="MarkStep"
|
|
|
- v-if="steps.levelStep"
|
|
|
- ></mark-step>
|
|
|
- <div class="detail-body clear-float">
|
|
|
- <!-- detail-papers -->
|
|
|
- <div :class="detailPapersClasses">
|
|
|
- <div class="detail-papers-carousel">
|
|
|
- <grade-history-paper
|
|
|
- :question-id="filter.questionId"
|
|
|
- stage="SCORE"
|
|
|
- @on-paper-click="toViewCarouselPaper"
|
|
|
- v-if="filter.questionId"
|
|
|
- ref="GradeHistoryPaper"
|
|
|
- ></grade-history-paper>
|
|
|
- </div>
|
|
|
- <div class="detail-papers-list" v-if="papers.length">
|
|
|
- <div :class="imageViewClasses">
|
|
|
- <div
|
|
|
- :class="[
|
|
|
- 'image-view',
|
|
|
- { 'image-view-act': curPaperIndex === index }
|
|
|
- ]"
|
|
|
- v-for="(image, index) in papers"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <div class="image-view-container">
|
|
|
- <h5 class="image-view-title">{{ image.title }}</h5>
|
|
|
- <div class="image-view-contain">
|
|
|
- <img
|
|
|
- :src="image.thumbSrc"
|
|
|
- :alt="image.title"
|
|
|
- @click="toReview(index)"
|
|
|
- />
|
|
|
- <span
|
|
|
- class="image-info"
|
|
|
- v-if="image.score || image.score === 0"
|
|
|
- >{{ image.score }}分</span
|
|
|
- >
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="part-page" v-if="total > size">
|
|
|
- <Page
|
|
|
- :current="current"
|
|
|
- :total="total"
|
|
|
- :page-size="size"
|
|
|
- show-total
|
|
|
- show-elevator
|
|
|
- :page-size-opts="[4, 6, 8]"
|
|
|
- @on-page-size-change="pageSizeChange"
|
|
|
- @on-change="toPage"
|
|
|
- ></Page>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="detail-papers-list" v-else>
|
|
|
- <p class="detail-papers-none">暂无数据</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- detail-aciton -->
|
|
|
- <div
|
|
|
- :class="[
|
|
|
- 'detail-action',
|
|
|
- { 'detail-action-fullscreen': isFullscreenMarking }
|
|
|
- ]"
|
|
|
- >
|
|
|
- <mark-action
|
|
|
- :cur-paper-or-task="curPaper"
|
|
|
- :levels="levels"
|
|
|
- @on-leader-level="gradingCurPaper"
|
|
|
- @on-select-score="scoreCurPaper"
|
|
|
- @on-pass="passCurPaper"
|
|
|
- ref="GradeAction"
|
|
|
- v-if="curPaper.id"
|
|
|
- ></mark-action>
|
|
|
- </div>
|
|
|
- <!-- 占位 -->
|
|
|
- <div class="detail-action" v-if="isFullscreenMarking"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 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 {
|
|
|
- getParamsSet,
|
|
|
- markerTaskList,
|
|
|
- markerChangeLevelPaperList,
|
|
|
- markerScoreTotalStatData,
|
|
|
- workLevelList,
|
|
|
- paperSelectLevelOrScore,
|
|
|
- paperTaskPass
|
|
|
-} from "@/api";
|
|
|
-import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
|
-import MarkStep from "./components/MarkStep";
|
|
|
-import GradeFilter from "../grading/components/GradeFilter";
|
|
|
-import GradeHistoryPaper from "../grading/components/GradeHistoryPaper";
|
|
|
-import MarkAction from "./components/MarkAction";
|
|
|
-// 三种情况:
|
|
|
-// 管理员(ADMIN),科组长(MARK_LEADER),评卷员(MARKER)
|
|
|
-// 评卷员:操作记录,试卷列表,操作盘(打分)
|
|
|
-
|
|
|
-// TIP:不考虑管理员、科组长的情况
|
|
|
-// 管理员:试卷列表,操作盘
|
|
|
-// 科组长:操作记录,试卷列表,操作盘(改档)
|
|
|
-
|
|
|
-export default {
|
|
|
- name: "mark-operation",
|
|
|
- components: {
|
|
|
- SimpleImagePreview,
|
|
|
- MarkStep,
|
|
|
- GradeFilter,
|
|
|
- GradeHistoryPaper,
|
|
|
- MarkAction
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- filter: {
|
|
|
- markerId: this.$ls.get("user").id,
|
|
|
- questionId: ""
|
|
|
- },
|
|
|
- typeFilter: {
|
|
|
- undo: {
|
|
|
- sort: "paper.level",
|
|
|
- stage: "SCORE"
|
|
|
- },
|
|
|
- done: {
|
|
|
- level: "",
|
|
|
- sort: "updatedOn,desc",
|
|
|
- stage: "SCORE"
|
|
|
- },
|
|
|
- shift: {
|
|
|
- isShift: true,
|
|
|
- isShiftScore: false
|
|
|
- },
|
|
|
- shiftScore: {
|
|
|
- isShift: false,
|
|
|
- isShiftScore: true
|
|
|
- }
|
|
|
- },
|
|
|
- workId: this.$route.params.workId,
|
|
|
- subjectId: this.$route.params.subjectId,
|
|
|
- subject: "",
|
|
|
- workSubject: {},
|
|
|
- curSubject: {},
|
|
|
- curUserRoleType: "MARKER",
|
|
|
- changeStage: 0, // 是否显示改档及改档打分
|
|
|
- current: 1,
|
|
|
- size: 6,
|
|
|
- total: 0,
|
|
|
- totalPage: 1,
|
|
|
- curStep: null,
|
|
|
- curStandardGradeId: "",
|
|
|
- steps: [],
|
|
|
- levels: [],
|
|
|
- curArea: {},
|
|
|
- papers: [],
|
|
|
- curPaper: {},
|
|
|
- curPaperIndex: 0,
|
|
|
- // carousel paper review,
|
|
|
- carouselPapers: [],
|
|
|
- curCarouselPaperIndex: 0,
|
|
|
- isFullscreenMarking: false
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- detailPapersClasses() {
|
|
|
- return ["detail-papers", `detail-papers-col-${1 + this.size / 2}`];
|
|
|
- },
|
|
|
- imageViewClasses() {
|
|
|
- return ["image-view-list", `image-view-list-${this.size / 2}`];
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.subject = this.subjectId.split("-")[1];
|
|
|
- this.workSubject = {
|
|
|
- workId: this.workId,
|
|
|
- subject: this.subject
|
|
|
- };
|
|
|
- this.initData();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- initData() {
|
|
|
- this.getWorkLevels();
|
|
|
- this.getParamsSetInfo();
|
|
|
- },
|
|
|
- async getParamsSetInfo() {
|
|
|
- const data = await getParamsSet(this.workId);
|
|
|
- this.changeStage = data.changeStage;
|
|
|
- },
|
|
|
- async getList() {
|
|
|
- const datas = {
|
|
|
- ...this.filter,
|
|
|
- ...this.typeFilter[this.curStep.type],
|
|
|
- workId: this.workId,
|
|
|
- page: this.current - 1,
|
|
|
- size: this.size
|
|
|
- };
|
|
|
- if (this.curStep.type === "done") {
|
|
|
- datas.level = this.curStep.name;
|
|
|
- }
|
|
|
- const requestAction = this.curStep.type.includes("shift")
|
|
|
- ? markerChangeLevelPaperList
|
|
|
- : markerTaskList;
|
|
|
-
|
|
|
- const data = await requestAction(datas);
|
|
|
- this.papers = data.data.map(paper => {
|
|
|
- paper.title = `NO.${paper.sn}`;
|
|
|
- return paper;
|
|
|
- });
|
|
|
- this.total = data.totalCount;
|
|
|
- this.totalPage = data.pageCount;
|
|
|
- },
|
|
|
- async toPage(page) {
|
|
|
- this.current = page;
|
|
|
- await this.getList();
|
|
|
- this.selectPaper(this.curPaperIndex);
|
|
|
- },
|
|
|
- async getStepLevels() {
|
|
|
- const data = await markerScoreTotalStatData(
|
|
|
- this.filter.markerId,
|
|
|
- this.filter.questionId
|
|
|
- );
|
|
|
- const undoIndex = data.findIndex(item => item.id === null);
|
|
|
- let otherStep = [];
|
|
|
- let undo = {
|
|
|
- count: 0,
|
|
|
- shift: 0,
|
|
|
- shiftScore: 0
|
|
|
- };
|
|
|
- if (undoIndex !== -1) {
|
|
|
- undo = { ...data[undoIndex] };
|
|
|
- data.splice(undoIndex, 1);
|
|
|
- }
|
|
|
- otherStep.push({
|
|
|
- name: "待评",
|
|
|
- count: undo.count,
|
|
|
- type: "undo"
|
|
|
- });
|
|
|
-
|
|
|
- if (this.changeStage) {
|
|
|
- otherStep.push({
|
|
|
- name: "改档",
|
|
|
- count: undo.shift,
|
|
|
- type: "shift"
|
|
|
- });
|
|
|
- otherStep.push({
|
|
|
- name: "改档打分",
|
|
|
- count: undo.shiftScore,
|
|
|
- type: "shiftScore"
|
|
|
- });
|
|
|
- }
|
|
|
- let levelStep = data.map(item => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- name: item.id,
|
|
|
- type: "done"
|
|
|
- };
|
|
|
- });
|
|
|
- this.steps = { levelStep, otherStep };
|
|
|
-
|
|
|
- if (!this.curStep) {
|
|
|
- let curStep = {};
|
|
|
- if (undoIndex === -1) {
|
|
|
- curStep = levelStep[0];
|
|
|
- } else {
|
|
|
- curStep = otherStep[0];
|
|
|
- }
|
|
|
- this.curStep = curStep;
|
|
|
- }
|
|
|
- },
|
|
|
- updateStepLevel(curStep, curLevel, count = 1) {
|
|
|
- if (curStep.type === "done") return;
|
|
|
-
|
|
|
- const opos = this.steps.otherStep.findIndex(
|
|
|
- item => item.type === curStep.type
|
|
|
- );
|
|
|
- this.steps.otherStep[opos].count -= count;
|
|
|
-
|
|
|
- if (curStep.type === "shift") {
|
|
|
- const spos = this.steps.otherStep.findIndex(
|
|
|
- item => item.type === "shiftScore"
|
|
|
- );
|
|
|
- this.steps.otherStep[spos].count += count;
|
|
|
- } else {
|
|
|
- const pos = this.steps.levelStep.findIndex(
|
|
|
- item => item.name === curLevel
|
|
|
- );
|
|
|
- this.steps.levelStep[pos].count += count;
|
|
|
- }
|
|
|
- },
|
|
|
- async getWorkLevels() {
|
|
|
- const data = await workLevelList(this.workId);
|
|
|
- this.levels = data.map(item => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- name: item.code
|
|
|
- };
|
|
|
- });
|
|
|
- },
|
|
|
- pageSizeChange(size) {
|
|
|
- this.size = size;
|
|
|
- this.toPage(1);
|
|
|
- this.getStepLevels();
|
|
|
- },
|
|
|
- async stepChange(step) {
|
|
|
- this.curStep = step;
|
|
|
- this.current = 1;
|
|
|
- await this.getList();
|
|
|
- this.getStepLevels();
|
|
|
- if (this.papers.length) {
|
|
|
- this.selectPaper(0);
|
|
|
- } else {
|
|
|
- this.curPaper = {};
|
|
|
- }
|
|
|
- },
|
|
|
- async areaChange(curArea) {
|
|
|
- this.curArea = curArea;
|
|
|
- this.filter.questionId = curArea.id;
|
|
|
- await this.getStepLevels();
|
|
|
- this.toPage(1);
|
|
|
- this.updateHistory();
|
|
|
- },
|
|
|
- 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;
|
|
|
- }
|
|
|
- const lastPaper = { ...this.curPaper };
|
|
|
- this.curPaperIndex = nindex;
|
|
|
- this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
|
|
|
-
|
|
|
- // 待评时,检查当前试卷是否已经切换档位
|
|
|
- if (
|
|
|
- this.curStep.type === "undo" &&
|
|
|
- this.curPaper["level"] &&
|
|
|
- this.curPaper["level"] !== lastPaper["level"]
|
|
|
- ) {
|
|
|
- this.$Modal.info({
|
|
|
- content: `即将打分档位:${this.curPaper.level}`
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- async toPrevPaper() {
|
|
|
- if (this.curPaperIndex === 0) {
|
|
|
- if (this.current > 1) {
|
|
|
- this.current--;
|
|
|
- this.curPaperIndex = this.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.current === this.totalPage) {
|
|
|
- this.$Message.warning("当前已经是最后一条数据了");
|
|
|
- return;
|
|
|
- } else {
|
|
|
- this.current++;
|
|
|
- this.curPaperIndex = 0;
|
|
|
- await this.getList();
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.curPaperIndex++;
|
|
|
- }
|
|
|
-
|
|
|
- this.selectPaper(this.curPaperIndex);
|
|
|
- },
|
|
|
- async toActionNextPaper() {
|
|
|
- if (this.current > 1 && this.papers.length === 1) {
|
|
|
- this.current--;
|
|
|
- this.curPaperIndex = this.size;
|
|
|
- }
|
|
|
-
|
|
|
- await this.getList();
|
|
|
- if (!this.papers.length) this.$refs.SimpleImagePreview.cancel();
|
|
|
- this.selectPaper(this.curPaperIndex);
|
|
|
- },
|
|
|
- async gradingCurPaper({ selectedLevel }) {
|
|
|
- // 确认改档
|
|
|
- await paperSelectLevelOrScore(
|
|
|
- this.curPaper.id, // is taskId
|
|
|
- selectedLevel,
|
|
|
- "LEVEL"
|
|
|
- );
|
|
|
- this.updateStepLevel(this.curStep, "shiftScore");
|
|
|
- this.toActionNextPaper();
|
|
|
- },
|
|
|
- async scoreCurPaper(score) {
|
|
|
- const paper = await paperSelectLevelOrScore(
|
|
|
- this.curPaper.id, // is taskId
|
|
|
- score,
|
|
|
- "SCORE"
|
|
|
- );
|
|
|
- this.updateStepLevel(this.curStep, this.curPaper.level);
|
|
|
- this.updateCacheHistory([paper]);
|
|
|
- this.toActionNextPaper();
|
|
|
- },
|
|
|
- async passCurPaper(level) {
|
|
|
- await paperTaskPass(this.curPaper.id);
|
|
|
- this.toActionNextPaper();
|
|
|
- },
|
|
|
- updateHistory() {
|
|
|
- this.$refs.GradeHistoryPaper.updatePapers();
|
|
|
- },
|
|
|
- updateCacheHistory(papers) {
|
|
|
- this.$refs.GradeHistoryPaper.updateCachePapers(papers);
|
|
|
- },
|
|
|
- // 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);
|
|
|
- }
|
|
|
- }
|
|
|
-};
|
|
|
-</script>
|
|
|
+<template>
|
|
|
+ <div class="mark-operation grading-operation home">
|
|
|
+ <view-header> </view-header>
|
|
|
+ <div class="home-body">
|
|
|
+ <div class="home-main grading-detail">
|
|
|
+ <div class="grading-detail page-container-flex">
|
|
|
+ <grade-filter
|
|
|
+ ref="GradeFilter"
|
|
|
+ :data="workSubject"
|
|
|
+ @change="areaChange"
|
|
|
+ ></grade-filter>
|
|
|
+ <mark-step
|
|
|
+ :steps="steps"
|
|
|
+ :init-step="curStep"
|
|
|
+ :show-top-number="false"
|
|
|
+ @on-change="stepChange"
|
|
|
+ ref="MarkStep"
|
|
|
+ v-if="steps.levelStep"
|
|
|
+ ></mark-step>
|
|
|
+ <div class="detail-body clear-float">
|
|
|
+ <!-- detail-papers -->
|
|
|
+ <div :class="detailPapersClasses">
|
|
|
+ <div class="detail-papers-carousel">
|
|
|
+ <grade-history-paper
|
|
|
+ :question-id="filter.questionId"
|
|
|
+ stage="SCORE"
|
|
|
+ @on-paper-click="toViewCarouselPaper"
|
|
|
+ v-if="filter.questionId"
|
|
|
+ ref="GradeHistoryPaper"
|
|
|
+ ></grade-history-paper>
|
|
|
+ </div>
|
|
|
+ <div class="detail-papers-list" v-if="papers.length">
|
|
|
+ <div :class="imageViewClasses">
|
|
|
+ <div
|
|
|
+ :class="[
|
|
|
+ 'image-view',
|
|
|
+ { 'image-view-act': curPaperIndex === index }
|
|
|
+ ]"
|
|
|
+ v-for="(image, index) in papers"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <div class="image-view-container">
|
|
|
+ <h5 class="image-view-title">{{ image.title }}</h5>
|
|
|
+ <div class="image-view-contain">
|
|
|
+ <img
|
|
|
+ :src="image.thumbSrc"
|
|
|
+ :alt="image.title"
|
|
|
+ @click="toReview(index)"
|
|
|
+ />
|
|
|
+ <span
|
|
|
+ class="image-info"
|
|
|
+ v-if="image.score || image.score === 0"
|
|
|
+ >{{ image.score }}分</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="part-page">
|
|
|
+ <Page
|
|
|
+ :current="current"
|
|
|
+ :total="total"
|
|
|
+ :page-size="size"
|
|
|
+ show-total
|
|
|
+ show-elevator
|
|
|
+ :page-size-opts="[4, 6, 8]"
|
|
|
+ @on-page-size-change="pageSizeChange"
|
|
|
+ @on-change="toPage"
|
|
|
+ ></Page>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="detail-papers-list" v-else>
|
|
|
+ <p class="detail-papers-none">暂无数据</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- detail-aciton -->
|
|
|
+ <div
|
|
|
+ :class="[
|
|
|
+ 'detail-action',
|
|
|
+ { 'detail-action-fullscreen': isFullscreenMarking }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <mark-action
|
|
|
+ :cur-paper-or-task="curPaper"
|
|
|
+ :levels="levels"
|
|
|
+ @on-leader-level="gradingCurPaper"
|
|
|
+ @on-select-score="scoreCurPaper"
|
|
|
+ @on-pass="passCurPaper"
|
|
|
+ ref="GradeAction"
|
|
|
+ v-if="curPaper.id"
|
|
|
+ ></mark-action>
|
|
|
+ </div>
|
|
|
+ <!-- 占位 -->
|
|
|
+ <div class="detail-action" v-if="isFullscreenMarking"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 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 {
|
|
|
+ getParamsSet,
|
|
|
+ markerTaskList,
|
|
|
+ markerChangeLevelPaperList,
|
|
|
+ markerScoreTotalStatData,
|
|
|
+ workLevelList,
|
|
|
+ paperSelectLevelOrScore,
|
|
|
+ paperTaskPass
|
|
|
+} from "@/api";
|
|
|
+import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
|
+import MarkStep from "./components/MarkStep";
|
|
|
+import GradeFilter from "../grading/components/GradeFilter";
|
|
|
+import GradeHistoryPaper from "../grading/components/GradeHistoryPaper";
|
|
|
+import MarkAction from "./components/MarkAction";
|
|
|
+// 三种情况:
|
|
|
+// 管理员(ADMIN),科组长(MARK_LEADER),评卷员(MARKER)
|
|
|
+// 评卷员:操作记录,试卷列表,操作盘(打分)
|
|
|
+
|
|
|
+// TIP:不考虑管理员、科组长的情况
|
|
|
+// 管理员:试卷列表,操作盘
|
|
|
+// 科组长:操作记录,试卷列表,操作盘(改档)
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "mark-operation",
|
|
|
+ components: {
|
|
|
+ SimpleImagePreview,
|
|
|
+ MarkStep,
|
|
|
+ GradeFilter,
|
|
|
+ GradeHistoryPaper,
|
|
|
+ MarkAction
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ filter: {
|
|
|
+ markerId: this.$ls.get("user").id,
|
|
|
+ questionId: ""
|
|
|
+ },
|
|
|
+ typeFilter: {
|
|
|
+ undo: {
|
|
|
+ sort: "paper.level",
|
|
|
+ stage: "SCORE"
|
|
|
+ },
|
|
|
+ done: {
|
|
|
+ level: "",
|
|
|
+ sort: "updatedOn,desc",
|
|
|
+ stage: "SCORE"
|
|
|
+ },
|
|
|
+ shift: {
|
|
|
+ isShift: true,
|
|
|
+ isShiftScore: false
|
|
|
+ },
|
|
|
+ shiftScore: {
|
|
|
+ isShift: false,
|
|
|
+ isShiftScore: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ workId: this.$route.params.workId,
|
|
|
+ subjectId: this.$route.params.subjectId,
|
|
|
+ subject: "",
|
|
|
+ workSubject: {},
|
|
|
+ curSubject: {},
|
|
|
+ curUserRoleType: "MARKER",
|
|
|
+ changeStage: 0, // 是否显示改档及改档打分
|
|
|
+ current: 1,
|
|
|
+ size: 6,
|
|
|
+ total: 0,
|
|
|
+ totalPage: 1,
|
|
|
+ curStep: null,
|
|
|
+ curStandardGradeId: "",
|
|
|
+ steps: [],
|
|
|
+ levels: [],
|
|
|
+ curArea: {},
|
|
|
+ papers: [],
|
|
|
+ curPaper: {},
|
|
|
+ curPaperIndex: 0,
|
|
|
+ // carousel paper review,
|
|
|
+ carouselPapers: [],
|
|
|
+ curCarouselPaperIndex: 0,
|
|
|
+ isFullscreenMarking: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ detailPapersClasses() {
|
|
|
+ return ["detail-papers", `detail-papers-col-${1 + this.size / 2}`];
|
|
|
+ },
|
|
|
+ imageViewClasses() {
|
|
|
+ return ["image-view-list", `image-view-list-${this.size / 2}`];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.subject = this.subjectId.split("-")[1];
|
|
|
+ this.workSubject = {
|
|
|
+ workId: this.workId,
|
|
|
+ subject: this.subject
|
|
|
+ };
|
|
|
+ this.initData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData() {
|
|
|
+ this.getWorkLevels();
|
|
|
+ this.getParamsSetInfo();
|
|
|
+ },
|
|
|
+ async getParamsSetInfo() {
|
|
|
+ const data = await getParamsSet(this.workId);
|
|
|
+ this.changeStage = data.changeStage;
|
|
|
+ },
|
|
|
+ async getList() {
|
|
|
+ const datas = {
|
|
|
+ ...this.filter,
|
|
|
+ ...this.typeFilter[this.curStep.type],
|
|
|
+ workId: this.workId,
|
|
|
+ page: this.current - 1,
|
|
|
+ size: this.size
|
|
|
+ };
|
|
|
+ if (this.curStep.type === "done") {
|
|
|
+ datas.level = this.curStep.name;
|
|
|
+ }
|
|
|
+ const requestAction = this.curStep.type.includes("shift")
|
|
|
+ ? markerChangeLevelPaperList
|
|
|
+ : markerTaskList;
|
|
|
+
|
|
|
+ const data = await requestAction(datas);
|
|
|
+ this.papers = data.data.map(paper => {
|
|
|
+ paper.title = `NO.${paper.sn}`;
|
|
|
+ return paper;
|
|
|
+ });
|
|
|
+ this.total = data.totalCount;
|
|
|
+ this.totalPage = data.pageCount;
|
|
|
+ },
|
|
|
+ async toPage(page) {
|
|
|
+ this.current = page;
|
|
|
+ await this.getList();
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
+ },
|
|
|
+ async getStepLevels() {
|
|
|
+ const data = await markerScoreTotalStatData(
|
|
|
+ this.filter.markerId,
|
|
|
+ this.filter.questionId
|
|
|
+ );
|
|
|
+ const undoIndex = data.findIndex(item => item.id === null);
|
|
|
+ let otherStep = [];
|
|
|
+ let undo = {
|
|
|
+ count: 0,
|
|
|
+ shift: 0,
|
|
|
+ shiftScore: 0
|
|
|
+ };
|
|
|
+ if (undoIndex !== -1) {
|
|
|
+ undo = { ...data[undoIndex] };
|
|
|
+ data.splice(undoIndex, 1);
|
|
|
+ }
|
|
|
+ otherStep.push({
|
|
|
+ name: "待评",
|
|
|
+ count: undo.count,
|
|
|
+ type: "undo"
|
|
|
+ });
|
|
|
+
|
|
|
+ if (this.changeStage) {
|
|
|
+ otherStep.push({
|
|
|
+ name: "改档",
|
|
|
+ count: undo.shift,
|
|
|
+ type: "shift"
|
|
|
+ });
|
|
|
+ otherStep.push({
|
|
|
+ name: "改档打分",
|
|
|
+ count: undo.shiftScore,
|
|
|
+ type: "shiftScore"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let levelStep = data.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.id,
|
|
|
+ type: "done"
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.steps = { levelStep, otherStep };
|
|
|
+
|
|
|
+ if (!this.curStep) {
|
|
|
+ let curStep = {};
|
|
|
+ if (undoIndex === -1) {
|
|
|
+ curStep = levelStep[0];
|
|
|
+ } else {
|
|
|
+ curStep = otherStep[0];
|
|
|
+ }
|
|
|
+ this.curStep = curStep;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateStepLevel(curStep, curLevel, count = 1) {
|
|
|
+ if (curStep.type === "done") return;
|
|
|
+
|
|
|
+ const opos = this.steps.otherStep.findIndex(
|
|
|
+ item => item.type === curStep.type
|
|
|
+ );
|
|
|
+ this.steps.otherStep[opos].count -= count;
|
|
|
+
|
|
|
+ if (curStep.type === "shift") {
|
|
|
+ const spos = this.steps.otherStep.findIndex(
|
|
|
+ item => item.type === "shiftScore"
|
|
|
+ );
|
|
|
+ this.steps.otherStep[spos].count += count;
|
|
|
+ } else {
|
|
|
+ const pos = this.steps.levelStep.findIndex(
|
|
|
+ item => item.name === curLevel
|
|
|
+ );
|
|
|
+ this.steps.levelStep[pos].count += count;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getWorkLevels() {
|
|
|
+ const data = await workLevelList(this.workId);
|
|
|
+ this.levels = data.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.code
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
+ pageSizeChange(size) {
|
|
|
+ this.size = size;
|
|
|
+ this.toPage(1);
|
|
|
+ this.getStepLevels();
|
|
|
+ },
|
|
|
+ async stepChange(step) {
|
|
|
+ this.curStep = step;
|
|
|
+ this.current = 1;
|
|
|
+ await this.getList();
|
|
|
+ this.getStepLevels();
|
|
|
+ if (this.papers.length) {
|
|
|
+ this.selectPaper(0);
|
|
|
+ } else {
|
|
|
+ this.curPaper = {};
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async areaChange(curArea) {
|
|
|
+ this.curArea = curArea;
|
|
|
+ this.filter.questionId = curArea.id;
|
|
|
+ await this.getStepLevels();
|
|
|
+ this.toPage(1);
|
|
|
+ this.updateHistory();
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ const lastPaper = { ...this.curPaper };
|
|
|
+ this.curPaperIndex = nindex;
|
|
|
+ this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
|
|
|
+
|
|
|
+ // 待评时,检查当前试卷是否已经切换档位
|
|
|
+ if (
|
|
|
+ this.curStep.type === "undo" &&
|
|
|
+ this.curPaper["level"] &&
|
|
|
+ this.curPaper["level"] !== lastPaper["level"]
|
|
|
+ ) {
|
|
|
+ this.$Modal.info({
|
|
|
+ content: `即将打分档位:${this.curPaper.level}`
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async toPrevPaper() {
|
|
|
+ if (this.curPaperIndex === 0) {
|
|
|
+ if (this.current > 1) {
|
|
|
+ this.current--;
|
|
|
+ this.curPaperIndex = this.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.current === this.totalPage) {
|
|
|
+ this.$Message.warning("当前已经是最后一条数据了");
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ this.current++;
|
|
|
+ this.curPaperIndex = 0;
|
|
|
+ await this.getList();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.curPaperIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
+ },
|
|
|
+ async toActionNextPaper() {
|
|
|
+ if (this.current > 1 && this.papers.length === 1) {
|
|
|
+ this.current--;
|
|
|
+ this.curPaperIndex = this.size;
|
|
|
+ }
|
|
|
+
|
|
|
+ await this.getList();
|
|
|
+ if (!this.papers.length) this.$refs.SimpleImagePreview.cancel();
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
+ },
|
|
|
+ async gradingCurPaper({ selectedLevel }) {
|
|
|
+ // 确认改档
|
|
|
+ await paperSelectLevelOrScore(
|
|
|
+ this.curPaper.id, // is taskId
|
|
|
+ selectedLevel,
|
|
|
+ "LEVEL"
|
|
|
+ );
|
|
|
+ this.updateStepLevel(this.curStep, "shiftScore");
|
|
|
+ this.toActionNextPaper();
|
|
|
+ },
|
|
|
+ async scoreCurPaper(score) {
|
|
|
+ const paper = await paperSelectLevelOrScore(
|
|
|
+ this.curPaper.id, // is taskId
|
|
|
+ score,
|
|
|
+ "SCORE"
|
|
|
+ );
|
|
|
+ this.updateStepLevel(this.curStep, this.curPaper.level);
|
|
|
+ this.updateCacheHistory([paper]);
|
|
|
+ this.toActionNextPaper();
|
|
|
+ },
|
|
|
+ async passCurPaper(level) {
|
|
|
+ await paperTaskPass(this.curPaper.id);
|
|
|
+ this.toActionNextPaper();
|
|
|
+ },
|
|
|
+ updateHistory() {
|
|
|
+ this.$refs.GradeHistoryPaper.updatePapers();
|
|
|
+ },
|
|
|
+ updateCacheHistory(papers) {
|
|
|
+ this.$refs.GradeHistoryPaper.updateCachePapers(papers);
|
|
|
+ },
|
|
|
+ // 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|