Files
eip4-platform/scripts/master-detail-rollup-acceptance.sh
zhengwr ba8177e9d4 feat(主子表): 父级汇总(总额=子表金额之和) compute-on-save + SUM 实时预览
主表列 = SUM/COUNT/AVG/MIN/MAX(子表某列)。服务端权威:行级派生(__derive)之后再聚合
(?__rollup=主列=AGG:LIST:子列),把子表列聚合写回主 map → 引擎落库;主表单该列只读
static + ${SUM(ARRAYMAP(DETAILS, item => <派生公式或子列>))} 实时预览。

- RecipeDerivedFieldComputer.enrichRollup: 子表列聚合(空集 SUM/COUNT=0,MIN/MAX/AVG 跳过)
- PageBlueprintChild.RollupColumn + 编译器 masterDetailFormControls(汇总列→static SUM 预览,
  被聚合子列若派生则用其公式 item 前缀)+ masterDetailFormApi 拼 __derive&__rollup
- RecipePageComposer/DesignFeatureController 贯通 childRollup(Object 容错;主列须主表真实列、
  子列须子表真实列、agg 白名单 SUM/COUNT/AVG/MIN/MAX)
- FlowController.executePost 接 __rollup(在 __derive 之后,使派生列已算好)

+5 单测,curl live e2e(TOTAL=SUM(明细金额)=55,服务端先逐行派生再聚合)PASS,Playwright 3/3。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 17:55:49 +08:00

5.3 KiB