| @@ -122,14 +122,12 @@ export default { | |||
| file.status = 'success'; | |||
| this.dropzoneUploader.emit('success', file); | |||
| this.dropzoneUploader.emit('complete', file); | |||
| // this.finishUpload(file) | |||
| }, | |||
| emitDropzoneFailed(file) { | |||
| this.status = this.dropzoneParams.data('falied'); | |||
| file.status = 'error'; | |||
| this.dropzoneUploader.emit('error', file); | |||
| // this.dropzoneUploader.emit('complete', file); | |||
| }, | |||
| // emitDropzoneFailed(file) { | |||
| // this.status = this.dropzoneParams.data('falied'); | |||
| // file.status = 'error'; | |||
| // this.dropzoneUploader.emit('error', file); | |||
| // }, | |||
| onFileAdded(file) { | |||
| this.resetStatus(); | |||
| @@ -137,7 +135,7 @@ export default { | |||
| this.do_multi_uploader(file) | |||
| }, | |||
| // 获取key | |||
| // 获取key, uuid | |||
| get_result(){ | |||
| var res | |||
| $.ajax({ | |||
| @@ -162,13 +160,13 @@ export default { | |||
| // 断点续传 | |||
| do_multi_uploader(file){ | |||
| console.log("file = ", file) | |||
| const result = this.get_result() | |||
| const _this = this | |||
| const upload_datasetId = document | |||
| .getElementById('datasetId') | |||
| .getAttribute('datasetId'); | |||
| const obsClient = this.getObsClient() | |||
| const _this = this | |||
| var cp; | |||
| var hook; | |||
| @@ -192,6 +190,7 @@ export default { | |||
| // 文件上传成功 | |||
| if(eventType == 'completeMultipartUploadSucceed'){ | |||
| console.log("file = ", file) | |||
| $.ajax({ | |||
| url: '/attachments/add', | |||
| type: 'POST', | |||
| @@ -206,12 +205,12 @@ export default { | |||
| async: false, | |||
| success: function (data) { | |||
| _this.progress = 100; | |||
| _this.status = this.dropzoneParams.data('upload-complete'); | |||
| _this.status = _this.dropzoneParams.data('upload-complete'); | |||
| _this.emitDropzoneSuccess(file) | |||
| }, | |||
| error: function(){ | |||
| console.log("发送/attachments/add的post错误1") | |||
| _this.emitDropzoneFailed(file) | |||
| // _this.emitDropzoneFailed(file) | |||
| } | |||
| }); | |||
| @@ -254,16 +253,16 @@ export default { | |||
| async: false, | |||
| success: function (data) { | |||
| _this.progress = 100; | |||
| _this.status = this.dropzoneParams.data('upload-complete'); | |||
| _this.emitDropzoneSuccess(file) | |||
| _this.status = _this.dropzoneParams.data('upload-complete'); | |||
| // _this.emitDropzoneSuccess(file) | |||
| }, | |||
| error: function(){ | |||
| _this.emitDropzoneFailed(file) | |||
| // _this.emitDropzoneFailed(file) | |||
| console.log("发送/attachments/add的post错误2") | |||
| } | |||
| }); | |||
| }else if (eventType == 'uploadPartFailed'){ | |||
| _this.emitDropzoneFailed(file) | |||
| // _this.emitDropzoneFailed(file) | |||
| console.log("经过断点上传之后还是不能上传成功,该分段上传失败") | |||
| } | |||
| } | |||