导入拆分位置错误修改

This commit is contained in:
caoyang
2022-04-18 11:59:46 +08:00
parent fa30daf9cf
commit a8bdba128b
4 changed files with 46 additions and 21 deletions
@@ -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);
},
+11 -4
View File
@@ -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} 文件上传成功。`);
}
@@ -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)
},
//点击图片预览
@@ -897,7 +897,7 @@
this.selectClear()
// eventBUs.$emit('searchReset')
}else{
this.$message.warning(this.$t('operationFailed'))
this.$message.warning(res.data.message)
}
})
.catch( (error) =>{