|
|
@ -274,7 +274,6 @@ export default { |
|
|
|
const classId = this.classId |
|
|
|
const classId = this.classId |
|
|
|
// 匹配到该考核,并且已经提交过(有reportId则说明有实验记录),并且classId跟当前用户的classId相同,就提示提交了考核然后返回上一页 |
|
|
|
// 匹配到该考核,并且已经提交过(有reportId则说明有实验记录),并且classId跟当前用户的classId相同,就提示提交了考核然后返回上一页 |
|
|
|
if (list.find(e => e.assessmentId == assessmentId && e.reportId && e.classId == classId)) { |
|
|
|
if (list.find(e => e.assessmentId == assessmentId && e.reportId && e.classId == classId)) { |
|
|
|
console.log(33) |
|
|
|
|
|
|
|
done = true |
|
|
|
done = true |
|
|
|
this.isSubmit = true |
|
|
|
this.isSubmit = true |
|
|
|
newmain.$emit('isSubmit', this.isSubmit) |
|
|
|
newmain.$emit('isSubmit', this.isSubmit) |
|
|
@ -511,8 +510,44 @@ export default { |
|
|
|
score += e.score // 计算总分 |
|
|
|
score += e.score // 计算总分 |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.grade = util.handleZero(score) // 前置加0 |
|
|
|
this.grade = util.handleZero(score) // 前置加0 |
|
|
|
|
|
|
|
this.editReport(res.reportId) |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 编辑实验报告 |
|
|
|
|
|
|
|
editReport(reportId) { |
|
|
|
|
|
|
|
const data = [] |
|
|
|
|
|
|
|
const ans = [] |
|
|
|
|
|
|
|
const promises = [] |
|
|
|
|
|
|
|
this.taskList.map(e => { |
|
|
|
|
|
|
|
promises.push(new Promise((resolve, reject) => { |
|
|
|
|
|
|
|
data.push({ |
|
|
|
|
|
|
|
judgmentId: e.judgmentId, |
|
|
|
|
|
|
|
judgmentName: e.name, |
|
|
|
|
|
|
|
answer: e.code, |
|
|
|
|
|
|
|
score: e.examScore, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
// 获取参考答案 |
|
|
|
|
|
|
|
this.$get(this.api.queryBcJudgmentPointByBcId, { |
|
|
|
|
|
|
|
bcId: e.judgmentId |
|
|
|
|
|
|
|
}).then(({ judgmentPoint }) => { |
|
|
|
|
|
|
|
ans.push(judgmentPoint) |
|
|
|
|
|
|
|
resolve() |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
reject() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
Promise.all(promises).then(_ => { |
|
|
|
|
|
|
|
data.map(e => { |
|
|
|
|
|
|
|
const item = ans.find(n => n.bcId === e.judgmentId) |
|
|
|
|
|
|
|
e.referenceAnswer = item.experimentCode |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.$post(this.api.editExperimentalData, { |
|
|
|
|
|
|
|
reportId, |
|
|
|
|
|
|
|
data: JSON.stringify(data) |
|
|
|
|
|
|
|
}).then(res => {}).catch(err => {}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 实验面板显示隐藏 |
|
|
|
// 实验面板显示隐藏 |
|
|
|
togglePannel() { |
|
|
|
togglePannel() { |
|
|
|
this.pannelVisible = !this.pannelVisible |
|
|
|
this.pannelVisible = !this.pannelVisible |
|
|
|