|
@@ -1,12 +1,27 @@
|
|
|
<template>
|
|
|
<div class="mark-detail grading-detail">
|
|
|
- <grade-step :show-analysis="false" @on-change="stepChange"></grade-step>
|
|
|
- <div :class="bodyClasses">
|
|
|
+ <grade-step
|
|
|
+ :init-step="curStep"
|
|
|
+ :show-analysis="false"
|
|
|
+ @on-change="stepChange"
|
|
|
+ ref="GradeStep"
|
|
|
+ v-if="steps.length"
|
|
|
+ ></grade-step>
|
|
|
+ <div class="detail-body">
|
|
|
<div class="detail-filter">
|
|
|
<Form ref="FilterForm" label-position="left" inline>
|
|
|
<FormItem>
|
|
|
- <Select v-model="filter.areaCode" placeholder="请选择考区">
|
|
|
- <Option value=""></Option>
|
|
|
+ <Select
|
|
|
+ v-model="filter.questionId"
|
|
|
+ @on-change="areaChange"
|
|
|
+ placeholder="请选择考区"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="area in areas"
|
|
|
+ :key="area.id"
|
|
|
+ :value="area.id"
|
|
|
+ :label="area.areaName"
|
|
|
+ ></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
@@ -18,18 +33,22 @@
|
|
|
</div>
|
|
|
<!-- detail-papers -->
|
|
|
<div :class="detailPapersClasses">
|
|
|
- <div
|
|
|
- class="detail-papers-carousel"
|
|
|
- v-if="this.curUserRoleType !== 'ADMIN'"
|
|
|
- >
|
|
|
+ <div class="detail-papers-carousel" v-if="!IS_ADMIN">
|
|
|
<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">
|
|
|
<div :class="imageViewClasses">
|
|
|
<div
|
|
|
- class="image-view"
|
|
|
+ :class="[
|
|
|
+ 'image-view',
|
|
|
+ { 'image-view-act': curPaperIndex === index }
|
|
|
+ ]"
|
|
|
v-for="(image, index) in papers"
|
|
|
:key="index"
|
|
|
>
|
|
@@ -43,16 +62,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="part-page">
|
|
|
+ <div class="part-page" v-if="total > size">
|
|
|
<Page
|
|
|
:current="current"
|
|
|
:total="total"
|
|
|
:page-size="size"
|
|
|
show-total
|
|
|
show-elevator
|
|
|
- :show-sizer="curUserRoleType === 'MARKER'"
|
|
|
- :page-size-opts="[4, 6, 8]"
|
|
|
- @on-page-size-change="pageSizeChange"
|
|
|
@on-change="toPage"
|
|
|
></Page>
|
|
|
</div>
|
|
@@ -61,12 +77,13 @@
|
|
|
<!-- detail-aciton -->
|
|
|
<div class="detail-action">
|
|
|
<mark-action
|
|
|
- :paper="curPaper"
|
|
|
+ :cur-paper="curPaper"
|
|
|
:levels="levels"
|
|
|
- :step="curStep"
|
|
|
:user-role="curUserRoleType"
|
|
|
- @on-confirm="gradeCurPaper"
|
|
|
- ref="GradeAction"
|
|
|
+ @on-leader-level="leaderSelectLevel"
|
|
|
+ @on-code-search="serachPaperByCode"
|
|
|
+ @on-grade-change-search="searchGradeChangeList"
|
|
|
+ v-if="curPaper.id"
|
|
|
></mark-action>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -76,19 +93,38 @@
|
|
|
class="grading-detail-image-preview"
|
|
|
:image-list="papers"
|
|
|
:init-index="curPaperIndex"
|
|
|
- @on-prev="paperPrev"
|
|
|
- @on-next="paperNext"
|
|
|
+ @on-paper-change="selectPaper"
|
|
|
@on-page-prev="prevPage"
|
|
|
@on-page-next="nextPage"
|
|
|
header-hide
|
|
|
ref="ImagePreview"
|
|
|
v-if="papers.length"
|
|
|
></image-preview>
|
|
|
+ <!-- carousel paper review -->
|
|
|
+ <image-preview
|
|
|
+ class="grading-detail-image-preview"
|
|
|
+ :image-list="carouselPapers"
|
|
|
+ :init-index="curCarouselPaperIndex"
|
|
|
+ @on-paper-change="selectCarouselPaper"
|
|
|
+ loop
|
|
|
+ header-hide
|
|
|
+ ref="CarouselPapersPreview"
|
|
|
+ v-if="carouselPapers.length"
|
|
|
+ ></image-preview>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { paperPageList } from "@/api";
|
|
|
+import {
|
|
|
+ paperList,
|
|
|
+ changeLevelPaperList,
|
|
|
+ changeLevelPaperAllList,
|
|
|
+ levelStatData,
|
|
|
+ areaList,
|
|
|
+ workLevelList,
|
|
|
+ taskSnSearch,
|
|
|
+ markStepChangeLevel
|
|
|
+} from "@/api";
|
|
|
import ImagePreview from "@/components/common/ImagePreview";
|
|
|
import GradeStep from "../grading/components/GradeStep";
|
|
|
import GradeHistoryPaper from "../grading/components/GradeHistoryPaper";
|
|
@@ -97,6 +133,8 @@ import MarkAction from "./components/MarkAction";
|
|
|
// 管理员(ADMIN),科组长(MARK_LEADER),评卷员(MARKER)
|
|
|
// 管理员:试卷列表,操作盘
|
|
|
// 科组长:操作记录,试卷列表,操作盘(改档)
|
|
|
+
|
|
|
+// TIP:不考虑评卷员的情况
|
|
|
// 评卷员:操作记录,试卷列表,操作盘(打分)
|
|
|
|
|
|
export default {
|
|
@@ -110,21 +148,30 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
filter: {
|
|
|
- workId: this.$route.params.workId,
|
|
|
- subjectId: this.$route.params.subjectId,
|
|
|
- areaCode: ""
|
|
|
+ questionId: "",
|
|
|
+ sort: "score,desc",
|
|
|
+ level: "",
|
|
|
+ isSample: false
|
|
|
},
|
|
|
- curUserRoleType: "ADMIN",
|
|
|
+ workId: this.$route.params.workId,
|
|
|
+ subjectId: this.$route.params.subjectId,
|
|
|
+ subject: "",
|
|
|
+ curUserRoleType: "",
|
|
|
+ applyChangeLevelStatus: 1, // 改档申请处理状态
|
|
|
current: 1,
|
|
|
- size: 8,
|
|
|
+ size: 6,
|
|
|
total: 0,
|
|
|
totalPage: 1,
|
|
|
- curStep: {},
|
|
|
- curStandardGradeId: "",
|
|
|
+ curStep: null,
|
|
|
+ steps: [],
|
|
|
levels: [],
|
|
|
+ areas: [],
|
|
|
papers: [],
|
|
|
curPaper: {},
|
|
|
- curPaperIndex: 0
|
|
|
+ curPaperIndex: 0,
|
|
|
+ // carousel paper review,
|
|
|
+ carouselPapers: [],
|
|
|
+ curCarouselPaperIndex: 0
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -144,108 +191,204 @@ export default {
|
|
|
];
|
|
|
},
|
|
|
imageViewClasses() {
|
|
|
- return [
|
|
|
- "detail-paper-list",
|
|
|
- "image-view-list",
|
|
|
- `image-view-list-${this.size / 2}`
|
|
|
- ];
|
|
|
+ return ["image-view-list", `image-view-list-${this.size / 2}`];
|
|
|
+ },
|
|
|
+ IS_ADMIN() {
|
|
|
+ return this.curUserRoleType === "ADMIN";
|
|
|
+ },
|
|
|
+ IS_MARK_LEADER() {
|
|
|
+ return this.curUserRoleType === "MARK_LEADER";
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- // this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
|
|
|
- // if (this.curUserRoleType === "ADMIN") this.size = 8;
|
|
|
+ this.subject = this.subjectId.split("-")[1];
|
|
|
+ this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
|
|
|
+ if (this.curUserRoleType === "ADMIN") this.size = 8;
|
|
|
this.initData();
|
|
|
},
|
|
|
methods: {
|
|
|
- initData() {
|
|
|
- this.papers = "#"
|
|
|
- .repeat(this.size)
|
|
|
- .split("")
|
|
|
- .map((item, index) => {
|
|
|
- return {
|
|
|
- id: index,
|
|
|
- subjectName: "素描",
|
|
|
- title: "2020105133",
|
|
|
- score: "95",
|
|
|
- grade: "A",
|
|
|
- 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"
|
|
|
- };
|
|
|
- });
|
|
|
+ async initData() {
|
|
|
+ this.getWorkLevels();
|
|
|
+
|
|
|
+ await this.getAreaList();
|
|
|
+ this.filter.questionId = this.areas[0].id;
|
|
|
+ await this.getStepLevels();
|
|
|
+ this.getList();
|
|
|
},
|
|
|
async getList() {
|
|
|
- const datas = {
|
|
|
- ...this.filter,
|
|
|
- page: this.current - 1,
|
|
|
- size: this.size
|
|
|
- };
|
|
|
- const data = await paperPageList(datas);
|
|
|
- this.papers = data.data.map(paper => {
|
|
|
- return {
|
|
|
- id: paper.id,
|
|
|
- title: paper.examNumber,
|
|
|
- url: paper.imgSrc,
|
|
|
- thumbSrc: paper.thumbSrc,
|
|
|
- missing: paper.missing,
|
|
|
- stage: paper.stage,
|
|
|
- style: {},
|
|
|
- deg: 0
|
|
|
+ let data = [];
|
|
|
+ if (this.step.type === "done") {
|
|
|
+ const datas = {
|
|
|
+ ...this.filter,
|
|
|
+ level: this.curStep.name,
|
|
|
+ page: this.current - 1,
|
|
|
+ size: this.size
|
|
|
};
|
|
|
+
|
|
|
+ data = await paperList(datas);
|
|
|
+ } else {
|
|
|
+ const datas = {
|
|
|
+ markerId: this.$ls.get("user", { id: "" }).id,
|
|
|
+ questionId: this.filter.questionId,
|
|
|
+ status: this.applyChangeLevelStatus,
|
|
|
+ page: this.current - 1,
|
|
|
+ size: this.size
|
|
|
+ };
|
|
|
+ const requestAction = this.IS_ADMIN
|
|
|
+ ? changeLevelPaperAllList
|
|
|
+ : changeLevelPaperList;
|
|
|
+ data = await requestAction(datas);
|
|
|
+ }
|
|
|
+ this.papers = data.data.map(paper => {
|
|
|
+ paper.title = paper.examNumber;
|
|
|
+ return paper;
|
|
|
});
|
|
|
this.total = data.totalCount;
|
|
|
},
|
|
|
toPage(page) {
|
|
|
this.current = page;
|
|
|
- // this.getList();
|
|
|
- this.initData();
|
|
|
+ this.getList();
|
|
|
},
|
|
|
- pageSizeChange(size) {
|
|
|
- this.size = size;
|
|
|
- this.toPage(1);
|
|
|
+ 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.shift,
|
|
|
+ type: "shift"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let levelMenu = data.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.id,
|
|
|
+ type: "done"
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.steps = [...levelMenu, ...otherStep];
|
|
|
+ if (!this.curStep) this.curStep = this.steps[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
|
|
|
+ };
|
|
|
+ });
|
|
|
},
|
|
|
- stepChange(step) {
|
|
|
+ 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
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async stepChange(step) {
|
|
|
this.curStep = step;
|
|
|
+ this.current = 1;
|
|
|
+ await this.getList();
|
|
|
+ if (this.papers.length) {
|
|
|
+ this.selectPaper(0);
|
|
|
+ } else {
|
|
|
+ this.curPaper = {};
|
|
|
+ }
|
|
|
},
|
|
|
- toReview(index) {
|
|
|
- this.curPaper = { ...this.papers[index] };
|
|
|
- this.curPaperIndex = index;
|
|
|
- this.$refs.ImagePreview.open();
|
|
|
+ areaChange() {
|
|
|
+ this.getStepLevels();
|
|
|
+ this.toPage(1);
|
|
|
},
|
|
|
- paperPrev(index) {
|
|
|
- this.curPaper = { ...this.papers[index] };
|
|
|
+ selectPaper(index) {
|
|
|
this.curPaperIndex = index;
|
|
|
- },
|
|
|
- paperNext(index) {
|
|
|
this.curPaper = { ...this.papers[index] };
|
|
|
- this.curPaperIndex = index;
|
|
|
},
|
|
|
- prevPage() {
|
|
|
+ toReview(index) {
|
|
|
+ this.selectPaper(index);
|
|
|
+ this.$refs.ImagePreview.open();
|
|
|
+ },
|
|
|
+ async prevPage() {
|
|
|
if (this.current === 1) {
|
|
|
this.$Message.warning("当前已经是第一条数据了");
|
|
|
return;
|
|
|
}
|
|
|
this.current--;
|
|
|
- this.getList();
|
|
|
+ await this.getList();
|
|
|
+ this.selectPaper(this.papers.length - 1);
|
|
|
+ this.$refs.ImagePreview.initData();
|
|
|
},
|
|
|
- nextPage() {
|
|
|
+ async nextPage() {
|
|
|
if (this.current === this.totalPage) {
|
|
|
this.$Message.warning("当前已经是最后一条数据了");
|
|
|
return;
|
|
|
}
|
|
|
- this.current++;
|
|
|
- this.getList();
|
|
|
+ // 下一页时,继续获取当前页数据。
|
|
|
+ await this.getList();
|
|
|
+ this.selectPaper(0);
|
|
|
+ this.$refs.ImagePreview.initData();
|
|
|
},
|
|
|
- gradeCurPaper(grade) {
|
|
|
- // TODO:to grade
|
|
|
-
|
|
|
- if (this.curPaperIndex === this.size - 1) {
|
|
|
- this.nextPage();
|
|
|
+ toNext() {
|
|
|
+ this.$refs.ImagePreview.showNext();
|
|
|
+ },
|
|
|
+ updateHistory() {
|
|
|
+ this.$refs.GradeHistoryPaper.updatePapers();
|
|
|
+ },
|
|
|
+ async serachPaperByCode(params) {
|
|
|
+ const data = await taskSnSearch(
|
|
|
+ params.codeType,
|
|
|
+ params.code,
|
|
|
+ this.filter.questionId
|
|
|
+ );
|
|
|
+ if (!data) {
|
|
|
+ this.$Message.error("没有查找到结果!");
|
|
|
return;
|
|
|
- } else {
|
|
|
- this.paperNext(this.curPaperIndex + 1);
|
|
|
}
|
|
|
+ data.title = data.examNumber;
|
|
|
+ this.papers = [data];
|
|
|
+ this.total = 1;
|
|
|
+ },
|
|
|
+ searchGradeChangeList(applyChangeLevelStatus) {
|
|
|
+ this.applyChangeLevelStatus = applyChangeLevelStatus;
|
|
|
+ this.toPage(1);
|
|
|
+ },
|
|
|
+ leaderSelectLevel(levelInfo) {
|
|
|
+ const content = `确定申请由${levelInfo.curLevel}档改为${levelInfo.selectedLevel}并打回给所有老师吗?`;
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: "改档",
|
|
|
+ content,
|
|
|
+ onOk: async () => {
|
|
|
+ await markStepChangeLevel({
|
|
|
+ subjectId: this.subjectId,
|
|
|
+ paperId: levelInfo.paperId,
|
|
|
+ level: levelInfo.selectedLevel
|
|
|
+ });
|
|
|
+ this.$Message.success("改档成功!");
|
|
|
+ this.getStepLevels();
|
|
|
+ this.updateHistory();
|
|
|
+ this.toNext();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // paper carousel
|
|
|
+ toViewCarouselPaper(paperIndex, papers) {
|
|
|
+ this.curCarouselPaperIndex = paperIndex;
|
|
|
+ this.carouselPapers = papers;
|
|
|
+ this.$refs.CarouselPapersPreview.open();
|
|
|
+ },
|
|
|
+ selectCarouselPaper(index) {
|
|
|
+ this.curCarouselPaperIndex = index;
|
|
|
+ this.curPaper = { ...this.carouselPapers[index] };
|
|
|
}
|
|
|
}
|
|
|
};
|