|
@@ -16,6 +16,7 @@
|
|
|
'marker-action',
|
|
|
{ 'marker-action-fullscreen': isFullscreenMarking },
|
|
|
]"
|
|
|
+ v-show="!isMultipleSelection"
|
|
|
>
|
|
|
<mark-action
|
|
|
:cur-paper-or-task="curPaper"
|
|
@@ -29,9 +30,42 @@
|
|
|
ref="GradeAction"
|
|
|
v-if="curPaper.id"
|
|
|
></mark-action>
|
|
|
- <grade-ribbon ref="GradeRibbon"></grade-ribbon>
|
|
|
+ <grade-ribbon
|
|
|
+ ref="GradeRibbon"
|
|
|
+ @on-refresh="toRefreshPage"
|
|
|
+ ></grade-ribbon>
|
|
|
</div>
|
|
|
|
|
|
+ <!-- multiple grading action -->
|
|
|
+ <div class="marker-action" v-show="isMultipleSelection">
|
|
|
+ <div class="mark-action grade-action">
|
|
|
+ <div class="action-paper-state">
|
|
|
+ <p class="paper-state-cont">批量打分</p>
|
|
|
+ </div>
|
|
|
+ <div class="action-paper-info">
|
|
|
+ <p><span>任务密号:</span><span>--</span></p>
|
|
|
+ </div>
|
|
|
+ <div class="action-mark-list">
|
|
|
+ <div
|
|
|
+ class="action-mark-item"
|
|
|
+ v-for="(score, index) in scores"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ :class="[
|
|
|
+ 'action-mark-item-content',
|
|
|
+ { 'action-item-content-disabled': multiplebtnClicked },
|
|
|
+ ]"
|
|
|
+ @click="multipleSelectScore(score)"
|
|
|
+ >
|
|
|
+ <p>{{ score }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- marker body -->
|
|
|
<div
|
|
|
:class="['marker-body', { 'marker-body-low': ribbonSet.fastLevelNav }]"
|
|
|
>
|
|
@@ -53,7 +87,8 @@
|
|
|
:data="paper"
|
|
|
:stage="stage"
|
|
|
@to-review="toReview(index)"
|
|
|
- @to-switch="selectPaper(index)"
|
|
|
+ @to-switch="toSwitch(index)"
|
|
|
+ @to-select="selectMultiplePaper"
|
|
|
></marker-image-view>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -132,6 +167,7 @@ import {
|
|
|
markerManualScorePaperList,
|
|
|
markerMarkPaperList,
|
|
|
paperTaskPass,
|
|
|
+ paperSelectScoreBatch,
|
|
|
} from "@/api";
|
|
|
|
|
|
export default {
|
|
@@ -187,6 +223,7 @@ export default {
|
|
|
curPaperIndex: 0,
|
|
|
paramsSetReady: false,
|
|
|
cacheUpdateLevelInfos: null,
|
|
|
+ scores: [],
|
|
|
// multiple grading
|
|
|
multiplebtnClicked: false,
|
|
|
multipleGradingList: [],
|
|
@@ -277,6 +314,7 @@ export default {
|
|
|
paper.key = this.$randomCode();
|
|
|
paper.title = `NO.${paper.sn}`;
|
|
|
paper.score = paper.result;
|
|
|
+ paper.selected = false;
|
|
|
return paper;
|
|
|
});
|
|
|
this.setPage({
|
|
@@ -473,6 +511,107 @@ export default {
|
|
|
await this.getStepLevels();
|
|
|
this.toPage(1);
|
|
|
},
|
|
|
+ // selectMultiplePaper
|
|
|
+ selectMultiplePaper(paper) {
|
|
|
+ if (paper.sample) return;
|
|
|
+ const curPaper = this.papers.find((p) => p.id === paper.id);
|
|
|
+ curPaper.selected = paper.selected;
|
|
|
+ if (this.multipleGradingList.length === 0 && paper.selected) {
|
|
|
+ console.log(curPaper);
|
|
|
+
|
|
|
+ this.updateScoreList(curPaper.level);
|
|
|
+ } else if (this.multipleGradingList.length > 1 && paper.selected) {
|
|
|
+ if (this.multipleGradingList.some((p) => p.level !== curPaper.level)) {
|
|
|
+ this.$Message.error("批量打分只能选择同一档的试卷");
|
|
|
+ curPaper.selected = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.multipleGradingList = this.papers.filter((paper) => paper.selected);
|
|
|
+ },
|
|
|
+ clearMultiplePaper() {
|
|
|
+ this.multipleGradingList = [];
|
|
|
+ this.papers.forEach((paper) => {
|
|
|
+ paper.selected = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ updateScoreList(level) {
|
|
|
+ let scores = [];
|
|
|
+ const curLevel = this.levels.find((item) => item.name === level);
|
|
|
+ if (curLevel.levelType === "ADMITED") {
|
|
|
+ const { minScore, maxScore, intervalScore } = curLevel;
|
|
|
+ for (let i = minScore; i <= maxScore; i += intervalScore) {
|
|
|
+ scores.push(i);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ scores = curLevel.scoreList.split(",").map((item) => item * 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.scores = scores;
|
|
|
+ },
|
|
|
+ async multipleSelectScore(score) {
|
|
|
+ if (!this.multipleGradingList.length) return;
|
|
|
+ if (this.multiplebtnClicked) return;
|
|
|
+ this.multiplebtnClicked = true;
|
|
|
+ const multipleGradingListCount = this.multipleGradingList.length;
|
|
|
+ const curPaperlevel = this.multipleGradingList[0].level;
|
|
|
+
|
|
|
+ let result = true;
|
|
|
+ const paperIds = this.multipleGradingList.map((item) => item.id).join();
|
|
|
+ await paperSelectScoreBatch(
|
|
|
+ paperIds, // is taskId
|
|
|
+ score,
|
|
|
+ "SCORE"
|
|
|
+ ).catch(() => {
|
|
|
+ result = false;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.multiplebtnClicked = false;
|
|
|
+ if (!result) return;
|
|
|
+
|
|
|
+ this.updateStepLevel(
|
|
|
+ this.curStep,
|
|
|
+ {
|
|
|
+ curLevel: curPaperlevel,
|
|
|
+ manualScore: 0,
|
|
|
+ },
|
|
|
+ multipleGradingListCount,
|
|
|
+ paperIds
|
|
|
+ );
|
|
|
+
|
|
|
+ if (this.ribbonSet.listHandleRefresh) {
|
|
|
+ this.multipleGradingList.forEach((paper) => {
|
|
|
+ paper.level = score;
|
|
|
+ paper.result = score;
|
|
|
+ });
|
|
|
+ this.clearMultiplePaper();
|
|
|
+ const nextPaperIndex = this.papers.findIndex(
|
|
|
+ (paper) => !paper.score && paper.score !== 0
|
|
|
+ );
|
|
|
+ this.selectPaper(
|
|
|
+ nextPaperIndex === -1 ? this.papers.length - 1 : nextPaperIndex
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.clearMultiplePaper();
|
|
|
+ // update paper list
|
|
|
+ if (
|
|
|
+ this.page.current > 1 &&
|
|
|
+ this.page.current === this.page.totalPage &&
|
|
|
+ this.papers.length === multipleGradingListCount
|
|
|
+ ) {
|
|
|
+ this.setPage({ current: this.page.current - 1 });
|
|
|
+ }
|
|
|
+
|
|
|
+ await this.getList();
|
|
|
+ this.selectPaper(this.curPaperIndex);
|
|
|
+ },
|
|
|
+ // select paper
|
|
|
+ toSwitch(index) {
|
|
|
+ this.clearMultiplePaper();
|
|
|
+ this.selectPaper(index);
|
|
|
+ },
|
|
|
toReview(index) {
|
|
|
this.isFullscreenMarking = true;
|
|
|
this.selectPaper(index);
|
|
@@ -622,6 +761,10 @@ export default {
|
|
|
await paperTaskPass(this.curPaper.id);
|
|
|
this.toActionNextPaper(false, true);
|
|
|
},
|
|
|
+ async toRefreshPage() {
|
|
|
+ await this.getList();
|
|
|
+ this.selectPaper(0);
|
|
|
+ },
|
|
|
// paper carousel
|
|
|
toViewCarouselPaper(paperIndex, papers, type) {
|
|
|
this.carouselType = type;
|