|
|
@@ -189,10 +189,10 @@ export default { |
|
|
this.showUploadErr = false; |
|
|
this.showUploadErr = false; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
checkFiles(file) { |
|
|
|
|
|
|
|
|
checkFiles(file, countStay) { |
|
|
const fileList = this.dropzoneHandler.getAcceptedFiles(); |
|
|
const fileList = this.dropzoneHandler.getAcceptedFiles(); |
|
|
const filesSize = fileList.reduce((acc, item, index) => acc + item.size, 0) + (file ? file.size : 0); |
|
|
const filesSize = fileList.reduce((acc, item, index) => acc + item.size, 0) + (file ? file.size : 0); |
|
|
const filesCount = fileList.length + (file ? 1 : 0); |
|
|
|
|
|
|
|
|
const filesCount = fileList.length + (file && !countStay ? 1 : 0); |
|
|
const allfilesSize = filesSize + this.state.size; |
|
|
const allfilesSize = filesSize + this.state.size; |
|
|
if (file && filesCount > maxFileSize) { |
|
|
if (file && filesCount > maxFileSize) { |
|
|
this.dropzoneHandler.removeFile(file); |
|
|
this.dropzoneHandler.removeFile(file); |
|
|
@@ -494,7 +494,7 @@ export default { |
|
|
const fileList = this.dropzoneHandler.getAcceptedFiles(); |
|
|
const fileList = this.dropzoneHandler.getAcceptedFiles(); |
|
|
if (!fileList.length) return; |
|
|
if (!fileList.length) return; |
|
|
for (let i = 0, iLen = fileList.length; i < iLen; i++) { |
|
|
for (let i = 0, iLen = fileList.length; i < iLen; i++) { |
|
|
if (!this.checkFiles(fileList[i])) return; |
|
|
|
|
|
|
|
|
if (!this.checkFiles(fileList[i], true)) return; |
|
|
} |
|
|
} |
|
|
this.resetFileStatus(); |
|
|
this.resetFileStatus(); |
|
|
this.uploadFiles = fileList; |
|
|
this.uploadFiles = fileList; |
|
|
|