From 2b66aecf4412c8c6a6e6211fed2b7125399bce90 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Fri, 10 Mar 2023 13:32:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/setting/KnowledgeBaseForm.vue | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/views/setting/KnowledgeBaseForm.vue b/src/views/setting/KnowledgeBaseForm.vue index ceb26bd6..a1fa8be7 100644 --- a/src/views/setting/KnowledgeBaseForm.vue +++ b/src/views/setting/KnowledgeBaseForm.vue @@ -305,21 +305,21 @@ export default { this.blockOperation.save = true // 校验form + upload + preview this.$refs.form.validate(valid => { + this.$refs.form.validateField('tagName') + if (!this.uploaded) { + this.uploadErrorTip = this.$t('validate.required') + } else { + this.uploadErrorTip = '' + } + + if (this.importedData.length === 0) { + this.previewErrorTip = this.$t('validate.required') + } else if (this.hasErrorImportedData()) { + this.previewErrorTip = this.$t('validate.pleaseCheckForErrorItem') + } else { + this.previewErrorTip = '' + } if (valid) { - if (!this.uploaded) { - this.uploadErrorTip = this.$t('validate.required') - } else { - this.uploadErrorTip = '' - } - - if (this.importedData.length === 0) { - this.previewErrorTip = this.$t('validate.required') - } else if (this.hasErrorImportedData()) { - this.previewErrorTip = this.$t('validate.pleaseCheckForErrorItem') - } else { - this.previewErrorTip = '' - } - // 校验通过后组织数据、请求接口 if (valid && !this.uploadErrorTip && !this.previewErrorTip) { const postData = {