@lowcodex/gen-data-processing
v0.1.0
Published
报表数据加工引擎(迁移自 platform-sheet data-processing):树形/明细数据按布局类型展开为 gen-sheet 行列结构,headless 纯 JS
Maintainers
Readme
@lowcodex/gen-data-processing
报表数据加工引擎,迁移自 platform-sheet @platform/data-processing 0.1.0。headless 纯 JS:把树形层级/明细数据按区域配置与布局类型展开为 @lowcodex/gen-sheet 的行列结构(公式修复、合并单元格、插入行挤占、数据校验、阈值隐藏列)。
使用
import DataProcessing from '@lowcodex/gen-data-processing';
const processing = new DataProcessing({treeData, display, config, sheets, sheetData});
const excelData = processing.getExcelData(); // → 交给 gen-sheet init/loadData布局类型:level-v(纵向层级)/ level-nv(纵向多层级)/ level-hv(横纵交叉)/ level-gh(分组横向)/ detail-v / detail-h(纵/横明细)/ static(固定行),由 ToList/ 各子类实现,多份配置可合并为多工作表。
与原包的差异(均为主动决策)
- 依赖
@platform/spread-sheet-min→@lowcodex/gen-sheet(peer,6 个 API:helper/DataProxy/CellRange/Validator/alphabet/infixExprToSuffixExpr); - 交互事件层(Event/ 与
initEvent)整体移除——包只保留纯数据加工; - 引擎判空修复:
getCellConfig对无 KEY 单元格不再崩溃(原版遗留缺陷,随 Event 层移除该修复只保留在历史记录中)。
原生产消费方(platform-sheet 的 report-view / ad-hoc-queries)迁移时按上述差异适配。
构建
pnpm build:rolldown 双产物(lib/esm),类型为手写 index.d.ts(历史 JS 不跑 dts)。
