|
@@ -85,7 +85,8 @@ export default {
|
|
|
defaultSelected: [],
|
|
|
defaultRemark: '',
|
|
|
dialogVisible: false
|
|
|
- }
|
|
|
+ },
|
|
|
+ uploading: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -139,14 +140,21 @@ export default {
|
|
|
this.uploadOption.dialogVisible = true
|
|
|
},
|
|
|
async handleUploadReady(type, name, selectData) {
|
|
|
- const commit = {
|
|
|
- workId: this.uploadWork.id,
|
|
|
- stuIds: selectData.checkedStudent,
|
|
|
- remark: selectData.remark
|
|
|
+ if (this.uploading) return
|
|
|
+ this.uploading = true
|
|
|
+ try {
|
|
|
+ const commit = {
|
|
|
+ workId: this.uploadWork.id,
|
|
|
+ stuIds: selectData.checkedStudent,
|
|
|
+ remark: selectData.remark
|
|
|
+ }
|
|
|
+ await publicStudentHomework(commit)
|
|
|
+ this.uploadOption.dialogVisible = false
|
|
|
+ this.msgSuccess('发布成功')
|
|
|
+ this.uploading = false
|
|
|
+ } catch (e) {
|
|
|
+ this.uploading = false
|
|
|
}
|
|
|
- await publicStudentHomework(commit)
|
|
|
- this.uploadOption.dialogVisible = false
|
|
|
- this.msgSuccess('发布成功')
|
|
|
await this.getList()
|
|
|
}
|
|
|
}
|