优化批次下载逻辑,通过API获取所有数据以提升数据获取效率,简化错误提示信息
This commit is contained in:
@@ -1045,13 +1045,17 @@ const downloadCurrentBatch = async () => {
|
|||||||
try {
|
try {
|
||||||
batchDownloadDialog.downloading = true
|
batchDownloadDialog.downloading = true
|
||||||
|
|
||||||
// 根据批次ID筛选当前批次的数据
|
// 通过API获取该批次的所有数据(不受分页限制)
|
||||||
const currentBatchData = linkList.value.filter(item =>
|
const response = await fetchLinks({
|
||||||
item.batchId === batchDownloadDialog.batchId
|
batchId: batchDownloadDialog.batchId,
|
||||||
)
|
page: 1,
|
||||||
|
pageSize: 1000 // 设置一个足够大的值以获取所有数据
|
||||||
|
})
|
||||||
|
|
||||||
|
const currentBatchData = response.data.items || []
|
||||||
|
|
||||||
if (currentBatchData.length === 0) {
|
if (currentBatchData.length === 0) {
|
||||||
ElMessage.warning('未找到当前批次的数据,请刷新列表后重试')
|
ElMessage.warning('未找到当前批次的数据,请重试')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user