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