|
@@ -0,0 +1,441 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="marker-grading">
|
|
|
|
+ <marker-header
|
|
|
|
+ :data="workSubject"
|
|
|
|
+ @area-change="areaChange"
|
|
|
|
+ @to-history="toHistory"
|
|
|
|
+ @to-standard="toStandard"
|
|
|
|
+ ></marker-header>
|
|
|
|
+
|
|
|
|
+ <div class="marker-action"></div>
|
|
|
|
+
|
|
|
|
+ <div class="marker-body">
|
|
|
|
+ <div :class="markerImageListClasses" v-if="papers.length">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(paper, index) in papers"
|
|
|
|
+ :key="paper.id"
|
|
|
|
+ :class="[
|
|
|
|
+ 'marker-image-item',
|
|
|
|
+ {
|
|
|
|
+ 'marker-image-item-act': curPaperIndex === index
|
|
|
|
+ }
|
|
|
|
+ ]"
|
|
|
|
+ >
|
|
|
|
+ <div class="marker-image-content">
|
|
|
|
+ <marker-image-view
|
|
|
|
+ :data="paper"
|
|
|
|
+ @to-review="toReview(index)"
|
|
|
|
+ @to-check="toCheck"
|
|
|
|
+ ></marker-image-view>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- MarkerHistory -->
|
|
|
|
+ <marker-history
|
|
|
|
+ :question-id="filter.questionId"
|
|
|
|
+ ref="MarkerHistory"
|
|
|
|
+ ></marker-history>
|
|
|
|
+ <!-- MarkerStandard -->
|
|
|
|
+ <marker-standard
|
|
|
|
+ :question-id="filter.questionId"
|
|
|
|
+ :levels="levels"
|
|
|
|
+ ref="MarkerStandard"
|
|
|
|
+ v-if="levels.length && filter.questionId && paramsSet.showSample"
|
|
|
|
+ ></marker-standard>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import MarkerHeader from "./MarkerHeader";
|
|
|
|
+import MarkerImageView from "./MarkerImageView";
|
|
|
|
+import MarkerHistory from "./MarkerHistory";
|
|
|
|
+import MarkerStandard from "./MarkerStandard";
|
|
|
|
+import {
|
|
|
|
+ markerTaskList,
|
|
|
|
+ markerLevelTotalStatData,
|
|
|
|
+ workLevelList,
|
|
|
|
+ paperSelectLevelOrScore,
|
|
|
|
+ paperSelectLevelBatch,
|
|
|
|
+ paperTaskPass,
|
|
|
|
+ getParamsSet
|
|
|
|
+} from "@/api";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: "marker-grading",
|
|
|
|
+ components: { MarkerHeader, MarkerImageView, MarkerHistory, MarkerStandard },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ filter: {
|
|
|
|
+ markerId: this.$ls.get("user").id,
|
|
|
|
+ questionId: "",
|
|
|
|
+ sort: "randomSeq,asc",
|
|
|
|
+ stage: "LEVEL"
|
|
|
|
+ },
|
|
|
|
+ typeFilter: {
|
|
|
|
+ done: {
|
|
|
|
+ level: ""
|
|
|
|
+ },
|
|
|
|
+ undo: {},
|
|
|
|
+ reject: {
|
|
|
|
+ reject: true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ workId: this.$route.params.workId,
|
|
|
|
+ subjectId: this.$route.params.subjectId,
|
|
|
|
+ subject: "",
|
|
|
|
+ workSubject: {},
|
|
|
|
+ current: 1,
|
|
|
|
+ size: 12,
|
|
|
|
+ total: 0,
|
|
|
|
+ totalPage: 1,
|
|
|
|
+ curStep: null,
|
|
|
|
+ curStandardGradeId: "",
|
|
|
|
+ steps: [],
|
|
|
|
+ levels: [],
|
|
|
|
+ curArea: {},
|
|
|
|
+ papers: [],
|
|
|
|
+ curPaper: {},
|
|
|
|
+ curPaperIndex: 0,
|
|
|
|
+ paramsSet: {}
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ markerImageListClasses() {
|
|
|
|
+ return ["marker-image-list", `marker-image-list-${this.size}`];
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.subject = this.subjectId.split("-")[1];
|
|
|
|
+ this.workSubject = {
|
|
|
|
+ workId: this.workId,
|
|
|
|
+ subject: this.subject
|
|
|
|
+ };
|
|
|
|
+ this.initData();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ async initData() {
|
|
|
|
+ await this.getParamsSetInfo();
|
|
|
|
+ await this.getWorkLevels();
|
|
|
|
+ },
|
|
|
|
+ async getParamsSetInfo() {
|
|
|
|
+ this.paramsSet = await getParamsSet(this.workId);
|
|
|
|
+ },
|
|
|
|
+ async getList() {
|
|
|
|
+ this.multipleGradingList = [];
|
|
|
|
+ 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;
|
|
|
|
+ datas.sort = "updatedOn,desc";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const data = await markerTaskList(datas);
|
|
|
|
+ this.papers = data.data.map(paper => {
|
|
|
|
+ paper.title = `NO.${paper.sn}`;
|
|
|
|
+ paper.selected = false;
|
|
|
|
+ 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 markerLevelTotalStatData(
|
|
|
|
+ this.filter.markerId,
|
|
|
|
+ this.filter.questionId
|
|
|
|
+ );
|
|
|
|
+ const undoIndex = data.findIndex(item => item.id === null);
|
|
|
|
+ let otherStep = [];
|
|
|
|
+ let undo = {
|
|
|
|
+ count: 0,
|
|
|
|
+ rejected: 0
|
|
|
|
+ };
|
|
|
|
+ if (undoIndex !== -1) {
|
|
|
|
+ undo = { ...data[undoIndex] };
|
|
|
|
+ data.splice(undoIndex, 1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ otherStep.push({
|
|
|
|
+ name: "待评",
|
|
|
|
+ count: undo.count,
|
|
|
|
+ type: "undo"
|
|
|
|
+ });
|
|
|
|
+ otherStep.push({
|
|
|
|
+ name: "打回",
|
|
|
|
+ count: undo.rejected,
|
|
|
|
+ type: "reject"
|
|
|
|
+ });
|
|
|
|
+ let levelStep = data.map(item => {
|
|
|
|
+ // 评卷员不展示kdpt
|
|
|
|
+ item.kdpt = null;
|
|
|
|
+ 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) {
|
|
|
|
+ if (curStep.type === "done") {
|
|
|
|
+ const lpos = this.steps.levelStep.findIndex(
|
|
|
|
+ item => item.name === curStep.name
|
|
|
|
+ );
|
|
|
|
+ this.steps.levelStep[lpos].count -= count;
|
|
|
|
+ } else {
|
|
|
|
+ const opos = this.steps.otherStep.findIndex(
|
|
|
|
+ item => item.type === curStep.type
|
|
|
|
+ );
|
|
|
|
+ this.steps.otherStep[opos].count -= count;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const pos = this.steps.levelStep.findIndex(
|
|
|
|
+ item => item.name === curLevel
|
|
|
|
+ );
|
|
|
|
+ this.steps.levelStep[pos].count += count;
|
|
|
|
+
|
|
|
|
+ this.steps.levelStep.forEach(item => {
|
|
|
|
+ item.percent =
|
|
|
|
+ item.finalKdTotal && item.count
|
|
|
|
+ ? ((100 * item.count) / item.finalKdTotal).toFixed(3)
|
|
|
|
+ : 0;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ 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
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ pageSizeChange(size) {
|
|
|
|
+ this.size = size;
|
|
|
|
+ this.toPage(1);
|
|
|
|
+ this.getStepLevels();
|
|
|
|
+ },
|
|
|
|
+ async stepChange(step) {
|
|
|
|
+ this.curStep = step;
|
|
|
|
+ // this.getStepLevels();
|
|
|
|
+ // this.toPage(1);
|
|
|
|
+ this.current = 1;
|
|
|
|
+ this.isFullscreenMarking = false;
|
|
|
|
+ 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();
|
|
|
|
+ },
|
|
|
|
+ // selectMultiplePaper
|
|
|
|
+ selectMultiplePaper(paper) {
|
|
|
|
+ if (paper.sample) return;
|
|
|
|
+ paper.selected = !paper.selected;
|
|
|
|
+ this.multipleGradingList = this.papers.filter(paper => paper.selected);
|
|
|
|
+ },
|
|
|
|
+ async multipleSelectLevel(level) {
|
|
|
|
+ if (!this.multipleGradingList.length) return;
|
|
|
|
+ if (this.multiplebtnClicked) return;
|
|
|
|
+ this.multiplebtnClicked = true;
|
|
|
|
+ const multipleGradingListCount = this.multipleGradingList.length;
|
|
|
|
+
|
|
|
|
+ let result = true;
|
|
|
|
+ const papers = await paperSelectLevelBatch(
|
|
|
|
+ this.multipleGradingList.map(item => item.id).join(), // is taskId
|
|
|
|
+ level.name,
|
|
|
|
+ "LEVEL"
|
|
|
|
+ ).catch(() => {
|
|
|
|
+ result = false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.multiplebtnClicked = false;
|
|
|
|
+ if (!result) return;
|
|
|
|
+
|
|
|
|
+ this.multipleGradingList = [];
|
|
|
|
+ // this.getStepLevels();
|
|
|
|
+ this.updateStepLevel(this.curStep, level.name, multipleGradingListCount);
|
|
|
|
+ this.updateHistory(papers);
|
|
|
|
+
|
|
|
|
+ // update paper list
|
|
|
|
+ if (
|
|
|
|
+ this.current > 1 &&
|
|
|
|
+ this.current === this.pageCount &&
|
|
|
|
+ this.papers.length === multipleGradingListCount
|
|
|
|
+ ) {
|
|
|
|
+ this.current--;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ await this.getList();
|
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
|
+ },
|
|
|
|
+ toCheck(paper) {
|
|
|
|
+ console.log(paper);
|
|
|
|
+ },
|
|
|
|
+ // paper view action
|
|
|
|
+ toReview(index) {
|
|
|
|
+ this.isFullscreenMarking = true;
|
|
|
|
+ this.multipleGradingList = [];
|
|
|
|
+ this.selectPaper(index);
|
|
|
|
+ this.$refs.SimpleImagePreview.open();
|
|
|
|
+ },
|
|
|
|
+ selectPaper(index) {
|
|
|
|
+ let nindex = index;
|
|
|
|
+ if (!this.papers.length) {
|
|
|
|
+ nindex = 0;
|
|
|
|
+ } else if (index > this.papers.length - 1) {
|
|
|
|
+ nindex = this.papers.length - 1;
|
|
|
|
+ } else if (index < 0) {
|
|
|
|
+ nindex = 0;
|
|
|
|
+ }
|
|
|
|
+ this.curPaperIndex = nindex;
|
|
|
|
+ this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
|
|
|
|
+ },
|
|
|
|
+ async toPrevPaper() {
|
|
|
|
+ if (this.curPaperIndex === 0) {
|
|
|
|
+ if (this.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 gradeCurPaper(level) {
|
|
|
|
+ const paper = await paperSelectLevelOrScore(
|
|
|
|
+ this.curPaper.id, // is taskId
|
|
|
|
+ level.name,
|
|
|
|
+ "LEVEL"
|
|
|
|
+ );
|
|
|
|
+ this.updateStepLevel(this.curStep, level.name, 1);
|
|
|
|
+ this.updateCacheHistory([paper]);
|
|
|
|
+ this.toActionNextPaper();
|
|
|
|
+ },
|
|
|
|
+ async passCurPaper() {
|
|
|
|
+ await paperTaskPass(this.curPaper.id);
|
|
|
|
+ this.toActionNextPaper();
|
|
|
|
+ },
|
|
|
|
+ updateHistory() {
|
|
|
|
+ this.$refs.GradeHistoryPaper.updatePapers();
|
|
|
|
+ },
|
|
|
|
+ updateCacheHistory(papers) {
|
|
|
|
+ this.$refs.GradeHistoryPaper.updateCachePapers(papers);
|
|
|
|
+ },
|
|
|
|
+ // paper carousel
|
|
|
|
+ toViewCarouselPaper(paperIndex, papers, type) {
|
|
|
|
+ this.carouselType = type;
|
|
|
|
+ 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 (this.carouselType === "sample") {
|
|
|
|
+ this.toSampleCarousePaper(type);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (type === "prev" && this.curCarouselPaperIndex > 0) {
|
|
|
|
+ this.curCarouselPaperIndex--;
|
|
|
|
+ } else if (
|
|
|
|
+ type === "next" &&
|
|
|
|
+ this.curCarouselPaperIndex < this.carouselPapers.length - 1
|
|
|
|
+ ) {
|
|
|
|
+ this.curCarouselPaperIndex++;
|
|
|
|
+ }
|
|
|
|
+ this.selectCarouselPaper(this.curCarouselPaperIndex);
|
|
|
|
+ },
|
|
|
|
+ toSampleCarousePaper(type) {
|
|
|
|
+ if (type === "prev") {
|
|
|
|
+ this.$refs.GradeStandardPaper.$refs.PaperCarousel.handleLeft();
|
|
|
|
+ } else if (type === "next") {
|
|
|
|
+ this.$refs.GradeStandardPaper.$refs.PaperCarousel.handleRight();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ carouseImagePreviewClose() {
|
|
|
|
+ this.isFullscreenMarking = false;
|
|
|
|
+ this.carouselType = "";
|
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
|
+ },
|
|
|
|
+ standardPaperChange(curPaper) {
|
|
|
|
+ if (!this.isFullscreenMarking) return;
|
|
|
|
+ this.curPaper = { ...curPaper };
|
|
|
|
+ },
|
|
|
|
+ // header
|
|
|
|
+ toHistory() {
|
|
|
|
+ this.$refs.MarkerHistory.open();
|
|
|
|
+ },
|
|
|
|
+ toStandard() {
|
|
|
|
+ this.$refs.MarkerStandard.open();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+</script>
|