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