|
|
|
@@ -26,7 +26,7 @@ import qs from 'qs'; |
|
|
|
import createDropzone from '../features/dropzone.js'; |
|
|
|
|
|
|
|
const {_AppSubUrl, _StaticUrlPrefix, csrf} = window.config; |
|
|
|
// const uploadtype = 0; |
|
|
|
const chunkSize = 1024 * 1024 * 64; |
|
|
|
|
|
|
|
export default { |
|
|
|
props:{ |
|
|
|
@@ -137,7 +137,6 @@ export default { |
|
|
|
resetStatus() { |
|
|
|
this.progress = 0; |
|
|
|
this.status = ''; |
|
|
|
console.log(this.uploadtype) |
|
|
|
}, |
|
|
|
updateProgress(file, progress) { |
|
|
|
console.log("progress---",progress) |
|
|
|
@@ -165,7 +164,6 @@ export default { |
|
|
|
.getElementById('datasetId') |
|
|
|
.getAttribute('datasetId'); |
|
|
|
this.resetStatus(); |
|
|
|
console.log(this.file,!this.file?.upload) |
|
|
|
if(!this.file?.upload){ |
|
|
|
this.btnFlag = false |
|
|
|
return |
|
|
|
@@ -186,7 +184,7 @@ export default { |
|
|
|
File.prototype.slice || |
|
|
|
File.prototype.mozSlice || |
|
|
|
File.prototype.webkitSlice, |
|
|
|
chunkSize = 1024 * 1024 * 64, |
|
|
|
//chunkSize = 1024 * 1024 * 64, |
|
|
|
chunks = Math.ceil(file.size / chunkSize), |
|
|
|
spark = new SparkMD5.ArrayBuffer(), |
|
|
|
fileReader = new FileReader(); |
|
|
|
@@ -327,7 +325,6 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
async newMultiUpload(file) { |
|
|
|
console.log(this.uploadtype,this) |
|
|
|
const res = await axios.get('/attachments/new_multipart', { |
|
|
|
params: { |
|
|
|
totalChunkCounts: file.totalChunkCounts, |
|
|
|
@@ -348,7 +345,7 @@ export default { |
|
|
|
File.prototype.slice || |
|
|
|
File.prototype.mozSlice || |
|
|
|
File.prototype.webkitSlice, |
|
|
|
chunkSize = 1024 * 1024 * 32, |
|
|
|
//chunkSize = 1024 * 1024 * 32, |
|
|
|
chunks = Math.ceil(file.size / chunkSize), |
|
|
|
fileReader = new FileReader(), |
|
|
|
time = new Date().getTime(); |
|
|
|
@@ -457,7 +454,6 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
async function completeUpload() { |
|
|
|
console.log(_this.uploadtype) |
|
|
|
return await axios.post( |
|
|
|
'/attachments/complete_multipart', |
|
|
|
qs.stringify({ |
|
|
|
@@ -494,7 +490,6 @@ export default { |
|
|
|
1}/${chunks}个分片上传` |
|
|
|
); |
|
|
|
this.progress = Math.ceil((currentChunk / chunks) * 100); |
|
|
|
console.log("((currentChunk / chunks) * 100).toFixed(2)",((currentChunk / chunks) * 100).toFixed(2)) |
|
|
|
this.updateProgress(file, ((currentChunk / chunks) * 100).toFixed(2)); |
|
|
|
this.status = `${this.dropzoneParams.data('uploading')} ${( |
|
|
|
(currentChunk / chunks) * |
|
|
|
|