|
|
|
@ -260,18 +260,19 @@ export default {
|
|
|
|
|
async afterRead(event) {
|
|
|
|
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
|
|
|
let lists = [].concat(event.file)
|
|
|
|
|
let fileListLen = this[`fileList${event.name}`].length
|
|
|
|
|
let fileListLen = this[`fileList`].length
|
|
|
|
|
lists.map((item) => {
|
|
|
|
|
this[`fileList${event.name}`].push({
|
|
|
|
|
this[`fileList`].push({
|
|
|
|
|
...item,
|
|
|
|
|
status: 'uploading',
|
|
|
|
|
message: '上传中'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
for (let i = 0; i < lists.length; i++) {
|
|
|
|
|
const result = await this.uploadFilePromise(lists[i].url)
|
|
|
|
|
let item = this[`fileList${event.name}`][fileListLen]
|
|
|
|
|
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
|
|
|
|
const result = await this.uploadFilePromise(lists[i].url, 'check')
|
|
|
|
|
console.log(result)
|
|
|
|
|
let item = this[`fileList`][fileListLen]
|
|
|
|
|
this[`fileList`].splice(fileListLen, 1, Object.assign(item, {
|
|
|
|
|
status: 'success',
|
|
|
|
|
message: '',
|
|
|
|
|
url: result
|
|
|
|
|