|
|
@@ -165,13 +165,15 @@ export default {
|
|
|
})
|
|
|
this.$api.resource.fileSave(this.params).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- console.log(typeof res.data)
|
|
|
if (res.msg.indexOf('存在重名文件,是否覆盖') === -1) {
|
|
|
this.saveLibrary()
|
|
|
this.$message.success('文件上传完成')
|
|
|
this.$emit('on-success', this.resultList)
|
|
|
+ this.sendNotice(this.params.map(ele => ele.fileId).join(','))
|
|
|
setTimeout(() => {
|
|
|
this.drawer = false
|
|
|
+ this.resultList.length = 0
|
|
|
+ this.fileList.length = 0
|
|
|
}, 3000)
|
|
|
} else {
|
|
|
// 重名
|
|
|
@@ -188,13 +190,33 @@ export default {
|
|
|
this.saveLibrary()
|
|
|
this.$message.success('文件上传完成')
|
|
|
this.$emit('on-success', this.resultList)
|
|
|
+ this.sendNotice(this.params.map(ele => ele.fileId).join(','))
|
|
|
setTimeout(() => {
|
|
|
this.drawer = false
|
|
|
+ this.resultList.length = 0
|
|
|
+ this.fileList.length = 0
|
|
|
}, 3000)
|
|
|
} else {
|
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ sendNotice(ids) {
|
|
|
+ this.$confirm('文件已经上传完成,是否向对方发送通知?', '', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消'
|
|
|
+ }).then(res => {
|
|
|
+ if (res === 'confirm') {
|
|
|
+ this.$api.resource
|
|
|
+ .send({ ids, projectId: this.projectId })
|
|
|
+ .then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ console.log(res)
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|