feat(blueprint): master-detail recipe 接入 registry/composer + YAML
PageRecipeRegistry.defaults+compile switch 加 master-detail-v1。 RecipePageComposer.Spec 携带 childTable/listColumn/childAttributes (7-arg 兼容构造保留),toBlueprint 装配 PageBlueprintChild。 新增 page-recipes/master-detail-v1.yaml(镜像 maintenance/tree, gates 含 typed-page-schema/amis-schema)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
schemaVersion: 1
|
||||
recipe: master-detail-v1
|
||||
title: EIP4 master-detail page
|
||||
purpose: 主子表实体维护页,覆盖主表列表、含内联子表的新增/编辑、删除;子表为 amis input-table。
|
||||
compiler: com.eip4.platform.metadata.schema.blueprint.PageBlueprintCompiler
|
||||
requirements:
|
||||
childTable: 子表表名(普通实体 tabletype=1,含指向主表的引用列)
|
||||
listColumn: 主表 LIST 属性列名(amis input-table 的 name,如 DETAILS)
|
||||
childFields: 子表可编辑列(非空)
|
||||
amis:
|
||||
rootType: page
|
||||
body:
|
||||
type: crud
|
||||
syncLocation: false
|
||||
apiPattern: /api/flow/{tableName}_SEARCH
|
||||
headerToolbar:
|
||||
- addButton:
|
||||
label: 新增
|
||||
level: primary
|
||||
icon: fa fa-plus
|
||||
actionType: dialog
|
||||
formApiPattern: post:/api/flow/{tableName}_ADD
|
||||
child:
|
||||
type: input-table
|
||||
namePattern: "{listColumn}"
|
||||
addable: true
|
||||
removable: true
|
||||
needConfirm: false
|
||||
staticOn: ${__readonly}
|
||||
- editButton:
|
||||
label: 编辑
|
||||
level: primary
|
||||
actionType: dialog
|
||||
disabledOn: ${!selectedItems || selectedItems.length === 0}
|
||||
initApiPattern: post:/api/flow/{tableName}_LOAD
|
||||
formApiPattern: post:/api/flow/{tableName}_UPDATE
|
||||
child:
|
||||
type: input-table
|
||||
namePattern: "{listColumn}"
|
||||
- deleteButton:
|
||||
label: 删除
|
||||
level: danger
|
||||
actionType: ajax
|
||||
confirmText: 确认要删除此记录吗?
|
||||
apiPattern: /api/flow/{tableName}_DELETE
|
||||
- pagination
|
||||
footerToolbar:
|
||||
- statistics
|
||||
- pagination
|
||||
fieldMappings:
|
||||
string: input-text
|
||||
integer: input-number
|
||||
number: input-number
|
||||
date: input-date
|
||||
datetime: input-datetime
|
||||
boolean: switch
|
||||
gates:
|
||||
- page-recipe
|
||||
- typed-page-schema
|
||||
- amis-schema
|
||||
- local-smoke
|
||||
- playwright-render
|
||||
Reference in New Issue
Block a user