|
@@ -0,0 +1,454 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="leader-marking marker-grading">
|
|
|
|
+ <marker-header
|
|
|
|
+ :show-standard="false"
|
|
|
|
+ :show-statistics="false"
|
|
|
|
+ @area-change="areaChange"
|
|
|
|
+ @step-change="stepChange"
|
|
|
|
+ @page-set-change="pageSetChange"
|
|
|
|
+ @to-progress="toProgress"
|
|
|
|
+ @to-history="toHistory"
|
|
|
|
+ @to-statistics="toStatistics"
|
|
|
|
+ ></marker-header>
|
|
|
|
+
|
|
|
|
+ <div
|
|
|
|
+ :class="[
|
|
|
|
+ 'marker-action',
|
|
|
|
+ { 'marker-action-fullscreen': isFullscreenMarking }
|
|
|
|
+ ]"
|
|
|
|
+ >
|
|
|
|
+ <mark-action
|
|
|
|
+ :cur-paper-or-task="curPaper"
|
|
|
|
+ :levels="levels"
|
|
|
|
+ @on-leader-level="leaderSelectLevel"
|
|
|
|
+ @on-code-search="serachPaperByCode"
|
|
|
|
+ @on-grade-change-search="searchGradeChangeList"
|
|
|
|
+ v-if="curPaper.id"
|
|
|
|
+ ref="GradeAction"
|
|
|
|
+ ></mark-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"
|
|
|
|
+ :stage="stage"
|
|
|
|
+ @to-review="toReview(index)"
|
|
|
|
+ ></marker-image-view>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else class="marker-image-none">暂无数据</div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- LeaderProgress -->
|
|
|
|
+ <leader-progress ref="LeaderProgress"></leader-progress>
|
|
|
|
+ <!-- MarkerHistory -->
|
|
|
|
+ <marker-history
|
|
|
|
+ :question-id="filter.questionId"
|
|
|
|
+ :stage="stage"
|
|
|
|
+ @on-paper-click="
|
|
|
|
+ (index, papers) => {
|
|
|
|
+ toViewCarouselPaper(index, papers);
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ ref="MarkerHistory"
|
|
|
|
+ ></marker-history>
|
|
|
|
+ <!-- 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 { mapState, mapMutations } from "vuex";
|
|
|
|
+import MarkerHeader from "../../grading/marker/MarkerHeader";
|
|
|
|
+import MarkAction from "../components/MarkAction";
|
|
|
|
+import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
|
|
+import LeaderProgress from "../../grading/leader/LeaderProgress";
|
|
|
|
+import MarkerImageView from "../../grading/marker/MarkerImageView";
|
|
|
|
+import MarkerHistory from "../../grading/marker/MarkerHistory";
|
|
|
|
+
|
|
|
|
+import {
|
|
|
|
+ paperList,
|
|
|
|
+ subjectDetail,
|
|
|
|
+ changeLevelPaperList,
|
|
|
|
+ paperManualScoreList,
|
|
|
|
+ scoreStatData,
|
|
|
|
+ workLevelList,
|
|
|
|
+ taskSnSearch,
|
|
|
|
+ markStepChangeLevel,
|
|
|
|
+ getParamsSet
|
|
|
|
+} from "@/api";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: "leader-marking",
|
|
|
|
+ components: {
|
|
|
|
+ MarkerHeader,
|
|
|
|
+ MarkerImageView,
|
|
|
|
+ MarkerHistory,
|
|
|
|
+ // MarkerStatistics,
|
|
|
|
+ LeaderProgress,
|
|
|
|
+ MarkAction,
|
|
|
|
+ SimpleImagePreview
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ filter: {
|
|
|
|
+ questionId: "",
|
|
|
|
+ sort: "score,desc"
|
|
|
|
+ },
|
|
|
|
+ stage: "SCORE",
|
|
|
|
+ workId: this.$route.params.workId,
|
|
|
|
+ subjectId: this.$route.params.subjectId,
|
|
|
|
+ subject: "",
|
|
|
|
+ workSubject: {},
|
|
|
|
+ curUserRoleType: "",
|
|
|
|
+ applyChangeLevelStatus: 1, // 改档申请处理状态
|
|
|
|
+ levels: [],
|
|
|
|
+ papers: [],
|
|
|
|
+ curPaper: {},
|
|
|
|
+ curPaperIndex: 0,
|
|
|
|
+ // carousel paper review,
|
|
|
|
+ carouselPapers: [],
|
|
|
|
+ curCarouselPaperIndex: 0,
|
|
|
|
+ isFullscreenMarking: false
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState("marker", ["paramsSet", "page", "steps", "curStep", "curArea"]),
|
|
|
|
+ markerImageListClasses() {
|
|
|
|
+ return ["marker-image-list", `marker-image-list-${this.page.size}`];
|
|
|
|
+ },
|
|
|
|
+ showPaperRelateCount() {
|
|
|
|
+ return !!this.paramsSet["showPaperCount"];
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.subject = this.subjectId.split("-")[1];
|
|
|
|
+ this.workSubject = {
|
|
|
|
+ workId: this.workId,
|
|
|
|
+ subject: this.subject
|
|
|
|
+ };
|
|
|
|
+ this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
|
|
|
|
+ this.initData();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapMutations("marker", [
|
|
|
|
+ "setParamSet",
|
|
|
|
+ "setPage",
|
|
|
|
+ "setSteps",
|
|
|
|
+ "setCurArea",
|
|
|
|
+ "setCurStep",
|
|
|
|
+ "setCurSubject",
|
|
|
|
+ "clearState"
|
|
|
|
+ ]),
|
|
|
|
+ initData() {
|
|
|
|
+ this.getWorkLevels();
|
|
|
|
+ this.getSubjectDetail();
|
|
|
|
+ this.getParamsSetInfo();
|
|
|
|
+ },
|
|
|
|
+ async getParamsSetInfo() {
|
|
|
|
+ const data = await getParamsSet(this.workId);
|
|
|
|
+ this.setParamSet(data || {});
|
|
|
|
+ },
|
|
|
|
+ async getSubjectDetail() {
|
|
|
|
+ const curSubject = await subjectDetail(this.subjectId);
|
|
|
|
+ this.setCurSubject(curSubject || {});
|
|
|
|
+ },
|
|
|
|
+ async getList() {
|
|
|
|
+ let data = [];
|
|
|
|
+ if (this.curStep.type === "shift") {
|
|
|
|
+ const datas = {
|
|
|
|
+ workId: this.workId,
|
|
|
|
+ subject: this.subject,
|
|
|
|
+ questionId: this.filter.questionId,
|
|
|
|
+ status: this.applyChangeLevelStatus,
|
|
|
|
+ page: this.page.current - 1,
|
|
|
|
+ size: this.page.size
|
|
|
|
+ };
|
|
|
|
+ data = await changeLevelPaperList(datas);
|
|
|
|
+ } else if (this.curStep.type === "manualScore") {
|
|
|
|
+ const datas = {
|
|
|
|
+ workId: this.workId,
|
|
|
|
+ questionId: this.filter.questionId,
|
|
|
|
+ page: this.page.current - 1,
|
|
|
|
+ size: this.page.size
|
|
|
|
+ };
|
|
|
|
+ data = await paperManualScoreList(datas);
|
|
|
|
+ } else {
|
|
|
|
+ const datas = {
|
|
|
|
+ ...this.filter,
|
|
|
|
+ isScore: true,
|
|
|
|
+ page: this.page.current - 1,
|
|
|
|
+ size: this.page.size
|
|
|
|
+ };
|
|
|
|
+ if (this.curStep.type === "done") datas.level = this.curStep.name;
|
|
|
|
+
|
|
|
|
+ data = await paperList(datas);
|
|
|
|
+ }
|
|
|
|
+ this.papers = data.data.map(paper => {
|
|
|
|
+ paper.title = this.IS_ADMIN ? paper.examNumber : `NO.${paper.sn}`;
|
|
|
|
+ return paper;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.setPage({
|
|
|
|
+ total: data.totalCount,
|
|
|
|
+ totalPage: data.pageCount
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ async toPage(page) {
|
|
|
|
+ this.setPage({
|
|
|
|
+ current: page
|
|
|
|
+ });
|
|
|
|
+ await this.getList();
|
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
|
+ },
|
|
|
|
+ async getStepLevels() {
|
|
|
|
+ const data = await scoreStatData(this.subjectId, this.filter.questionId);
|
|
|
|
+ const undoIndex = data.findIndex(item => item.id === null);
|
|
|
|
+ let otherStep = [];
|
|
|
|
+ let undo = {
|
|
|
|
+ count: 0,
|
|
|
|
+ shift: 0
|
|
|
|
+ };
|
|
|
|
+ if (undoIndex !== -1) {
|
|
|
|
+ undo = { ...data[undoIndex] };
|
|
|
|
+ data.splice(undoIndex, 1);
|
|
|
|
+ }
|
|
|
|
+ otherStep.push({
|
|
|
|
+ name: "待评",
|
|
|
|
+ count: undo.count,
|
|
|
|
+ type: "undo"
|
|
|
|
+ });
|
|
|
|
+ otherStep.push({
|
|
|
|
+ name: "改档",
|
|
|
|
+ count: undo.shift,
|
|
|
|
+ type: "shift"
|
|
|
|
+ });
|
|
|
|
+ let levelStep = data
|
|
|
|
+ .filter(item => item.id !== "manualScore")
|
|
|
|
+ .map(item => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ name: item.id,
|
|
|
|
+ type: "done"
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ const msInfo = data.find(item => item.id === "manualScore");
|
|
|
|
+ if (msInfo) {
|
|
|
|
+ levelStep.push({
|
|
|
|
+ count: msInfo.count,
|
|
|
|
+ name: "输分试卷",
|
|
|
|
+ type: "manualScore"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.setSteps({ levelStep, otherStep });
|
|
|
|
+
|
|
|
|
+ if (!this.curStep.type) {
|
|
|
|
+ this.setCurStep(levelStep[0]);
|
|
|
|
+ } else {
|
|
|
|
+ const curStep = [...levelStep, ...otherStep].find(
|
|
|
|
+ item => item.name === this.curStep.name
|
|
|
|
+ );
|
|
|
|
+ this.setCurStep(curStep);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async getWorkLevels() {
|
|
|
|
+ const data = await workLevelList(this.workId);
|
|
|
|
+ this.levels = data.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ name: item.code
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ pageSetChange() {
|
|
|
|
+ this.papers = [];
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ async stepChange(step) {
|
|
|
|
+ this.applyChangeLevelStatus = 1;
|
|
|
|
+ this.setCurStep(step);
|
|
|
|
+ this.setPage({ current: 1 });
|
|
|
|
+ this.isFullscreenMarking = false;
|
|
|
|
+ await this.getList();
|
|
|
|
+ this.getStepLevels();
|
|
|
|
+ if (this.papers.length) {
|
|
|
|
+ this.selectPaper(0);
|
|
|
|
+ } else {
|
|
|
|
+ this.curPaper = {};
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async areaChange(curArea) {
|
|
|
|
+ this.setCurArea(curArea);
|
|
|
|
+ this.filter.questionId = curArea.id;
|
|
|
|
+ await this.getStepLevels();
|
|
|
|
+ this.toPage(1);
|
|
|
|
+ },
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ this.curPaperIndex = nindex;
|
|
|
|
+ this.curPaper = this.papers[nindex] ? { ...this.papers[nindex] } : {};
|
|
|
|
+ },
|
|
|
|
+ async toPrevPaper() {
|
|
|
|
+ if (this.curPaperIndex === 0) {
|
|
|
|
+ if (this.page.current > 1) {
|
|
|
|
+ this.setPage({ current: this.page.current - 1 });
|
|
|
|
+ this.curPaperIndex = this.page.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.page.current === this.page.totalPage) {
|
|
|
|
+ this.$Message.warning("当前已经是最后一条数据了");
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ this.setPage({ current: this.page.current + 1 });
|
|
|
|
+ this.curPaperIndex = 0;
|
|
|
|
+ await this.getList();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.curPaperIndex++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
|
+ },
|
|
|
|
+ async toActionNextPaper() {
|
|
|
|
+ if (this.page.current > 1 && this.papers.length === 1) {
|
|
|
|
+ this.setPage({ current: this.page.current - 1 });
|
|
|
|
+ this.curPaperIndex = this.page.size;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ await this.getList();
|
|
|
|
+ if (!this.papers.length) this.$refs.SimpleImagePreview.cancel();
|
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
|
+ },
|
|
|
|
+ async serachPaperByCode(params) {
|
|
|
|
+ const data = await taskSnSearch(
|
|
|
|
+ params.codeType,
|
|
|
|
+ params.code,
|
|
|
|
+ this.filter.questionId
|
|
|
|
+ );
|
|
|
|
+ if (!data) {
|
|
|
|
+ this.$Message.error("没有查找到结果!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ data.title = this.IS_ADMIN ? data.examNumber : `NO.${data.sn}`;
|
|
|
|
+ this.papers = [data];
|
|
|
|
+ this.setPage({ current: 1, total: 1, totalPage: 1 });
|
|
|
|
+ this.selectPaper(0);
|
|
|
|
+ },
|
|
|
|
+ searchGradeChangeList(applyChangeLevelStatus) {
|
|
|
|
+ this.applyChangeLevelStatus = applyChangeLevelStatus;
|
|
|
|
+ this.toPage(1);
|
|
|
|
+ },
|
|
|
|
+ leaderSelectLevel(levelInfo) {
|
|
|
|
+ const content = `确定申请由${levelInfo.curLevel}档改为${levelInfo.selectedLevel}并打回给所有老师吗?`;
|
|
|
|
+ this.$Modal.confirm({
|
|
|
|
+ content,
|
|
|
|
+ onOk: async () => {
|
|
|
|
+ await markStepChangeLevel({
|
|
|
|
+ subjectId: this.subjectId,
|
|
|
|
+ paperId: levelInfo.paperId,
|
|
|
|
+ level: levelInfo.selectedLevel,
|
|
|
|
+ userId: this.$ls.get("user", { id: "" }).id
|
|
|
|
+ });
|
|
|
|
+ this.$Message.success("申请改档成功!");
|
|
|
|
+ this.getStepLevels();
|
|
|
|
+ this.toActionNextPaper();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 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);
|
|
|
|
+ },
|
|
|
|
+ // header
|
|
|
|
+ toHistory() {
|
|
|
|
+ this.$refs.MarkerHistory.open();
|
|
|
|
+ },
|
|
|
|
+ toStatistics() {
|
|
|
|
+ this.$refs.MarkerStatistics.open();
|
|
|
|
+ },
|
|
|
|
+ toProgress() {
|
|
|
|
+ this.$refs.LeaderProgress.open();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ this.clearState();
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+</script>
|