yujialong 2 months ago
parent 1a8e6742a6
commit 67e2c1b6ec
  1. 1
      src/api/index.js
  2. 2
      src/pages/myReview/records/index.vue
  3. 136
      src/pages/myReview/theoryReview/index.vue

@ -25,4 +25,5 @@ export default {
reviewPaper: `/nakadai/evaluation/reviewPaper`,
setComments: `/nakadai/evaluation/setComments`,
getTheLabReportIdUpAndDown: `/nakadai/evaluation/getTheLabReportIdUpAndDown`,
deleteComments: `/nakadai/evaluation/deleteComments`,
}

@ -292,7 +292,7 @@ export default {
},
//
toReview (row, i) {
window.open(this.$router.resolve(`/theoryReview?id=${row.reportId}&u=${+this.showUserInfo}&m=${this.setup.hasManualScoreType}&c=${this.competitionId}&s=${this.stageId}&i=${(this.page - 1) * this.pageSize + i + 1}`).href)
window.open(this.$router.resolve(`/theoryReview?id=${row.reportId}&u=${+this.showUserInfo}&m=${this.setup.hasManualScoreType}&c=${this.competitionId}&s=${this.stageId}`).href)
},
}
};

@ -4,8 +4,8 @@
<p class="paper-name">{{ paperName }}</p>
<div class="actions">
<el-button v-if="curIndex > 0" class="btn" @click="prev">上一个</el-button>
<el-button v-if="recordTotal - 1 > curIndex" class="btn" @click="next">下一个</el-button>
<el-button v-if="showPrev" class="btn" @click="switchRecord(0)">上一个</el-button>
<el-button v-if="showNext" class="btn" @click="switchRecord(1)">下一个</el-button>
<el-button class="btn" @click="saveAll">一键保存分数</el-button>
<img class="exit" src="@/assets/images/exit.svg" alt="" @click="close">
</div>
@ -31,7 +31,7 @@
<li v-if="!sheetStatus || sheetStatus === ques.isCorrect" :key="j" :class="'status' + ques.isCorrect"
@click="scrollToQues(ques, item)">
<p :class="['serial', { answered: ques.answered, partAnswer: ques.partAnswer }]">{{ j + 1 }}</p>
<p class="score">{{ ques.userScore }}</p>
<p class="score">{{ ques.originUserScore }}</p>
</li>
</template>
</ul>
@ -140,11 +140,12 @@
<div class="line">题目分值{{ ques.questionScore }}</div>
<div class="line">
考生得分<el-input class="score-input hide-spin" type="number" placeholder="请输入分数" size="small"
v-model.number="ques.userScore" />&emsp;
<el-button type="primary" size="mini" @click="saveScore(ques)">保存分数</el-button>
v-model.number="ques.reviewScore" />&emsp;
<el-button v-if="ques.originUserScore !== ques.reviewScore" type="primary" size="mini"
@click="saveScore(ques)">保存分数</el-button>
<el-popover class="m-l-10" placement="bottom" width="400" trigger="click">
<el-input type="textarea" :rows="3" autosize resize="none" placeholder="请输入"
v-model="ques.comments" />
v-model="ques.newComments" />
<div class="m-t-10 text-right">
<el-button type="primary" size="mini" @click="saveComment(ques)">保存</el-button>
</div>
@ -153,12 +154,13 @@
</div>
</el-popover>
</div>
<div class="line">
<div v-if="ques.comments" class="line">
评语
<div>
<span>2024-12-12</span>
<span>{{ ques.commentSetTime }}</span>
<i class="el-icon-delete-solid del-comment" @click="delComment(ques)"></i>
<div class="comment">xxx</div>
<div class="comment" v-html="ques.comments"></div>
</div>
</div>
</div>
@ -207,7 +209,7 @@ export default {
return {
numToLetter: Util.numToLetter,
arabicToChinese: Util.arabicToChinese,
reportId: '',
reportId: this.$route.query.id,
competitionId: this.$route.query.c,
stageId: this.$route.query.s,
showUserInfo: +this.$route.query.u, //
@ -253,28 +255,19 @@ export default {
],
info: {},
paper: [],
records: [],
showNext: true,
showPrev: true,
page: 1,
recordTotal: 0,
previewImgVisible: false,
previewImg: '',
pdfVisible: false,
pdfSrc: '',
exporting: false,
submiting: false,
};
},
watch: {
$route: {
handler () {
this.curIndex = +this.$route.query.i
this.reportId = this.$route.query.id
this.getData()
},
immediate: true
}
},
mounted () {
this.getRecords()
this.getData()
},
methods: {
async getData () {
@ -300,7 +293,6 @@ export default {
n.difficultTheme = curDiff.theme
}
}
if (!n.comments) n.comments = ''
const opts = n.questionAnswerVersionsList
if (type !== 'fill_blank' && type !== 'essay') { //
@ -353,8 +345,11 @@ export default {
n.isCorrect = n.userScore && n.questionScore === n.userScore ? 1 : (rightLen ? 3 : 2)
} else if (type === 'essay') { //
if (!n.userScore) n.userScore = ''
if (!n.reviewScore) n.reviewScore = ''
n.isCorrect = 4 //
}
n.originUserScore = n.reviewScore
n.newComments = n.comments || ''
})
paper.push(e)
}
@ -367,19 +362,6 @@ export default {
this.loading = false
}
},
//
async getRecords () {
this.page = Math.ceil(this.curIndex / 10) || 1
const { page } = await this.$post(this.api.myReviewTaskByReviewList, {
pageNum: this.page,
pageSize: 10,
competitionId: this.competitionId,
stageId: this.stageId,
})
const list = page.records
this.records = list
this.recordTotal = page.total
},
scrollToSmooth (position, duration) {
let startTime = Date.now()
@ -431,69 +413,77 @@ export default {
},
//
async saveScore (ques) {
if (ques.reviewScore === '') return Util.warningMsg('请输入考生得分!')
if (ques.questionScore < ques.reviewScore) return Util.warningMsg('考生得分不得大于题目分值!')
await this.$post(this.api.reviewPaper, [{
assignmentDetailId: ques.assignmentDetailId,
score: ques.userScore,
reviewScore: ques.reviewScore,
}])
ques.originUserScore = ques.reviewScore
Util.successMsg('保存成功')
},
//
async saveComment (ques) {
await this.$post(this.api.setComments, {
const res = await this.$post(this.api.setComments, {
assignmentDetailId: ques.assignmentDetailId,
comments: ques.comments,
comments: ques.newComments,
})
this.$set(ques, 'commentSetTime', res.commentSetTime)
this.$set(ques, 'comments', ques.newComments)
Util.successMsg('保存成功')
},
//
async delComment (ques) {
await this.$post(this.api.reviewPaper, {
assignmentDetailId: ques.assignmentDetailId,
score: ques.userScore,
await this.$confirm(`确定要删除该评语吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
await this.$post(`${this.api.deleteComments}?assignmentDetailId=${ques.assignmentDetailId}`)
ques.comments = ''
Util.successMsg('删除成功')
},
//
async prev () {
this.exporting = true
const res = await axios.get(`${this.api.exportExamPaperReport}?reportId=${this.reportId}`, {
headers: {
token: this.token
},
responseType: 'blob'
})
const name = res.headers['content-disposition']
Util.downloadFileDirect(name ? decodeURI(name) : '标准成绩报告.docx', new Blob([res.data]))
this.exporting = false
},
//
async next () {
const i = this.curIndex + 1
const newPage = Math.ceil(i / 10) || 1
// debugger
if (newPage > this.page) {
await this.getRecords()
}
if (this.records[i % 10 - 1]) {
let reportId = this.records[i % 10 - 1].reportId
this.$router.push(`/theoryReview?id=${reportId}&u=${this.showUserInfo}&c=${this.competitionId}&s=${this.stageId}&i=${i}`)
async switchRecord (isNext) {
const res = await this.$post(this.api.getTheLabReportIdUpAndDown, {
competitionId: this.competitionId,
stageId: this.stageId,
currentReportId: this.reportId
})
const id = res[isNext ? 'nextReportId' : 'previousReportId']
this[isNext ? 'showNext' : 'showPrev'] = !!id
if (id) {
this.reportId = id
this.$router.push(`/theoryReview?id=${id}&u=${this.showUserInfo}&c=${this.competitionId}&s=${this.stageId}`)
this.getData()
}
},
//
async saveAll () {
const { paper } = this
const params = []
paper.forEach(e => {
e.userAnswerList.forEach(n => {
n.userScore !== '' && params.push({
assignmentDetailId: n.assignmentDetailId,
score: n.userScore,
if (this.submiting) return false
try {
this.submiting = true
const { paper } = this
const params = []
paper.forEach(e => {
e.userAnswerList.forEach(n => {
n.reviewScore !== '' && params.push({
assignmentDetailId: n.assignmentDetailId,
reviewScore: n.reviewScore,
})
})
})
})
await this.$post(this.api.reviewPaper, params)
Util.successMsg('保存成功')
await this.$post(this.api.reviewPaper, params)
Util.successMsg('保存成功')
} finally {
this.submiting = false
}
},
close () {
window.close()

Loading…
Cancel
Save