|
|
@@ -7,12 +7,16 @@ |
|
|
|
<div id="dataset" class="dropzone"> |
|
|
|
<div class="maxfilesize ui red message" style="display: none;margin: 2.5rem;"></div> |
|
|
|
</div> |
|
|
|
<p class="upload-info"> |
|
|
|
<!-- <p class="upload-info"> |
|
|
|
{{ file_status_text }} |
|
|
|
<strong class="success text red">{{ status }}</strong> |
|
|
|
</p> |
|
|
|
</p> --> |
|
|
|
<el-button style="background-color: #21ba45;" type="success" :disabled="btnFlag" @click="startUpload">{{upload}}</el-button> |
|
|
|
<el-button type="info" @click="cancelDataset">{{cancel}}</el-button> |
|
|
|
<div v-for="item in allUploadFiles" style="display:flex;" > |
|
|
|
<span style="flex:1">{{item.name}}</span> |
|
|
|
<span style="flex:1">{{item.status}}</span> |
|
|
|
</div> |
|
|
|
<!-- <p>说明:<br> |
|
|
|
- 只有zip格式的数据集才能发起云脑任务;<br> |
|
|
|
- 云脑1提供 <span class="text blue">CPU / GPU</span> 资源,云脑2提供 <span class="text blue">Ascend NPU</span> 资源;调试使用的数据集也需要上传到对应的环境。</p> --> |
|
|
@@ -60,6 +64,9 @@ export default { |
|
|
|
upload:'', |
|
|
|
uploadFiles:[], |
|
|
|
uploadFilesAddId:[], |
|
|
|
allUploadFiles:[], |
|
|
|
uploadLength:0, |
|
|
|
allUploadLength:0, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@@ -175,6 +182,17 @@ export default { |
|
|
|
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 |
|
|
|
}, 2000); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
startUpload(){ |
|
|
|
// console.log(this.dropzoneUploader) |
|
|
@@ -187,10 +205,12 @@ export default { |
|
|
|
// if (myDropzone.getAcceptedFiles().length !== 0) { |
|
|
|
// myDropzone.processQueue(); |
|
|
|
// } |
|
|
|
$('.dz-remove').remove() |
|
|
|
$('.maxfilesize.ui.red.message').css('display','none') |
|
|
|
this.btnFlag = true |
|
|
|
this.uploadFiles = this.dropzoneUploader.getQueuedFiles() |
|
|
|
console.log(this.uploadFiles) |
|
|
|
console.log(this.uploadFiles,this.uploadFiles.length) |
|
|
|
|
|
|
|
// this.uploadFilesAddId = this.uploadFiles.map((item)=>{ |
|
|
|
// console.log(item) |
|
|
|
// return item.datasetId = document |
|
|
@@ -278,6 +298,11 @@ export default { |
|
|
|
file.previewTemplate.querySelector( |
|
|
|
'.dz-progress' |
|
|
|
).style.opacity = 0 |
|
|
|
if(this.uploadLength === this.uploadFiles.length){ |
|
|
|
setTimeout(() => { |
|
|
|
window.location.href = this.repoPath |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
computeMD5(file) { |
|
|
@@ -380,6 +405,8 @@ export default { |
|
|
|
console.log(info); |
|
|
|
// window.location.reload(); |
|
|
|
this.uploadError(file,info) |
|
|
|
this.allUploadLength++ |
|
|
|
this.allUploadFiles.push({name:file.name,status:1,info:info}) |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('文件已上传完成'); |
|
|
@@ -615,6 +642,9 @@ export default { |
|
|
|
file.size |
|
|
|
} 用时:${(new Date().getTime() - time) / 1000} s` |
|
|
|
); |
|
|
|
this.uploadLength++ |
|
|
|
this.allUploadLength++ |
|
|
|
this.allUploadFiles.push({name:file.name,status:0,info:''}) |
|
|
|
this.updateProgress(file, 100); |
|
|
|
this.progress = 100; |
|
|
|
this.status = this.dropzoneParams.data('upload-complete'); |
|
|
|