94分控件
This commit is contained in:
@@ -240,7 +240,9 @@ tabs / tab
|
||||
|
||||
后端因此仍然可以完整决定“这十几个字段如何拼接”,但组合关系不再污染字段定义。一个类型可以分别拥有 Edit/Create/Detail View。
|
||||
|
||||
Table View 是一等视图,而不是普通 Field Presentation 的附属标记。它负责:
|
||||
Collection View 是集合展示的一等视图。`table/list/cards` 是同一个集合契约的三个 mode,共享字段、查询、CRUD、排序与 create/edit layout;list/cards 的 title/subtitle/body/accent 也属于 `adminive.view` 语义,不允许先生成 table AMIS 再回头修改 renderer JSON。`Table_View` 继续作为 Collection View 内部的表格/查询基础契约,并保留原有 API 语义。
|
||||
|
||||
Table View 负责:
|
||||
|
||||
```text
|
||||
哪些字段成为列
|
||||
@@ -276,6 +278,8 @@ tabs / tab
|
||||
|
||||
`slot` 只是引用一个已经生成的业务组件。例如“上方配置表单 + 下方设备表格”可以由后端描述为一个 vertical composition,而不需要业务代码直接拼 AMIS `grid/card/tpl` JSON。`list` 表示显式的纵向条目集合;`frontend` 则只声明子节点及其顺序,不声明最终布局,让前端根据设备、容器或产品形态决定横排、竖排、列表、卡片或表格等视觉组织。
|
||||
|
||||
当 `frontend` 交给独立前端消费时,只给 Composition View 仍不够,因为 slot 名本身不说明组件从哪里取得。因此正式外部协议使用 `adminive.composition-manifest`:Manifest 同时包含 Composition View 和 Slot Contract registry。每个 contract 可以声明 `component_kind`、`descriptor_api`、`view_api`、`data_api`、`amis_api` 以及当前 renderer schema。后端在 Manifest 边界验证 Composition 中使用的 slot 都有唯一 contract,前端只按 View 顺序和 Contract 渲染,不维护第二份 slot/业务字段表。
|
||||
|
||||
### 5.5 后端与前端的最终边界
|
||||
|
||||
后端负责:
|
||||
@@ -286,8 +290,9 @@ tabs / tab
|
||||
单字段 presentation
|
||||
字段属于哪个视图
|
||||
字段顺序与逻辑分组
|
||||
form/table/page 的语义组合
|
||||
表格排序、搜索、筛选等后端能力
|
||||
form/collection/page 的语义组合
|
||||
collection 排序、搜索、筛选等后端能力
|
||||
slot contract 与组件来源
|
||||
```
|
||||
|
||||
前端负责:
|
||||
@@ -325,7 +330,7 @@ AMIS Adapter
|
||||
AMIS JSON
|
||||
```
|
||||
|
||||
不能反过来让 `Field_Descriptor` 直接保存任意 AMIS JSON;否则 Adminive 会从 backend-driven schema 退化成“在 C++ 里写前端 JSON”。
|
||||
不能反过来让 `Field_Descriptor` 直接保存任意 AMIS JSON;否则 Adminive 会从 backend-driven schema 退化成“在 C++ 里写前端 JSON”。AMIS 表单提交同样只能由 View 与字段权限推导 payload:readonly 字段可以出现在初始展示数据里,但 submit `api.data` 只包含当前 View 选中的 `editable`/`creatable` 字段。这里不能通过放宽 Resource Service 去兼容前端整对象回传,否则会破坏默认只读与 422 拒绝不可写字段的既有安全语义。
|
||||
|
||||
## 6. 默认只读,显式声明可写
|
||||
|
||||
@@ -919,9 +924,11 @@ schema validation
|
||||
Field Presentation 与结构事实分离
|
||||
Form View 的 frontend/group/card/grid/flow/list/tabs 组合
|
||||
Table View 的列选择与顺序
|
||||
Collection 的 table/list/cards 三种 Adapter 结果与独立 CRUD id/reload 目标
|
||||
Collection View 的 table/list/cards mode、item 语义和独立 CRUD id/reload 目标
|
||||
Form/Collection submit payload 只包含 View 中可 editable/creatable 的字段
|
||||
sortable/searchable/filterable/fixed 的后端能力约束
|
||||
Composition View 的 slot、frontend 与跨组件组合
|
||||
Composition Manifest 的 Slot Contract 完整性
|
||||
/view JSON 与 AMIS Adapter 的语义一致性
|
||||
```
|
||||
|
||||
@@ -943,6 +950,9 @@ JSON encode/decode
|
||||
Enum Adapter
|
||||
Reflection Adapter
|
||||
Object Adapter
|
||||
Value Adapter
|
||||
Control Adapter
|
||||
Polymorphic Adapter
|
||||
HTTP Adapter
|
||||
AMIS Adapter
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user