iter(g88): 数据表支持导出 CSV

This commit is contained in:
HIsheR
2026-10-26 13:08:25 +08:00
parent fa07101f76
commit 9a7c46a3c6
12 changed files with 110 additions and 8 deletions
@@ -1,5 +1,6 @@
import type {
Action,
DeriveContext,
RowModel,
TableInstance,
TablePlugin,
@@ -32,7 +33,8 @@ export function paginationPlugin<T = unknown>(): TablePlugin<T> {
return state;
}
},
derive(model: RowModel<T>, state: TableState): RowModel<T> {
derive(model: RowModel<T>, state: TableState, ctx: DeriveContext<T>): RowModel<T> {
if (ctx.paged === false) return model; // 不分页:原样放行上游模型(导出全量行)
if (model === lastInput && state.pagination === lastPage && cached) return cached;
const { page, pageSize } = state.pagination;
const totalPages = Math.max(1, Math.ceil(model.total / pageSize));