Commit f36ee099 authored by lshan's avatar lshan

聊天管理不可以添加空问题

parent 3a0f005e
...@@ -244,13 +244,15 @@ export default Vue.extend({ ...@@ -244,13 +244,15 @@ export default Vue.extend({
}, },
//发布 //发布
onSubmit() { onSubmit() {
(this.$refs.ruleForm as FormModel).validate(valid => { (this.$refs.ruleForm as FormModel).validate(valid => {
if (valid) { if (valid) {
this.show = false
// if(this.total<10 && this.total+this.forms.length<=10){
this.show = false
for(let i=0;i<this.forms.length;i++){ for(let i=0;i<this.forms.length;i++){
FAQService.getInstance(). AddQueAns({ if( !this.forms[i].question ){
message.error('第'+i+'个问题为空')
}else{
FAQService.getInstance(). AddQueAns({
answer:this.forms[i].answer, answer:this.forms[i].answer,
question: this.forms[i].question question: this.forms[i].question
}).then((ret) => { }).then((ret) => {
...@@ -258,26 +260,12 @@ export default Vue.extend({ ...@@ -258,26 +260,12 @@ export default Vue.extend({
this.fetchList() this.fetchList()
} }
}) })
}
} }
// }else if(this.total<10&&this.total+this.forms.length>10){
// this.show = false
// for(let i=0;i<10-this.total;i++){
// FAQService.getInstance(). AddQueAns({
// answer:this.forms[i].answer,
// question: this.forms[i].question
// }).then((ret) => {
// if (ret.code === 200) {
// this.fetchList()
// }
// })
// }
// }else{
// this.show = true
// this.$message.error('数据数量超出限制!', 3);
// }
this.resetForm() this.resetForm()
} else { } else {
console.log('error submit!!'); message.error('error submit!!')
return false; return false;
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment