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