From c1a0fe988f2f55c099040dec113c3edcf1645a84 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 5 Aug 2024 15:03:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4studyitemid?= =?UTF-8?q?=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/homework.vue | 12 +++++++++--- src/components/Course/weikeContent.vue | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/Course/homework.vue b/src/components/Course/homework.vue index 978d45b0..584a446f 100644 --- a/src/components/Course/homework.vue +++ b/src/components/Course/homework.vue @@ -37,7 +37,7 @@
- {{records.length>0?'重新提交':'提交'}} + {{records.length>0?'重新提交':'提交'}}
@@ -87,10 +87,12 @@ export default { has:true, info:{}, studyItemId:'', + studyItemIdOnce: '', filePath:'', answer:'', close:false, records:[],//作业记录 + isSubmit:false, }; }, mounted() { @@ -135,6 +137,9 @@ export default { apiCourseStudy.myHomeworkList(params).then(rs=>{ if(rs.status==200){ this.records=rs.result; + if(rs.result.length>0){ + this.studyItemIdOnce = rs.result[rs.result.length - 1].id; + } } }) }, @@ -171,9 +176,9 @@ export default { return; } } - + this.isSubmit = true let pamars = { - studyItemId: this.studyItemId,//学习内容记录id, + studyItemId: this.studyItemId || this.studyItemIdOnce,//学习内容记录id, studyId: this.studyId,//学习id, courseId: this.content.courseId,//课程id, contentId: this.content.id,//内容id, @@ -185,6 +190,7 @@ export default { score: 0 } apiCourseStudy.saveHomework(pamars).then(res=>{ + this.isSubmit = false if(res.status==200){ this.$message.success("作业已提交"); this.filePath=''; diff --git a/src/components/Course/weikeContent.vue b/src/components/Course/weikeContent.vue index 69bfa1bd..f8310736 100644 --- a/src/components/Course/weikeContent.vue +++ b/src/components/Course/weikeContent.vue @@ -1049,7 +1049,7 @@ this.cwareChange.curriculumData = deepClone(this.cware.curriculumData) } }else if(index==2){ - this.homework.content.contentName = this.homework.info.name + this.homework.content.contentName = this.homework.info.name || '作业' postData.content=this.homework.content; postData.homework=this.homework.info; this.homeworkChange = deepClone(this.homework)