|
|
|
@ -300,7 +300,8 @@ export default { |
|
|
|
|
uploadDataList: [], |
|
|
|
|
searchTimer: null, |
|
|
|
|
uploadFaild: false, |
|
|
|
|
exportCode: "" |
|
|
|
|
exportCode: "", |
|
|
|
|
submiting: false // 新增编辑防抖标识 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
@ -489,6 +490,7 @@ export default { |
|
|
|
|
saveTopics() { // 提交新增/编辑题目 |
|
|
|
|
this.$refs.topicForm.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.submiting) return false |
|
|
|
|
let topicForm = this.topicForm; |
|
|
|
|
let optionCount = 0; |
|
|
|
|
let answer = ""; |
|
|
|
@ -510,13 +512,15 @@ export default { |
|
|
|
|
this.topicForm.questionType = this.questionType.indexOf(this.topicForm.questionType); |
|
|
|
|
this.topicForm.answer = answer.toUpperCase(); |
|
|
|
|
|
|
|
|
|
this.submiting = true |
|
|
|
|
if (this.topicForm.id) { |
|
|
|
|
this.$post(this.api.questionsUpdate, this.topicForm).then(res => { |
|
|
|
|
util.successMsg("编辑成功!"); |
|
|
|
|
this.NewTopics = false; |
|
|
|
|
this.submiting = false |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
this.submiting = false |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$post(this.api.questionsSave, this.topicForm).then(res => { |
|
|
|
@ -524,9 +528,10 @@ export default { |
|
|
|
|
this.NewTopics = false; |
|
|
|
|
this.subject = ""; |
|
|
|
|
this.keyword = ""; |
|
|
|
|
this.submiting = false |
|
|
|
|
this.initData(); |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
this.submiting = false |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|