mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 19:36:43 +08:00
作业提交studyitemid赋值
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: center;padding-bottom: 10px;">
|
||||
<el-button type="primary" @click="submitHomework()">{{records.length>0?'重新提交':'提交'}}</el-button>
|
||||
<el-button type="primary" :disabled="isSubmit" @click="submitHomework()">{{records.length>0?'重新提交':'提交'}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="showRecord"><!--作业提交记录-->
|
||||
@@ -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='';
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user