From 9b613993e8b59f0426cbaddb8e5bd735b975472b Mon Sep 17 00:00:00 2001 From: caoyang Date: Tue, 8 Mar 2022 19:02:25 +0800 Subject: [PATCH] =?UTF-8?q?bug=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 | 10 +- jero-web/src/components/ocrUpload/index.vue | 133 +++++++++--------- .../documentManage/tags/dialog/areaManage.vue | 1 + .../documentManage/tags/dialog/dicList.vue | 4 +- .../documentManage/tags/tabs/tagContent.vue | 20 ++- 5 files changed, 93 insertions(+), 75 deletions(-) diff --git a/jero-web/src/components/ocrAddForm/index.vue b/jero-web/src/components/ocrAddForm/index.vue index daed13cb8..794bdc370 100644 --- a/jero-web/src/components/ocrAddForm/index.vue +++ b/jero-web/src/components/ocrAddForm/index.vue @@ -271,9 +271,8 @@ }, methods: { sumber() { - console.log('vilidate',this.formInline) + // console.log('vilidate',this.formInline) this.$refs.ruleForm1.validate(valid => { - console.log('va',valid) if (valid) { let url = '' if (this.formInline.id) { @@ -310,7 +309,12 @@ /** 赋值给当前对应的表单文件 */ this.formInline[this.uploadName] = attIdList.join(',') this.formInline = { ...this.formInline } - console.log('form',this.formInline) + // console.log('form',this.formInline) + }else{ + this.formInline[this.uploadName]='' + this.formInline = { ...this.formInline } + // console.log('form',this.formInline) + } }, handleInput(value) { diff --git a/jero-web/src/components/ocrUpload/index.vue b/jero-web/src/components/ocrUpload/index.vue index 3c2bb46a0..2fd79aa8d 100644 --- a/jero-web/src/components/ocrUpload/index.vue +++ b/jero-web/src/components/ocrUpload/index.vue @@ -7,7 +7,7 @@ class="ant-upload-list" name="file" :file-list="myfileList" - :multiple="true" + :multiple="false" :action = 'uploadAction' :headers="headers" :before-upload="beforeUpload" @@ -47,19 +47,23 @@ // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); }, methods:{ - beforeUpload(file) { - // console.log(file) - // let thisFileType = this.thisFileType.replace(/\s+/g, ""); - if(file.type==this.accept){ - this.fileTypeSatus = true; - this.$message.destroy() - // 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量! - this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!"; + beforeUpload(file,fileList) { + if(this.myfileList&&this.myfileList.length>=1){ + this.$message.warning('只能上传一个文件') + return false + }else{ + // let thisFileType = this.thisFileType.replace(/\s+/g, ""); + if(file.type==this.accept){ + this.fileTypeSatus = true; + this.$message.destroy() + // 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量! + this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!"; + } } - }, remove(){ this.fileTypeSatus = true; + // console.log('rrr',this.myfileList) }, handleChange(info) { // console.log('info',info) @@ -71,38 +75,18 @@ info.fileList.splice(index,1) } }) - if (this.fileTypeSatus) { - if (file.size > 100000000) { - this.$message.error(this.errorMessage) - return - }else { - if (status === 'error') { - this.$emit('uploadSuccess', this.fileList) - this.$message.destroy() - this.$message.error(`${info.file.name} 文件上传失败。`); - } else if (status === 'removed') { - this.myfileList = info.fileList; - this.fileList = [] - this.myfileList.forEach((res) => { - if (res.response) { - this.fileList.push(res.response.result) - } else { - this.fileList.push(res) - } - }) - this.$emit('uploadSuccess', this.fileList) - if(this.myfileList.length > 0){ + if (this.fileTypeSatus) { + if (file.size > 100000000) { + this.$message.error(this.errorMessage) + return + }else { + if (status === 'error') { + 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) - if (info.fileList.length > 20) { - info.fileList.splice(20) - // this.myfileList = info.fileList; - + this.$message.error(`${info.file.name} 文件上传失败。`); + } else if (status === 'removed') { + this.myfileList = info.fileList; + this.fileList = [] this.myfileList.forEach((res) => { if (res.response) { this.fileList.push(res.response.result) @@ -110,36 +94,55 @@ this.fileList.push(res) } }) - // console.log('file1111',this.fileList) + // console.log('remove',this.fileList) this.$emit('uploadSuccess', this.fileList) this.$message.destroy() - this.$message.error('最多只能上传二十个'); - return - } - // console.log('my222',this.myfileList) - this.myfileList.forEach((res) => { - if (res.response) { - this.fileList.push(res.response.result) - // console.log('flist',res.response) - } else { - this.fileList.push(res) - } - }) + this.$message.success(`${info.file.name} 删除成功。`); + } else if (status === 'done') { + this.fileList = [] + this.myfileList = info.fileList; + // console.log('file3333',info.fileList) + if (info.fileList.length > 1) { + info.fileList.splice(1) + // this.myfileList = info.fileList; - if(this.myfileList.length > 0){ - this.$emit('uploadSuccess', this.fileList) - this.$message.destroy() - this.$message.success(`${info.file.name} 文件上传成功。`); + this.myfileList.forEach((res) => { + if (res.response) { + this.fileList.push(res.response.result) + } else { + this.fileList.push(res) + } + }) + // console.log('file1111',this.fileList) + this.$emit('uploadSuccess', this.fileList) + this.$message.destroy() + this.$message.error('最多只能上传一个文件'); + return + } + // console.log('my222',this.myfileList) + this.myfileList.forEach((res) => { + if (res.response) { + this.fileList.push(res.response.result) + // console.log('flist',res.response) + } else { + this.fileList.push(res) + } + }) + + if(this.myfileList.length > 0){ + this.$emit('uploadSuccess', this.fileList) + this.$message.destroy() + this.$message.success(`${info.file.name} 文件上传成功。`); + } + } else if (status === 'uploading') { + this.myfileList = info.fileList; + this.$emit('uploadSuccess') + // this.$message.success(`${info.file.name} 文件上传成功。`); } - } else if (status === 'uploading') { - this.myfileList = info.fileList; - this.$emit('uploadSuccess') - // this.$message.success(`${info.file.name} 文件上传成功。`); } + }else{ + this.$message.warning('不支持上传该类型的文件!') } - }else{ - this.$message.warning('不支持上传该类型的文件!') - } }, } } diff --git a/jero-web/src/views/documentManage/tags/dialog/areaManage.vue b/jero-web/src/views/documentManage/tags/dialog/areaManage.vue index a51a0d19d..db85f339d 100644 --- a/jero-web/src/views/documentManage/tags/dialog/areaManage.vue +++ b/jero-web/src/views/documentManage/tags/dialog/areaManage.vue @@ -267,6 +267,7 @@ deleteAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => { if (res.success) { this.$message.success(this.$t('OperationSuccessful')); + this.queryParams.pageNo=1 this.loadData() }else{ this.$message.warning(this.$t('operationFailed')); diff --git a/jero-web/src/views/documentManage/tags/dialog/dicList.vue b/jero-web/src/views/documentManage/tags/dialog/dicList.vue index 5b21c47cc..c060b1603 100644 --- a/jero-web/src/views/documentManage/tags/dialog/dicList.vue +++ b/jero-web/src/views/documentManage/tags/dialog/dicList.vue @@ -353,6 +353,7 @@ deleteAction(`sys/dictItem/delete`, params).then(res => { if(res.success) { this.$message.success(this.$t('OperationSuccessful')); + this.queryParams.pageNo=1 this.loadData() }else{ this.$message.warning(this.$t('operationFailed')); @@ -381,6 +382,7 @@ async () => { deleteAction(`sys/category/deleteBatch`, params).then(res => { if(res.success){ + this.queryParams.pageNo=1 this.loadData() this.$message.success(this.$t('OperationSuccessful')) }else{ @@ -394,7 +396,7 @@ } }, ok(val){ - this.queryParams.pageNo=val.pageSize + this.queryParams.pageNo=val.pageNo this.queryParams.pageSize=val.pageSize this.loadData() } diff --git a/jero-web/src/views/documentManage/tags/tabs/tagContent.vue b/jero-web/src/views/documentManage/tags/tabs/tagContent.vue index 4a30135d6..01a70ac37 100644 --- a/jero-web/src/views/documentManage/tags/tabs/tagContent.vue +++ b/jero-web/src/views/documentManage/tags/tabs/tagContent.vue @@ -32,17 +32,17 @@ :label-col="labelCol" :wrapper-col="wrapperCol" > - + - + - + \ No newline at end of file