fix: 修复下载文件夹提示所选文件夹为空的问题

This commit is contained in:
jmal 2024-05-11 09:11:53 +08:00
parent 50283383a4
commit 70587fdffa
3 changed files with 33 additions and 86 deletions

View File

@ -3846,15 +3846,6 @@ export default {
this.rowContextData.isShare = true; this.rowContextData.isShare = true;
}, },
downloadFile() { downloadFile() {
let totalSize = 0;
if (this.$refs.fileListTable.tableSelectData.length > 0) {
this.$refs.fileListTable.tableSelectData.forEach(item => {
totalSize += item.size;
});
} else {
totalSize += this.rowContextData.size;
}
if (totalSize > 0) {
let fileIds = []; let fileIds = [];
if (this.$refs.fileListTable.tableSelectData.length > 0) { if (this.$refs.fileListTable.tableSelectData.length > 0) {
this.$refs.fileListTable.tableSelectData.forEach(value => { this.$refs.fileListTable.tableSelectData.forEach(value => {
@ -3864,24 +3855,10 @@ export default {
fileIds.push(this.rowContextData.id); fileIds.push(this.rowContextData.id);
} }
if (fileIds.length > 1 || this.rowContextData.isFolder) { if (fileIds.length > 1 || this.rowContextData.isFolder) {
fileConfig.packageDownload( fileConfig.packageDownload(fileIds,this.$store.state.user.token,this.$store.state.user.name)
fileIds,
this.$store.state.user.token,
this.$store.state.user.name
);
return; return;
} }
fileConfig.download( fileConfig.download(this.$store.state.user.name,this.rowContextData,this.$store.getters.token)
this.$store.state.user.name,
this.rowContextData,
this.$store.getters.token
);
} else {
this.$message({
message: "所选文件为空",
type: "warning"
});
}
}, },
// 复制下载链接 // 复制下载链接
copyDownloadLink(row) { copyDownloadLink(row) {

View File

@ -611,15 +611,6 @@ export default {
} }
}, },
downloadFile() { downloadFile() {
let totalSize = 0
if (this.selectRowData.length > 0) {
this.selectRowData.forEach(item => {
totalSize += item.size
})
} else {
totalSize += this.rowContextData.size
}
if (totalSize > 0) {
let fileIds = []; let fileIds = [];
if (this.selectRowData.length > 0) { if (this.selectRowData.length > 0) {
this.selectRowData.forEach(value => { this.selectRowData.forEach(value => {
@ -633,12 +624,6 @@ export default {
return return
} }
fileConfig.download(this.$store.state.user.name, this.rowContextData, this.$store.state.user.token) fileConfig.download(this.$store.state.user.name, this.rowContextData, this.$store.state.user.token)
} else {
this.$message({
message: '所选文件夹为空',
type: 'warning'
});
}
}, },
// 复制下载链接 // 复制下载链接
copyDownloadLink(row) { copyDownloadLink(row) {

View File

@ -1000,15 +1000,6 @@ export default {
this.selectTreeNode.showName = ' "' + row.name + '"' this.selectTreeNode.showName = ' "' + row.name + '"'
}, },
downloadFile(copy) { downloadFile(copy) {
let totalSize = 0
if (this.indexList.length > 0) {
this.selectRowData.forEach(item => {
totalSize += item.size
})
} else {
totalSize = this.rowContextData.size
}
if (totalSize > 0) {
let fileIds = []; let fileIds = [];
if (this.menusIsMultiple) { if (this.menusIsMultiple) {
this.selectRowData.forEach(value => { this.selectRowData.forEach(value => {
@ -1034,12 +1025,6 @@ export default {
} else { } else {
fileConfig.publicDownload(this.shareId, this.rowContextData, this.$store.getters.shareToken) fileConfig.publicDownload(this.shareId, this.rowContextData, this.$store.getters.shareToken)
} }
} else {
this.$message({
message: '所选文件为空',
type: 'warning'
});
}
}, },
// 复制下载链接 // 复制下载链接
copyDownloadLink(url) { copyDownloadLink(url) {