fix: 修复下载文件夹提示所选文件夹为空的问题 #89
This commit is contained in:
parent
50283383a4
commit
65ac8ce0d0
@ -3846,42 +3846,19 @@ export default {
|
||||
this.rowContextData.isShare = true;
|
||||
},
|
||||
downloadFile() {
|
||||
let totalSize = 0;
|
||||
let fileIds = [];
|
||||
if (this.$refs.fileListTable.tableSelectData.length > 0) {
|
||||
this.$refs.fileListTable.tableSelectData.forEach(item => {
|
||||
totalSize += item.size;
|
||||
this.$refs.fileListTable.tableSelectData.forEach(value => {
|
||||
fileIds.push(value.id);
|
||||
});
|
||||
} else {
|
||||
totalSize += this.rowContextData.size;
|
||||
fileIds.push(this.rowContextData.id);
|
||||
}
|
||||
if (totalSize > 0) {
|
||||
let fileIds = [];
|
||||
if (this.$refs.fileListTable.tableSelectData.length > 0) {
|
||||
this.$refs.fileListTable.tableSelectData.forEach(value => {
|
||||
fileIds.push(value.id);
|
||||
});
|
||||
} else {
|
||||
fileIds.push(this.rowContextData.id);
|
||||
}
|
||||
if (fileIds.length > 1 || this.rowContextData.isFolder) {
|
||||
fileConfig.packageDownload(
|
||||
fileIds,
|
||||
this.$store.state.user.token,
|
||||
this.$store.state.user.name
|
||||
);
|
||||
return;
|
||||
}
|
||||
fileConfig.download(
|
||||
this.$store.state.user.name,
|
||||
this.rowContextData,
|
||||
this.$store.getters.token
|
||||
);
|
||||
} else {
|
||||
this.$message({
|
||||
message: "所选文件为空",
|
||||
type: "warning"
|
||||
});
|
||||
if (fileIds.length > 1 || this.rowContextData.isFolder) {
|
||||
fileConfig.packageDownload(fileIds,this.$store.state.user.token,this.$store.state.user.name)
|
||||
return;
|
||||
}
|
||||
fileConfig.download(this.$store.state.user.name,this.rowContextData,this.$store.getters.token)
|
||||
},
|
||||
// 复制下载链接
|
||||
copyDownloadLink(row) {
|
||||
|
||||
@ -611,34 +611,19 @@ export default {
|
||||
}
|
||||
},
|
||||
downloadFile() {
|
||||
let totalSize = 0
|
||||
let fileIds = [];
|
||||
if (this.selectRowData.length > 0) {
|
||||
this.selectRowData.forEach(item => {
|
||||
totalSize += item.size
|
||||
this.selectRowData.forEach(value => {
|
||||
fileIds.push(value.id)
|
||||
})
|
||||
} else {
|
||||
totalSize += this.rowContextData.size
|
||||
fileIds.push(this.rowContextData.id)
|
||||
}
|
||||
if (totalSize > 0) {
|
||||
let fileIds = [];
|
||||
if (this.selectRowData.length > 0) {
|
||||
this.selectRowData.forEach(value => {
|
||||
fileIds.push(value.id)
|
||||
})
|
||||
} else {
|
||||
fileIds.push(this.rowContextData.id)
|
||||
}
|
||||
if (fileIds.length > 1 || this.rowContextData.isFolder) {
|
||||
fileConfig.packageDownload(fileIds, this.$store.state.user.token, this.$store.state.user.name)
|
||||
return
|
||||
}
|
||||
fileConfig.download(this.$store.state.user.name, this.rowContextData, this.$store.state.user.token)
|
||||
} else {
|
||||
this.$message({
|
||||
message: '所选文件夹为空',
|
||||
type: 'warning'
|
||||
});
|
||||
if (fileIds.length > 1 || this.rowContextData.isFolder) {
|
||||
fileConfig.packageDownload(fileIds, this.$store.state.user.token, this.$store.state.user.name)
|
||||
return
|
||||
}
|
||||
fileConfig.download(this.$store.state.user.name, this.rowContextData, this.$store.state.user.token)
|
||||
},
|
||||
// 复制下载链接
|
||||
copyDownloadLink(row) {
|
||||
|
||||
@ -1000,45 +1000,30 @@ export default {
|
||||
this.selectTreeNode.showName = ' "' + row.name + '"'
|
||||
},
|
||||
downloadFile(copy) {
|
||||
let totalSize = 0
|
||||
if (this.indexList.length > 0) {
|
||||
this.selectRowData.forEach(item => {
|
||||
totalSize += item.size
|
||||
let fileIds = [];
|
||||
if (this.menusIsMultiple) {
|
||||
this.selectRowData.forEach(value => {
|
||||
fileIds.push(value.id)
|
||||
})
|
||||
} else {
|
||||
totalSize = this.rowContextData.size
|
||||
fileIds.push(this.rowContextData.id)
|
||||
}
|
||||
if (totalSize > 0) {
|
||||
let fileIds = [];
|
||||
if (this.menusIsMultiple) {
|
||||
this.selectRowData.forEach(value => {
|
||||
fileIds.push(value.id)
|
||||
})
|
||||
} else {
|
||||
fileIds.push(this.rowContextData.id)
|
||||
}
|
||||
if (fileIds.length > 1 || this.rowContextData.isFolder) {
|
||||
if (copy) {
|
||||
this.copyDownloadLink(fileConfig.publicPackageDownloadUrl(this.shareId, fileIds, this.$store.getters.shareToken))
|
||||
} else {
|
||||
fileConfig.publicPackageDownload(this.shareId, fileIds, this.$store.getters.shareToken)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (fileIds.length > 1 || this.rowContextData.isFolder) {
|
||||
if (copy) {
|
||||
if (this.rowContextData.isShare) {
|
||||
this.copyDownloadLink(window.location.origin + fileConfig.previewUrl(this.sharer.username, this.rowContextData, undefined, this.$store.getters.shareToken))
|
||||
} else {
|
||||
this.copyDownloadLink(fileConfig.publicPackageDownloadUrl(this.shareId, fileIds, this.$store.getters.shareToken))
|
||||
}
|
||||
this.copyDownloadLink(fileConfig.publicPackageDownloadUrl(this.shareId, fileIds, this.$store.getters.shareToken))
|
||||
} else {
|
||||
fileConfig.publicDownload(this.shareId, this.rowContextData, this.$store.getters.shareToken)
|
||||
fileConfig.publicPackageDownload(this.shareId, fileIds, this.$store.getters.shareToken)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (copy) {
|
||||
if (this.rowContextData.isShare) {
|
||||
this.copyDownloadLink(window.location.origin + fileConfig.previewUrl(this.sharer.username, this.rowContextData, undefined, this.$store.getters.shareToken))
|
||||
} else {
|
||||
this.copyDownloadLink(fileConfig.publicPackageDownloadUrl(this.shareId, fileIds, this.$store.getters.shareToken))
|
||||
}
|
||||
} else {
|
||||
this.$message({
|
||||
message: '所选文件为空',
|
||||
type: 'warning'
|
||||
});
|
||||
fileConfig.publicDownload(this.shareId, this.rowContextData, this.$store.getters.shareToken)
|
||||
}
|
||||
},
|
||||
// 复制下载链接
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user