Skip to content

Commit

Permalink
fix: 修复下载数据重复 close antvis#2718
Browse files Browse the repository at this point in the history
  • Loading branch information
Harvey Wang committed May 13, 2024
1 parent 9a15144 commit f2eec0f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/s2-core/src/utils/export/copy/table-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,22 @@ class TableDataCellCopy extends BaseDataCellCopy {

row.push(dataItem as string);
}
rowIndex = j;
// 生成一行数据后,rowIndex + 1,下次 requestIdleCallback 时从下一行开始
rowIndex++;
result.push(row);
count--;
}
}

if (rowIndex === rowLength - 1) {
if (rowIndex === rowLength) {
resolve(result);
} else {
// 重置 count,避免下次 requestIdleCallback 时 count 为 0
count =
rowLength >= AsyncRenderThreshold
? AsyncRenderThreshold
: rowLength;

requestIdleCallback(dataMatrixIdleCallback);
}
};
Expand Down

0 comments on commit f2eec0f

Please sign in to comment.