Browse Source

fix issue

tags/v1.22.4.2^2
zhoupzh 3 years ago
parent
commit
260232e417
1 changed files with 19 additions and 4 deletions
  1. +19
    -4
      web_src/js/components/MinioUploader.vue

+ 19
- 4
web_src/js/components/MinioUploader.vue View File

@@ -8,7 +8,7 @@
{{ file_status_text }} {{ file_status_text }}
<strong class="success text red">{{ status }}</strong> <strong class="success text red">{{ status }}</strong>
</p> </p>
<el-button style="background-color: #21ba45;" type="success" :disabled="btnFlag" @click="onFileAdded">{{upload}}</el-button>
<el-button style="background-color: #21ba45;" type="success" :disabled="btnFlag" @click="startUpload">{{upload}}</el-button>
<el-button type="info" @click="cancelDataset">{{cancel}}</el-button> <el-button type="info" @click="cancelDataset">{{cancel}}</el-button>
<!-- <p>说明:<br> <!-- <p>说明:<br>
- 只有zip格式的数据集才能发起云脑任务;<br> - 只有zip格式的数据集才能发起云脑任务;<br>
@@ -42,7 +42,7 @@ export default {
data() { data() {
return { return {
dropzoneUploader: null, dropzoneUploader: null,
maxFiles: 1,
maxFiles: 10,
maxFilesize: 1 * 1024 * 1024 * 1024 * 1024, maxFilesize: 1 * 1024 * 1024 * 1024 * 1024,
acceptedFiles: '*/*', acceptedFiles: '*/*',
progress: 0, progress: 0,
@@ -106,15 +106,18 @@ export default {
url: '/todouploader', url: '/todouploader',
maxFiles: this.maxFiles, maxFiles: this.maxFiles,
maxFilesize: this.maxFileSize, maxFilesize: this.maxFileSize,
parallelUploads: this.maxFiles,
timeout: 0, timeout: 0,
autoQueue: false,
// autoQueue: false,
autoProcessQueue: false, //自动上传
dictDefaultMessage: this.dropzoneParams.data('default-message'), dictDefaultMessage: this.dropzoneParams.data('default-message'),
dictInvalidFileType: this.dropzoneParams.data('invalid-input-type'), dictInvalidFileType: this.dropzoneParams.data('invalid-input-type'),
dictFileTooBig: this.dropzoneParams.data('file-too-big'), dictFileTooBig: this.dropzoneParams.data('file-too-big'),
dictRemoveFile: this.dropzoneParams.data('remove-file'), dictRemoveFile: this.dropzoneParams.data('remove-file'),
previewTemplate
// previewTemplate
}); });
dropzoneUploader.on('addedfile', (file) => { dropzoneUploader.on('addedfile', (file) => {
console.log(file)
this.file = file this.file = file
}); });
dropzoneUploader.on('maxfilesexceeded', function (file) { dropzoneUploader.on('maxfilesexceeded', function (file) {
@@ -130,6 +133,18 @@ export default {
this.dropzoneUploader = dropzoneUploader; this.dropzoneUploader = dropzoneUploader;
}, },
methods: { methods: {
startUpload(){
console.log(this.dropzoneUploader)
console.log(this.dropzoneUploader.getQueuedFiles())
for (let i = 0; i < this.dropzoneUploader.getAcceptedFiles().length; i++) {
console.log(i)
this.dropzoneUploader.processFile(myDropzone.getAcceptedFiles()[i]);

}
if (myDropzone.getAcceptedFiles().length !== 0) {
myDropzone.processQueue();
}
},
cancelDataset(){ cancelDataset(){
location.href = this.repoPath location.href = this.repoPath
this.dropzoneUploader.removeAllFiles(true) this.dropzoneUploader.removeAllFiles(true)


Loading…
Cancel
Save