文档拆分--查看--图片上传
This commit is contained in:
@@ -79,6 +79,12 @@ export default {
|
||||
const fileNowTypes = file.type.split('/')
|
||||
fileFlag = (fileTypes[0] === fileNowTypes[0])
|
||||
// console.log('filetype',fileFlag)
|
||||
const fileSize = file.size // 上传的文件大小
|
||||
if (fileSize > 1024 * 1024 * 500) {
|
||||
this.$message.warning(this.$t('uploadFile.maxSize'))
|
||||
this.fileTypeSatus = false
|
||||
return false
|
||||
}
|
||||
if (!fileFlag) {
|
||||
this.$message.warning(this.$t('文件格式不正确,请上传图片格式文件'))
|
||||
this.fileTypeSatus = false
|
||||
@@ -87,11 +93,10 @@ export default {
|
||||
if (this.uploadFileFlag < 20) {
|
||||
this.uploadFileFlag++
|
||||
}
|
||||
|
||||
this.fileTypeSatus = true
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + '文件大小超出1000MB限制, 请压缩或降低文件质量!'
|
||||
this.errorMessage = file.name + '文件大小超出500MB限制, 请压缩或降低文件质量!'
|
||||
}
|
||||
},
|
||||
remove () {
|
||||
@@ -107,7 +112,7 @@ export default {
|
||||
}
|
||||
})
|
||||
if (this.fileTypeSatus) {
|
||||
if (file.size > 1000000000) {
|
||||
if (file.size > 500000000) {
|
||||
this.$message.warning(this.errorMessage)
|
||||
} else {
|
||||
if (status === 'error') {
|
||||
|
||||
Reference in New Issue
Block a user