|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<el-upload
|
|
<el-upload
|
|
|
|
|
+ ref="uploadMy"
|
|
|
class="upload-demo"
|
|
class="upload-demo"
|
|
|
action="#"
|
|
action="#"
|
|
|
:on-preview="handlePreview"
|
|
:on-preview="handlePreview"
|
|
@@ -33,8 +34,11 @@ export default {
|
|
|
count:0,
|
|
count:0,
|
|
|
file: {},
|
|
file: {},
|
|
|
filelist: [],
|
|
filelist: [],
|
|
|
|
|
+ oldCount:0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
async handleRemove(file, fileList) {
|
|
async handleRemove(file, fileList) {
|
|
|
this.$emit('uploadGet')
|
|
this.$emit('uploadGet')
|
|
@@ -45,6 +49,7 @@ export default {
|
|
|
"linksids":[file.linksid]
|
|
"linksids":[file.linksid]
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ this.oldCount = this.oldCount - 1
|
|
|
this.$emit('onSuccess',res)
|
|
this.$emit('onSuccess',res)
|
|
|
},
|
|
},
|
|
|
handleProgress(file,fileList){
|
|
handleProgress(file,fileList){
|
|
@@ -58,7 +63,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleChange (file, filelist) {
|
|
handleChange (file, filelist) {
|
|
|
this.$emit('uploadGet')
|
|
this.$emit('uploadGet')
|
|
|
- this.count = 0
|
|
|
|
|
this.filelist = []
|
|
this.filelist = []
|
|
|
this.filelist = filelist
|
|
this.filelist = filelist
|
|
|
var index = file.raw.name.lastIndexOf(".");
|
|
var index = file.raw.name.lastIndexOf(".");
|
|
@@ -111,10 +115,16 @@ export default {
|
|
|
}
|
|
}
|
|
|
const res = await this.$api.requested(param)
|
|
const res = await this.$api.requested(param)
|
|
|
this.count++
|
|
this.count++
|
|
|
- if (this.count == this.filelist.length) {
|
|
|
|
|
- this.$emit('onSuccess',res)
|
|
|
|
|
|
|
+ console.log(this.count,'count')
|
|
|
|
|
+ console.log(this.filelist.length,'length')
|
|
|
|
|
+ if (this.count == this.filelist.length - this.oldCount) {
|
|
|
|
|
+ this.oldCount = this.oldCount + this.count
|
|
|
this.count = 0
|
|
this.count = 0
|
|
|
|
|
+ console.log(this.count,'count')
|
|
|
console.log('触发');
|
|
console.log('触发');
|
|
|
|
|
+ this.$refs.uploadMy.clearFiles()
|
|
|
|
|
+ this.filelist = []
|
|
|
|
|
+ this.$emit('onSuccess',res)
|
|
|
}
|
|
}
|
|
|
// if (res.code === 1) {
|
|
// if (res.code === 1) {
|
|
|
// this.$emit('onSuccess',res)
|
|
// this.$emit('onSuccess',res)
|