|
|
|
@@ -132,40 +132,35 @@ export default { |
|
|
|
$('.maxfilesize.ui.red.message').css('display','none') |
|
|
|
}) |
|
|
|
dropzoneUploader.on('maxfilesexceeded', function (file) { |
|
|
|
console.log("maxfilesexceeded") |
|
|
|
// if (this.files[0].status !== 'success') { |
|
|
|
// alert(this.dropzoneParams.data('waitting-uploading')); |
|
|
|
// this.removeFile(file); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
dropzoneUploader.removeFile(file) |
|
|
|
$('.maxfilesize.ui.red.message').text("单次最多上传10个文件,单个文件不超过200G") |
|
|
|
$('.maxfilesize.ui.red.message').css('display','block') |
|
|
|
// this.removeAllFiles(); |
|
|
|
// this.addFile(file); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
this.dropzoneUploader = dropzoneUploader; |
|
|
|
console.log(this.dropzoneUploader) |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
allUploadLength(len){ |
|
|
|
console.log(len) |
|
|
|
if(len===this.uploadFiles.length){ |
|
|
|
setTimeout(() => { |
|
|
|
this.dropzoneUploader.removeAllFiles(true) |
|
|
|
this.btnFlag = false |
|
|
|
this.$emit('setcluster',this.btnFlag) |
|
|
|
}, 2000); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
startUpload(){ |
|
|
|
this.uploadFiles = this.dropzoneUploader.getQueuedFiles() |
|
|
|
if(this.uploadFiles.length===0){ |
|
|
|
return |
|
|
|
} |
|
|
|
this.resetStatus() |
|
|
|
$('.dz-remove').remove() |
|
|
|
$('.maxfilesize.ui.red.message').css('display','none') |
|
|
|
this.btnFlag = true |
|
|
|
this.uploadFiles = this.dropzoneUploader.getQueuedFiles() |
|
|
|
this.$emit('setcluster',this.btnFlag) |
|
|
|
this.uploadFiles.forEach(element => { |
|
|
|
element.datasetId = document.getElementById('datasetId').getAttribute('datasetId') |
|
|
|
this.computeMD5(element) |
|
|
|
@@ -226,7 +221,6 @@ export default { |
|
|
|
file.previewTemplate.querySelector( |
|
|
|
'.dz-progress' |
|
|
|
).style.opacity = 0 |
|
|
|
console.log() |
|
|
|
if(this.uploadLength === this.uploadFiles.length){ |
|
|
|
setTimeout(() => { |
|
|
|
window.location.href = this.repoPath |
|
|
|
@@ -235,7 +229,6 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
computeMD5(file) { |
|
|
|
console.log("computeMD5-file:",file) |
|
|
|
const blobSlice = |
|
|
|
File.prototype.slice || |
|
|
|
File.prototype.mozSlice || |
|
|
|
@@ -269,7 +262,6 @@ export default { |
|
|
|
(currentChunk / chunks) * |
|
|
|
100 |
|
|
|
).toFixed(2)}% (${currentChunk}/${chunks})`; |
|
|
|
console.log("this.status",this.status) |
|
|
|
this.updateProgress(file, ((currentChunk / chunks) * 100).toFixed(2)); |
|
|
|
loadMd5Next(); |
|
|
|
return; |
|
|
|
@@ -580,7 +572,6 @@ export default { |
|
|
|
this.allUploadLength++ |
|
|
|
this.uploadError(file,info) |
|
|
|
this.allUploadFiles.push({name:file.name,status:2,info:info}) |
|
|
|
console.log("err",err) |
|
|
|
if(err){ |
|
|
|
return |
|
|
|
} |
|
|
|
|