From a8bdba128bc58c9569fea814cd1d6913e19154c2 Mon Sep 17 00:00:00 2001 From: caoyang Date: Mon, 18 Apr 2022 11:59:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=8B=86=E5=88=86=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E9=94=99=E8=AF=AF=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/SplitImport/index.vue | 7 ++- jero-web/src/components/SplitUpload/index.vue | 15 +++++-- .../splitting/modules/SplitAddForm.vue | 43 +++++++++++++------ .../splitting/modules/SplitDetail.vue | 2 +- 4 files changed, 46 insertions(+), 21 deletions(-) diff --git a/jero-web/src/components/SplitImport/index.vue b/jero-web/src/components/SplitImport/index.vue index d6b4d3362..0f2bee594 100644 --- a/jero-web/src/components/SplitImport/index.vue +++ b/jero-web/src/components/SplitImport/index.vue @@ -61,7 +61,8 @@ cut:'', preErrVisible:false, errValue:'', - errValues:[] + errValues:[], + menuIdValue:'' } }, computed:{ @@ -69,6 +70,8 @@ watch:{ menuId(val1,val2){ // console.log('val1111',val1,val2) + this.menuId=val1 + this.uploadData.menuId=val1 } }, created(){ @@ -88,7 +91,7 @@ } this.uploadData.menuId=this.menuId this.uploadData.infoId=this.infoId - + // console.log('menuIddddd',this.menuId) // console.log('uplod',this.uploadAction,this.uploadData) // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); }, diff --git a/jero-web/src/components/SplitUpload/index.vue b/jero-web/src/components/SplitUpload/index.vue index 0aad273d1..1001f2d67 100644 --- a/jero-web/src/components/SplitUpload/index.vue +++ b/jero-web/src/components/SplitUpload/index.vue @@ -44,6 +44,8 @@ headers:'', previewImage:{}, // accept:'image/*' + uploadFileFlag:0, + } }, created() { @@ -81,6 +83,7 @@ this.fileTypeSatus = false }else{ // let thisFileType = this.thisFileType.replace(/\s+/g, ""); + this.uploadFileFlag++ this.fileTypeSatus = true this.$message.destroy() // 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量! @@ -111,10 +114,12 @@ return } else { if (status === 'error') { + this.uploadFileFlag-- this.$emit('uploadSuccess', this.fileList) this.$message.destroy() this.$message.error(`${info.file.name} `+this.$t('fileUploadFailed')) } else if (status === 'removed') { + this.uploadFileFlag-- this.myfileList = info.fileList this.fileList = [] this.myfileList.forEach((res) => { @@ -124,12 +129,13 @@ this.fileList.push(res) } }) - this.$emit('uploadSuccess', this.fileList,fileList) + this.$emit('uploadSuccess', this.fileList,fileList,this.uploadFileFlag) if (this.myfileList.length > 0) { this.$message.destroy() this.$message.success(`${info.file.name} `+this.$t('deletedSuccessfully')) } } else if (status === 'done') { + this.uploadFileFlag-- this.fileList = [] this.myfileList = info.fileList if (info.fileList.length > 20) { @@ -142,7 +148,7 @@ this.fileList.push(res) } }) - this.$emit('uploadSuccess', this.fileList,fileList) + this.$emit('uploadSuccess', this.fileList,fileList,this.uploadFileFlag) this.$message.destroy() this.$message.error('最多只能上传二十个') return @@ -154,14 +160,15 @@ this.fileList.push(res) } }) - // console.log('file111111',this.fileList,fileList) - this.$emit('uploadSuccess', this.fileList,fileList) + console.log('file111111',this.fileList,fileList,file,this.uploadFileFlag) + this.$emit('uploadSuccess',file, this.fileList,fileList,this.uploadFileFlag) // console.log('uplossss',this.fileList,fileList) if (this.myfileList.length > 0) { this.$message.destroy() this.$message.success(`${info.file.name} `+this.$t('uploadSuccessful')) } } else if (status === 'uploading') { + // this.uploadFileFlag++ this.myfileList = info.fileList // this.$message.success(`${info.file.name} 文件上传成功。`); } diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue index 89fafe0ae..4b1023f95 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue @@ -804,24 +804,39 @@ }, //上传文件 - uploadSuccess1(data,imgs) { - // console.log('dataimg',data,imgs) - let lengthImg=imgs.length + uploadSuccess1(file,data,imgs,uploadFileFlag) { + console.log('dataimg',file,data,imgs,uploadFileFlag) + for(let i = this.contentList.length;i>this.addIndex;i--){ - this.contentList[i+lengthImg-1]=this.contentList[i-1] + this.contentList[i]=this.contentList[i-1] } - if(imgs && imgs.length > 0){ - imgs.forEach(item => { - this.contentList[++this.addIndex]={ - id:'', - type:'IMG', - itemContent:item.response.result.id, - thumbUrl:item.thumbUrl - } - }) + this.contentList[++this.addIndex]={ + id:'', + type:'IMG', + itemContent:file.response.result.id, + thumbUrl:file.thumbUrl } + + // let lengthImg=imgs.length + // for(let i = this.contentList.length;i>this.addIndex;i--){ + // this.contentList[i+lengthImg-1]=this.contentList[i-1] + // } + // + // if(imgs && imgs.length > 0){ + // imgs.forEach(item => { + // this.contentList[++this.addIndex]={ + // id:'', + // type:'IMG', + // itemContent:item.response.result.id, + // thumbUrl:item.thumbUrl + // } + // }) + // } // this.$refs.uploadFile2.visible=false - this.splitVisible=false + if(uploadFileFlag==0){ + this.splitVisible=false + } + console.log('conteend',data,this.contentList) }, //点击图片预览 diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue b/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue index d0a803c6c..f43dcd7a2 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue @@ -897,7 +897,7 @@ this.selectClear() // eventBUs.$emit('searchReset') }else{ - this.$message.warning(this.$t('operationFailed')) + this.$message.warning(res.data.message) } }) .catch( (error) =>{