修复:下载时所选文件夹为空下载失败的问题
This commit is contained in:
parent
e97dbd5ac3
commit
60ebb70bc1
@ -809,15 +809,7 @@ export default {
|
|||||||
break
|
break
|
||||||
case 'download':
|
case 'download':
|
||||||
console.log('下载')
|
console.log('下载')
|
||||||
var fileIds = [];
|
this.downloadFile()
|
||||||
if (this.menusIsMultiple) {
|
|
||||||
this.selectRowData.forEach(value => {
|
|
||||||
fileIds.push(value.id)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
fileIds.push(this.rowContextData.id)
|
|
||||||
}
|
|
||||||
window.open(process.env.VUE_APP_BASE_FILE_API + 'download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self')
|
|
||||||
break
|
break
|
||||||
case 'remove':
|
case 'remove':
|
||||||
console.log('operation', '删除')
|
console.log('operation', '删除')
|
||||||
@ -826,6 +818,28 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$refs.contextShow.hideMenu()
|
this.$refs.contextShow.hideMenu()
|
||||||
},
|
},
|
||||||
|
downloadFile() {
|
||||||
|
let totalSize = 0
|
||||||
|
this.selectRowData.forEach(item => {
|
||||||
|
totalSize += item.size
|
||||||
|
})
|
||||||
|
if (totalSize > 0) {
|
||||||
|
var fileIds = [];
|
||||||
|
if (this.menusIsMultiple) {
|
||||||
|
this.selectRowData.forEach(value => {
|
||||||
|
fileIds.push(value.id)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
fileIds.push(this.rowContextData.id)
|
||||||
|
}
|
||||||
|
window.open(process.env.VUE_APP_BASE_FILE_API + 'download?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds, '_self')
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: '所选文件夹为空',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
// 收藏/取消收藏
|
// 收藏/取消收藏
|
||||||
favoriteOperating(isFavorite) {
|
favoriteOperating(isFavorite) {
|
||||||
this.selectRowData[0].isFavorite = isFavorite
|
this.selectRowData[0].isFavorite = isFavorite
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user