上传成功添加消息提醒,并且自动关闭上传文件窗口
This commit is contained in:
parent
4ba7f14eea
commit
e169d74bf5
@ -156,6 +156,7 @@
|
||||
isDragStart: false,
|
||||
fileListScrollTop: 0,
|
||||
dragoverLoop: null,
|
||||
successMsg: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -340,19 +341,37 @@
|
||||
this.statusRemove(file.id)
|
||||
this.statusSet(file.id, 'success')
|
||||
// file.removeFile(file)
|
||||
this.showSuccessMsg()
|
||||
}).catch(e => {})
|
||||
|
||||
// 不需要合并
|
||||
} else {
|
||||
Bus.$emit('fileSuccess')
|
||||
// 完成后从文件列表移除
|
||||
// file.removeFile(file)
|
||||
// console.log('上传成功')
|
||||
this.showSuccessMsg()
|
||||
}
|
||||
if (file.parent == null) {
|
||||
this.close()
|
||||
}
|
||||
},
|
||||
showSuccessMsg() {
|
||||
if(this.successMsg === null){
|
||||
this.successMsg = this.$message({
|
||||
message: '文件上传成功',
|
||||
type: 'success',
|
||||
onClose: ()=>{
|
||||
this.successMsg = null
|
||||
}
|
||||
});
|
||||
}else{
|
||||
|
||||
}
|
||||
if(this.process === -10 || this.process === 100 || this.fileListLength === 0){
|
||||
this.uploader.cancel()
|
||||
this.panelShow = false
|
||||
}
|
||||
},
|
||||
onFileError(rootFile, file, response) {
|
||||
this.$message({
|
||||
message: response,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user