bug 67631

This commit is contained in:
zyx.net
2023-03-30 13:40:59 +08:00
parent 3fba993dd5
commit ecebc183da
4 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -103,7 +103,7 @@
const isLt2KB = file.size / 1024 /1024 < this.size
let name = file.name
if (!isLt2KB) {
this.$message.error(name + this.$t('uploadedfilelarger'))
this.$message.error(name + this.$t('uploadedfilelarger') + this.size + 'M')
return false
}
}
+10 -1
View File
@@ -34,7 +34,7 @@
export default {
name: 'file',
props: ['disableds', 'disabled','acceptcode', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads', 'Uploadable'],
props: ['disableds', 'disabled','acceptcode', 'thisFileUploadUrl','size', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads', 'Uploadable'],
data() {
return {
visible: false,
@@ -98,6 +98,15 @@
return false
}
}
// 根据大小拦截
if(this.size){
const isLt2KB = file.size / 1024 /1024 < this.size
let name = file.name
if (!isLt2KB) {
this.$message.error(name + this.$t('uploadedfilelarger') + this.size + 'M')
return false
}
}
if (this.isMultiple) {
if ((this.myfileList && this.myfileList.length == 1) || this.myfileList && this.myfileList.length > 1) {
this.$message.warning(this.$t('onlyOnefileUploaded'))