提交 7219d42a authored 作者: lihuihui's avatar lihuihui

fix: 修改bug

上级 5ec7742d
...@@ -198,6 +198,7 @@ export default { ...@@ -198,6 +198,7 @@ export default {
// 获取报告 // 获取报告
getReportDetail(id) { getReportDetail(id) {
getReportDetail(id).then(res => { getReportDetail(id).then(res => {
this.caseId = res.data.detail.id
const cachData = res.data.detail.answer.commit_report const cachData = res.data.detail.answer.commit_report
if (this.$route.query.type !== '1') { if (this.$route.query.type !== '1') {
this.stepsIndex = cachData[1].steps this.stepsIndex = cachData[1].steps
......
...@@ -100,7 +100,8 @@ export default { ...@@ -100,7 +100,8 @@ export default {
resultCompletions: [], resultCompletions: [],
titleValue: '', titleValue: '',
titleData: {}, titleData: {},
isCommitCase: false isCommitCase: false,
caseId: ''
} }
}, },
computed: { computed: {
...@@ -123,6 +124,7 @@ export default { ...@@ -123,6 +124,7 @@ export default {
const data = this.getAnswer(1) const data = this.getAnswer(1)
cacheCaseAnswer(this.cases.id, { answers: JSON.stringify(data) }) cacheCaseAnswer(this.cases.id, { answers: JSON.stringify(data) })
.then(res => { .then(res => {
this.caseId = res.data.id
this.$message({ type: 'success', message: '保存成功' }) this.$message({ type: 'success', message: '保存成功' })
}) })
.catch(err => { .catch(err => {
...@@ -244,12 +246,12 @@ export default { ...@@ -244,12 +246,12 @@ export default {
} }
if (emptyDataIndex === -1) { if (emptyDataIndex === -1) {
const params = { answers: JSON.stringify(this.getAnswer()) } const params = { answers: JSON.stringify(this.getAnswer()) }
const id = this.$route.query.id const id = this.$route.query.id || this.caseId
if (id) params.id = id if (id) params.id = id
commitCase(params) commitCase(params)
.then(res => { .then(res => {
this.$message({ this.$message({
message: '保存成功!你可以在作品展示中查看/编辑报告,查看成绩', message: '提交成功!你可以在作品展示中查看报告,查看成绩',
type: 'success' type: 'success'
}) })
setTimeout(() => { setTimeout(() => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论