修改上传文件的双语
This commit is contained in:
@@ -647,4 +647,8 @@ module.exports = {
|
|||||||
pleaseUploadSplitFile:'please upload split file',
|
pleaseUploadSplitFile:'please upload split file',
|
||||||
release:'release',
|
release:'release',
|
||||||
confirmRelease:'confirm Release ?',
|
confirmRelease:'confirm Release ?',
|
||||||
|
UploadMost:'You can only upload 20 at most',
|
||||||
|
FileUploadFailed:'File upload failed',
|
||||||
|
FileUploadedSuccessfully:'File uploaded successfully',
|
||||||
|
DeletedSuccessfully:'Deleted successfully',
|
||||||
}
|
}
|
||||||
+650
-646
File diff suppressed because it is too large
Load Diff
@@ -90,9 +90,6 @@
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
this.$message.destroy()
|
this.$message.destroy()
|
||||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
|
||||||
this.errorMessage = file.name + '文件大小超出100MB限制, 请压缩或降低文件质量!'
|
|
||||||
|
|
||||||
},
|
},
|
||||||
remove() {
|
remove() {
|
||||||
this.fileTypeSatus = true
|
this.fileTypeSatus = true
|
||||||
@@ -103,7 +100,6 @@
|
|||||||
},
|
},
|
||||||
handleChange(info) {
|
handleChange(info) {
|
||||||
let { file } = info
|
let { file } = info
|
||||||
console.log(file)
|
|
||||||
const status = info.file.status
|
const status = info.file.status
|
||||||
info.fileList.forEach((val, index) => {
|
info.fileList.forEach((val, index) => {
|
||||||
if (val.response && !val.response.result) {
|
if (val.response && !val.response.result) {
|
||||||
@@ -111,15 +107,10 @@
|
|||||||
info.fileList.splice(index, 1)
|
info.fileList.splice(index, 1)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (this.fileTypeSatus) {
|
|
||||||
if (file.size > 100000000) {
|
|
||||||
this.$message.error(this.errorMessage)
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
if (status === 'error') {
|
if (status === 'error') {
|
||||||
this.$emit('uploadSuccess', this.fileList)
|
this.$emit('uploadSuccess', this.fileList)
|
||||||
this.$message.destroy()
|
this.$message.destroy()
|
||||||
this.$message.error(`${info.file.name} 文件上传失败。`)
|
this.$message.error(`${info.file.name}` + this.$t('FileUploadFailed'))
|
||||||
} else if (status === 'removed') {
|
} else if (status === 'removed') {
|
||||||
this.myfileList = info.fileList
|
this.myfileList = info.fileList
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
@@ -133,7 +124,7 @@
|
|||||||
this.$emit('uploadSuccess', this.fileList)
|
this.$emit('uploadSuccess', this.fileList)
|
||||||
if (this.myfileList.length > 0) {
|
if (this.myfileList.length > 0) {
|
||||||
this.$message.destroy()
|
this.$message.destroy()
|
||||||
this.$message.success(`${info.file.name} 删除成功。`)
|
this.$message.success(`${info.file.name}` + this.$t('DeletedSuccessfully'))
|
||||||
}
|
}
|
||||||
} else if (status === 'done') {
|
} else if (status === 'done') {
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
@@ -150,7 +141,7 @@
|
|||||||
})
|
})
|
||||||
this.$emit('uploadSuccess', this.fileList)
|
this.$emit('uploadSuccess', this.fileList)
|
||||||
this.$message.destroy()
|
this.$message.destroy()
|
||||||
this.$message.error('最多只能上传二十个')
|
this.$message.error(this.$t('UploadMost'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.myfileList.forEach((res) => {
|
this.myfileList.forEach((res) => {
|
||||||
@@ -160,12 +151,11 @@
|
|||||||
this.fileList.push(res)
|
this.fileList.push(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(this.myfileList)
|
|
||||||
this.$emit('uploadSuccess', this.fileList)
|
this.$emit('uploadSuccess', this.fileList)
|
||||||
if (this.myfileList.length > 0) {
|
if (this.myfileList.length > 0) {
|
||||||
this.$message.destroy()
|
this.$message.destroy()
|
||||||
if (file.response.success) {
|
if (file.response.success) {
|
||||||
this.$message.success(`${info.file.name} 文件上传成功。`)
|
this.$message.success(`${info.file.name}` + this.$t('FileUploadedSuccessfully'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (status === 'uploading') {
|
} else if (status === 'uploading') {
|
||||||
@@ -173,9 +163,6 @@
|
|||||||
// this.$message.success(`${info.file.name} 文件上传成功。`);
|
// this.$message.success(`${info.file.name} 文件上传成功。`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.$message.warning('不支持上传该类型的文件!')
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
resetFileList() {
|
resetFileList() {
|
||||||
this.myfileList = []
|
this.myfileList = []
|
||||||
|
|||||||
Reference in New Issue
Block a user