From e825e0adec034d80ab468072970b336e3ca8a1fb Mon Sep 17 00:00:00 2001 From: caoyang Date: Thu, 24 Mar 2022 20:32:07 +0800 Subject: [PATCH] =?UTF-8?q?ocr=E4=B8=8A=E4=BC=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/components/OcrAddForm/index.vue | 22 +++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/jero-web/src/components/OcrAddForm/index.vue b/jero-web/src/components/OcrAddForm/index.vue index ead6d354b..bb504a79f 100644 --- a/jero-web/src/components/OcrAddForm/index.vue +++ b/jero-web/src/components/OcrAddForm/index.vue @@ -180,7 +180,7 @@ :before-upload="beforeUpload" @change="handleChange" > - + {{$t('UploadFile')}} @@ -328,11 +328,13 @@ this.fileList.push(res) } }) + this.formInline[this.uploadName] = '' // console.log('remove',this.fileList) // this.$emit('uploadSuccess', this.fileList) this.$message.destroy() this.$message.success(`${info.file.name} 删除成功。`); } else if (status === 'done') { + this.fileList = [] this.myfileList = info.fileList; // console.log('file3333',info.fileList) @@ -366,10 +368,19 @@ if(this.myfileList.length > 0){ // this.$emit('uploadSuccess', this.fileList) - // console.log('fileList111',this.fileList) - this.formInline.attId=this.myfileList[0].response.result.id + // console.log('fileList111',this.myfileList) + let attIdList = [] + this.fileList.map(item => { + attIdList.push(item.id) + }) + /** 赋值给当前对应的表单文件 */ + this.formInline[this.uploadName] = attIdList.join(',') + + + // this.formInline.attId=this.myfileList[0].response.result.id this.$message.destroy() this.$message.success(`${info.file.name} 文件上传成功。`); + this.$refs.ruleForm1.clearValidate() } } else if (status === 'uploading') { this.myfileList = info.fileList; @@ -421,7 +432,7 @@ }) }, clickButtonToUpload(current) { - this.$refs.uploadFile.visible = true + // this.$refs.uploadFile.visible = true this.uploadName = current }, /** 上传文件的回调 */ @@ -509,7 +520,8 @@ rule.push({ required: true, message: res.db_field_txt + '不能为空', - trigger: 'change' + type:'string', + trigger: 'blur' }) } }