yujialong 2 months ago
parent ba51245493
commit f65c4178f6
  1. 5
      src/pages/allocationReview/list/setup.vue
  2. 114
      src/pages/myReview/theoryReview/index.vue

@ -169,14 +169,15 @@ export default {
// //
async getDetail () { async getDetail () {
try { try {
const id = this.row.evaluationId const { row } = this
const id = row.evaluationId
if (id) { if (id) {
const { data } = await this.$post(`${this.api.evaluationFind}?id=${id}`) const { data } = await this.$post(`${this.api.evaluationFind}?id=${id}`)
this.form = { this.form = {
allowManualGrading: data.allowManualGrading, allowManualGrading: data.allowManualGrading,
anonymizeStudents: data.anonymizeStudents, anonymizeStudents: data.anonymizeStudents,
evaluationId: data.evaluationId, evaluationId: data.evaluationId,
isTimed: data.isTimed, isTimed: row.resultsDetails ? data.isTimed : 1, // isTimed
reviewersPerQuestion: data.reviewersPerQuestion, reviewersPerQuestion: data.reviewersPerQuestion,
scoreAggregationRule: data.scoreAggregationRule, scoreAggregationRule: data.scoreAggregationRule,
} }

@ -282,8 +282,8 @@ export default {
async getData (init) { async getData (init) {
this.loading = true this.loading = true
try { try {
const { userAnswers: outline, report } = await this.$get(`${this.api.reviewTheDetailsReport}?reportId=${this.reportId}&status=${this.curReview}`) const { userAnswers: outline, entryInformation: info } = await this.$get(`${this.api.reviewTheDetailsReport}?reportId=${this.reportId}&status=${this.curReview}`)
this.info = report this.info = info
// //
const { questionTypes: types, difficults } = QuesConst const { questionTypes: types, difficults } = QuesConst
@ -481,52 +481,82 @@ export default {
}, },
// //
async handleLeave (cb) { async handleLeave (type, cb) {
const { paper } = this if (this.readonly) {
let invalid = 0 cb()
for (const e of paper) { } else {
if (e.userAnswerList.some(n => n.originUserScore !== n.reviewScore)) { const { paper } = this
invalid = 1 let invalid = 0
break for (const e of paper) {
if (e.userAnswerList.some(n => n.originUserScore !== n.reviewScore)) {
invalid = 1
break
}
} }
}
if (invalid) {
try {
await this.$confirm('还有未保存的分数,是否保存并继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
})
await this.saveAll()
cb() if (invalid) {
} catch (e) { } try {
} else { await this.$confirm('还有未保存的分数,是否保存并继续?', '提示', {
cb() confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
})
await this.saveAll()
cb()
} catch (e) { }
} else {
//
const { userAnswers: outline } = await this.$get(`${this.api.reviewTheDetailsReport}?reportId=${this.reportId}&status=0`)
for (const e of outline) {
if (e.userAnswerList.length) {
invalid = 1
break
}
}
if (invalid) {
await this.$confirm(`还有试题未评阅,确定要${!type ? '前往上一个' : type === 1 ? '前往下一个' : '退出'}吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
})
cb()
} else {
cb()
}
}
}
},
// id
async queryRecord (isNext, init) {
const res = await this.$post(this.api.getTheLabReportIdUpAndDown, {
competitionId: this.competitionId,
stageId: this.stageId,
currentReportId: this.reportId
})
this.showNext = !init && !isNext && res.previousReportId ? true : (init ? !!res.nextReportId : !!res.nextNextReportId)
this.showPrev = !init && isNext && res.nextReportId ? true : (init ? !!res.previousReportId : !!res.previousPreviousReportId)
if (!init) {
const id = res[isNext ? 'nextReportId' : 'previousReportId']
if (id) {
this.reportId = id
this.$router.push(`/theoryReview?id=${id}&u=${this.showUserInfo}&m=${this.hasManualScoreType}&c=${this.competitionId}&s=${this.stageId}&r=${this.readonly ? 1 : 0}`)
this.getData()
}
} }
}, },
// //
async switchRecord (isNext, init) { async switchRecord (isNext, init) {
this.handleLeave(async () => { if (init) {
const res = await this.$post(this.api.getTheLabReportIdUpAndDown, { this.queryRecord(isNext, init)
competitionId: this.competitionId, } else {
stageId: this.stageId, this.handleLeave(isNext, async () => {
currentReportId: this.reportId this.queryRecord(isNext, init)
}) })
this.showNext = !init && !isNext && res.previousReportId ? true : (init ? !!res.nextReportId : !!res.nextNextReportId) }
this.showPrev = !init && isNext && res.nextReportId ? true : (init ? !!res.previousReportId : !!res.previousPreviousReportId)
if (!init) {
const id = res[isNext ? 'nextReportId' : 'previousReportId']
if (id) {
this.reportId = id
this.$router.push(`/theoryReview?id=${id}&u=${this.showUserInfo}&m=${this.hasManualScoreType}&c=${this.competitionId}&s=${this.stageId}&r=${this.readonly ? 1 : 0}`)
this.getData()
}
}
})
}, },
// //
async saveAll () { async saveAll () {
@ -552,7 +582,7 @@ export default {
} }
}, },
close () { close () {
this.handleLeave(window.close) this.handleLeave(2, window.close)
}, },
} }
}; };

Loading…
Cancel
Save