@sparqjs/schema-protocol 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/condition.d.ts +10 -0
- package/dist/condition.d.ts.map +1 -0
- package/dist/condition.js +23 -0
- package/dist/condition.js.map +1 -0
- package/dist/field-options.d.ts +10 -0
- package/dist/field-options.d.ts.map +1 -0
- package/dist/field-options.js +16 -0
- package/dist/field-options.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +1678 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +20 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,1678 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 当前协议版本。正式发布前不保留旧协议兼容逻辑。
|
|
3
|
+
*/
|
|
4
|
+
export type SchemaVersion = '1.0';
|
|
5
|
+
/**
|
|
6
|
+
* 资源的基础描述信息。
|
|
7
|
+
*
|
|
8
|
+
* 这部分主要用于页面标题、调试信息和资源定位,不参与字段或布局推导。
|
|
9
|
+
*/
|
|
10
|
+
export interface ResourceDescriptor {
|
|
11
|
+
/** 资源编码,例如 customer。 */
|
|
12
|
+
name: string;
|
|
13
|
+
/** 资源展示名称。 */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** 资源说明。 */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** 资源来源,例如 playground、database、remote。 */
|
|
18
|
+
source_type?: string;
|
|
19
|
+
/** 资源归属类型,例如 app、tenant。 */
|
|
20
|
+
owner_type?: string;
|
|
21
|
+
/** 资源归属编码。 */
|
|
22
|
+
owner_code?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 后端下发给前端的资源协议载体。
|
|
26
|
+
*/
|
|
27
|
+
export interface SchemaResource {
|
|
28
|
+
/** 资源元信息。 */
|
|
29
|
+
resource?: ResourceDescriptor;
|
|
30
|
+
/** 资源字段、视图和动作协议。 */
|
|
31
|
+
schema: ResourceSchema;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 资源协议主体。
|
|
35
|
+
*
|
|
36
|
+
* fields 是前后端共享的基础字段协议。views 是前端布局协议,后端可以按 JSON 透传。
|
|
37
|
+
*/
|
|
38
|
+
export interface ResourceSchema {
|
|
39
|
+
/** 协议版本。 */
|
|
40
|
+
version: SchemaVersion;
|
|
41
|
+
/** 资源编码,应与 resource.name 保持一致。 */
|
|
42
|
+
name: string;
|
|
43
|
+
/** 资源展示名称。 */
|
|
44
|
+
title?: string;
|
|
45
|
+
/** 资源补充说明。 */
|
|
46
|
+
description?: string;
|
|
47
|
+
/** 资源记录主键字段名。缺失时 runtime 使用 id,删除、编辑、详情等动作会复用该字段取值。 */
|
|
48
|
+
primaryKey?: string;
|
|
49
|
+
/** 资源级能力开关,例如 allow_export。 */
|
|
50
|
+
capabilities?: Record<string, unknown>;
|
|
51
|
+
/** 业务状态字段和值语义配置。 */
|
|
52
|
+
state?: ResourceStateConfig;
|
|
53
|
+
/** 树形资源配置。存在该配置时,资源可使用 TreeService 管理父子结构。 */
|
|
54
|
+
tree?: ResourceTreeConfig;
|
|
55
|
+
/** 资源级索引和唯一约束契约。 */
|
|
56
|
+
constraints?: SchemaConstraints;
|
|
57
|
+
/** 资源字段定义。前端只能复用,不应写入布局语义。 */
|
|
58
|
+
fields: ResourceField[];
|
|
59
|
+
/** 前端视图配置。缺失时 runtime 可按字段能力推导默认视图。 */
|
|
60
|
+
views?: ResourceViews;
|
|
61
|
+
/** 顶层动作定义。按钮位置通过 ActionRef 引用这里的定义。 */
|
|
62
|
+
actions?: Record<string, ActionDefinition>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 资源状态语义配置。
|
|
66
|
+
*/
|
|
67
|
+
export interface ResourceStateConfig {
|
|
68
|
+
/** 保存业务状态的字段名。 */
|
|
69
|
+
field?: string;
|
|
70
|
+
/** 普通提交时使用的默认状态值。 */
|
|
71
|
+
default_value?: unknown;
|
|
72
|
+
/** 状态值到系统语义的映射,键为实际落库值。 */
|
|
73
|
+
values?: Record<string, ResourceStateValue>;
|
|
74
|
+
}
|
|
75
|
+
export type ResourceStateKind = 'draft' | 'workflow_pending' | 'workflow_rejected' | 'active' | 'inactive' | 'archived' | string;
|
|
76
|
+
/**
|
|
77
|
+
* 单个状态值的系统语义。
|
|
78
|
+
*/
|
|
79
|
+
export interface ResourceStateValue {
|
|
80
|
+
/** 系统状态语义。 */
|
|
81
|
+
kind?: ResourceStateKind;
|
|
82
|
+
/** 展示文本。 */
|
|
83
|
+
label?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* 树形资源配置。
|
|
87
|
+
*/
|
|
88
|
+
export interface ResourceTreeConfig {
|
|
89
|
+
/** 是否启用树形资源能力。 */
|
|
90
|
+
enabled?: boolean;
|
|
91
|
+
/** 父节点字段名。默认由后端约定为 parent_id。 */
|
|
92
|
+
parent_field?: string;
|
|
93
|
+
/** 同级排序字段名。 */
|
|
94
|
+
order_field?: string;
|
|
95
|
+
/** 树形模式。 */
|
|
96
|
+
mode?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 资源级约束契约。
|
|
100
|
+
*/
|
|
101
|
+
export interface SchemaConstraints {
|
|
102
|
+
/** 普通索引契约。 */
|
|
103
|
+
indexes?: SchemaIndex[];
|
|
104
|
+
/** 唯一约束契约。 */
|
|
105
|
+
uniques?: SchemaUnique[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 普通索引契约。
|
|
109
|
+
*/
|
|
110
|
+
export interface SchemaIndex {
|
|
111
|
+
/** 索引名。 */
|
|
112
|
+
name?: string;
|
|
113
|
+
/** 参与索引的字段名集合。 */
|
|
114
|
+
fields: string[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 唯一约束契约。
|
|
118
|
+
*/
|
|
119
|
+
export interface SchemaUnique {
|
|
120
|
+
/** 唯一约束名。 */
|
|
121
|
+
name?: string;
|
|
122
|
+
/** 参与唯一约束的字段名集合。 */
|
|
123
|
+
fields: string[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 树形资源节点。
|
|
127
|
+
*/
|
|
128
|
+
export interface SchemaTreeNode {
|
|
129
|
+
/** 节点主键。 */
|
|
130
|
+
id: number;
|
|
131
|
+
/** 父节点主键。 */
|
|
132
|
+
parent_id?: number;
|
|
133
|
+
/** 所属根节点主键。 */
|
|
134
|
+
root_id?: number;
|
|
135
|
+
/** 相对查询起点的深度。 */
|
|
136
|
+
depth: number;
|
|
137
|
+
/** 是否仍有直接子节点。 */
|
|
138
|
+
has_children?: boolean;
|
|
139
|
+
/** 直接子节点数量。 */
|
|
140
|
+
children_count?: number;
|
|
141
|
+
/** 从根到父节点的祖先主键路径。 */
|
|
142
|
+
ancestor_ids?: number[];
|
|
143
|
+
/** 节点业务记录。 */
|
|
144
|
+
item?: Record<string, unknown>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 嵌套树形资源节点。
|
|
148
|
+
*/
|
|
149
|
+
export interface SchemaTreeBranch extends SchemaTreeNode {
|
|
150
|
+
/** 子节点集合。 */
|
|
151
|
+
children?: SchemaTreeBranch[];
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* 树形节点列表结果。
|
|
155
|
+
*/
|
|
156
|
+
export interface SchemaTreeListResult {
|
|
157
|
+
/** 命中的树节点。 */
|
|
158
|
+
items: SchemaTreeNode[];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 嵌套树查询结果。
|
|
162
|
+
*/
|
|
163
|
+
export interface SchemaTreeResult {
|
|
164
|
+
/** 命中的树分支。 */
|
|
165
|
+
items: SchemaTreeBranch[];
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* 树形祖先路径结果。
|
|
169
|
+
*/
|
|
170
|
+
export interface SchemaTreeAncestorsResult {
|
|
171
|
+
/** 从根到当前节点的路径。 */
|
|
172
|
+
items: SchemaTreeNode[];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* 树形移动结果。
|
|
176
|
+
*/
|
|
177
|
+
export interface SchemaTreeMoveResult {
|
|
178
|
+
/** 移动后的节点。 */
|
|
179
|
+
node: SchemaTreeNode;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 树形索引重建结果。
|
|
183
|
+
*/
|
|
184
|
+
export interface SchemaTreeRebuildResult {
|
|
185
|
+
/** 资源编码。 */
|
|
186
|
+
resource: string;
|
|
187
|
+
/** 参与重建的节点数量。 */
|
|
188
|
+
count: number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* 审计记录操作人。
|
|
192
|
+
*/
|
|
193
|
+
export interface AuditActor {
|
|
194
|
+
/** 操作人主键。 */
|
|
195
|
+
id?: string | number;
|
|
196
|
+
/** 操作人展示名称。 */
|
|
197
|
+
name?: string;
|
|
198
|
+
/** 操作人头像。 */
|
|
199
|
+
avatar?: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* 审计字段变更项。
|
|
203
|
+
*/
|
|
204
|
+
export interface AuditChange {
|
|
205
|
+
/** 字段名。 */
|
|
206
|
+
field: string;
|
|
207
|
+
/** 字段展示标题。 */
|
|
208
|
+
label?: string;
|
|
209
|
+
/** 修改前的值。 */
|
|
210
|
+
before?: unknown;
|
|
211
|
+
/** 修改后的值。 */
|
|
212
|
+
after?: unknown;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* 单条审计事件。
|
|
216
|
+
*
|
|
217
|
+
* 审计是资源运行时内置能力,不需要写入 ResourceSchema;该结构只约定前后端审计接口的返回载荷。
|
|
218
|
+
*/
|
|
219
|
+
export interface AuditEntry {
|
|
220
|
+
/** 审计事件主键。 */
|
|
221
|
+
id: string | number;
|
|
222
|
+
/** 审计类型,例如 create、update、delete、restore。 */
|
|
223
|
+
type: 'create' | 'update' | 'delete' | 'restore' | string;
|
|
224
|
+
/** 审计标题。 */
|
|
225
|
+
title?: string;
|
|
226
|
+
/** 审计摘要。 */
|
|
227
|
+
summary?: string;
|
|
228
|
+
/** 操作人。 */
|
|
229
|
+
actor?: AuditActor;
|
|
230
|
+
/** 发生时间。 */
|
|
231
|
+
occurred_at: string;
|
|
232
|
+
/** 字段变更明细。 */
|
|
233
|
+
changes?: AuditChange[];
|
|
234
|
+
/** 附加信息。 */
|
|
235
|
+
metadata?: Record<string, unknown>;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* 审计列表结果。
|
|
239
|
+
*/
|
|
240
|
+
export interface AuditListResult {
|
|
241
|
+
/** 当前页审计事件。 */
|
|
242
|
+
results: AuditEntry[];
|
|
243
|
+
/** 总数。 */
|
|
244
|
+
total?: number;
|
|
245
|
+
/** 页码。 */
|
|
246
|
+
page?: number;
|
|
247
|
+
/** 每页数量。 */
|
|
248
|
+
pageSize?: number;
|
|
249
|
+
/** 是否还有更多。 */
|
|
250
|
+
hasMore?: boolean;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* 字段动态值表达式类型。
|
|
254
|
+
*/
|
|
255
|
+
export type FieldValueExpressionType = 'literal' | 'now' | 'today' | 'start_of_day' | 'end_of_day' | 'start_of_month' | 'end_of_month' | string;
|
|
256
|
+
/**
|
|
257
|
+
* 时间类动态值表达式偏移量。
|
|
258
|
+
*/
|
|
259
|
+
export interface FieldValueExpressionOffset {
|
|
260
|
+
years?: number;
|
|
261
|
+
months?: number;
|
|
262
|
+
weeks?: number;
|
|
263
|
+
days?: number;
|
|
264
|
+
hours?: number;
|
|
265
|
+
minutes?: number;
|
|
266
|
+
seconds?: number;
|
|
267
|
+
milliseconds?: number;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* 字段动态值表达式。
|
|
271
|
+
*
|
|
272
|
+
* 当前用于 default_expr 和 validation.value_expr。后端可以透传,前端只执行受支持的表达式类型。
|
|
273
|
+
*/
|
|
274
|
+
export interface FieldValueExpression {
|
|
275
|
+
/** 表达式类型,例如 now、today、literal。 */
|
|
276
|
+
type: FieldValueExpressionType;
|
|
277
|
+
/** literal 等表达式使用的静态值。 */
|
|
278
|
+
value?: unknown;
|
|
279
|
+
/** 时间类表达式的偏移量。 */
|
|
280
|
+
offset?: FieldValueExpressionOffset;
|
|
281
|
+
/** 输出格式,缺失时由字段类型推导。 */
|
|
282
|
+
format?: 'date' | 'datetime' | 'time' | 'timestamp' | string;
|
|
283
|
+
/** 时间类表达式使用的时区。第一阶段由消费端决定支持范围。 */
|
|
284
|
+
timezone?: string;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* 字段级校验规则类型。
|
|
288
|
+
*/
|
|
289
|
+
export type FieldValidationRuleType = 'required' | 'max_length' | 'min_length' | 'min' | 'max' | 'pattern' | 'format' | 'complexity' | 'range' | string;
|
|
290
|
+
/** range 校验使用的固定跨度单位。日期范围使用 day,时间范围使用 minute。 */
|
|
291
|
+
export type RangeValidationSpanUnit = 'day' | 'minute';
|
|
292
|
+
/** JSON 二元范围值的边界、顺序和最大跨度参数。 */
|
|
293
|
+
export interface RangeValidationParams {
|
|
294
|
+
/** 两个端点共同使用的最小边界。 */
|
|
295
|
+
min?: string;
|
|
296
|
+
/** 两个端点共同使用的最大边界。 */
|
|
297
|
+
max?: string;
|
|
298
|
+
/** 起点不得晚于终点;当前协议固定为 true。 */
|
|
299
|
+
ordered: true;
|
|
300
|
+
/** 允许的最大实际跨度,相同端点的跨度为 0。 */
|
|
301
|
+
max_span?: number;
|
|
302
|
+
/** 日期范围固定为 day,时间范围固定为 minute。 */
|
|
303
|
+
span_unit: RangeValidationSpanUnit;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* 字段级校验规则。
|
|
307
|
+
*
|
|
308
|
+
* value 是规则主参数,params 用于后续承载扩展参数;动态表达式后续单独扩展,不复用静态 value。
|
|
309
|
+
*/
|
|
310
|
+
export interface FieldValidationRule {
|
|
311
|
+
/** 校验规则类型。 */
|
|
312
|
+
type: FieldValidationRuleType;
|
|
313
|
+
/** 校验规则静态主参数。 */
|
|
314
|
+
value?: unknown;
|
|
315
|
+
/** 校验规则动态主参数表达式。 */
|
|
316
|
+
value_expr?: FieldValueExpression;
|
|
317
|
+
/** 命中规则时的提示信息。 */
|
|
318
|
+
message?: string;
|
|
319
|
+
/** 规则启用条件。缺失时始终启用。 */
|
|
320
|
+
when?: Condition;
|
|
321
|
+
/** 校验规则附加参数。 */
|
|
322
|
+
params?: Record<string, unknown>;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* 资源字段投影。
|
|
326
|
+
*
|
|
327
|
+
* 这是后端主要消费的共享字段协议。前端根据这些信息推导表单项、表格列、搜索项和详情展示。
|
|
328
|
+
*/
|
|
329
|
+
export interface ResourceField {
|
|
330
|
+
/** 字段投影唯一标识。 */
|
|
331
|
+
id?: number;
|
|
332
|
+
/** 所属资源主体标识。 */
|
|
333
|
+
resource_id?: number;
|
|
334
|
+
/** 来源版本标识。 */
|
|
335
|
+
version_id?: number;
|
|
336
|
+
/** 字段名,也是表单值和接口数据中的默认 key。 */
|
|
337
|
+
name: string;
|
|
338
|
+
/** 字段排序值。默认视图推导时按该值升序排列。 */
|
|
339
|
+
sort?: number;
|
|
340
|
+
/** 字段类型,例如 text、number、select、relation。 */
|
|
341
|
+
type: string;
|
|
342
|
+
/** 字段展示标题。 */
|
|
343
|
+
label: string;
|
|
344
|
+
/** 创建记录时的静态默认值。只在新增表单初始化时使用,编辑表单以记录数据为准。 */
|
|
345
|
+
default?: unknown;
|
|
346
|
+
/** 创建记录时的动态默认值表达式。静态 default 优先于 default_expr。 */
|
|
347
|
+
default_expr?: FieldValueExpression;
|
|
348
|
+
/** 字段值计算表达式。用于由其他字段、上下文或受限函数派生当前字段值。 */
|
|
349
|
+
computed_expr?: ValueExpression;
|
|
350
|
+
/** 计算触发源。缺失时消费端可从 computed_expr 依赖推导;第一阶段建议显式声明字段名。 */
|
|
351
|
+
computed_triggers?: string[];
|
|
352
|
+
/** 字段级校验规则。前端可用于基础表单校验和控件限制推导,后端仍是最终校验边界。 */
|
|
353
|
+
validation?: FieldValidationRule[];
|
|
354
|
+
/**
|
|
355
|
+
* 预留的物理列名映射。
|
|
356
|
+
*
|
|
357
|
+
* 当前阶段持久化字段默认等于 name,前端渲染、表单数据和查询条件都应使用 name。
|
|
358
|
+
* 后续接入遗留表或字段改名迁移时,该字段才可能与 name 不同。
|
|
359
|
+
*/
|
|
360
|
+
column_name?: string;
|
|
361
|
+
/** 是否持久化。 */
|
|
362
|
+
persisted?: boolean;
|
|
363
|
+
/** 是否支持多值。多选、标签、附件等字段会用到。 */
|
|
364
|
+
multiple?: boolean;
|
|
365
|
+
/** 是否必填。表单校验会复用该值。 */
|
|
366
|
+
required?: boolean;
|
|
367
|
+
/** 是否只读。表单字段默认进入只读状态。 */
|
|
368
|
+
readonly?: boolean;
|
|
369
|
+
/** 是否禁用。表单字段默认进入禁用状态。 */
|
|
370
|
+
disabled?: boolean;
|
|
371
|
+
/** 是否默认出现在列表中。 */
|
|
372
|
+
listable?: boolean;
|
|
373
|
+
/** 是否默认出现在表单中。 */
|
|
374
|
+
formable?: boolean;
|
|
375
|
+
/** 是否默认出现在搜索区域中。 */
|
|
376
|
+
searchable?: boolean;
|
|
377
|
+
/** 是否支持列表排序。 */
|
|
378
|
+
sortable?: boolean;
|
|
379
|
+
/** 字段值引用的目标资源;候选查询配置不应重复声明这些稳定语义。 */
|
|
380
|
+
reference?: FieldReferenceConfig;
|
|
381
|
+
/** 字段候选项来源和取值策略。 */
|
|
382
|
+
options?: FieldOptionsConfig;
|
|
383
|
+
/** 字段扩展信息,例如生成器、关联资源、密文字段等后端字段能力扩展。 */
|
|
384
|
+
extensions?: Record<string, unknown>;
|
|
385
|
+
/** 创建时间。 */
|
|
386
|
+
created_at?: string;
|
|
387
|
+
/** 最后更新时间。 */
|
|
388
|
+
updated_at?: string;
|
|
389
|
+
}
|
|
390
|
+
/** 字段值对另一个资源字段的稳定引用。 */
|
|
391
|
+
export interface FieldReferenceConfig {
|
|
392
|
+
/** 目标资源编码。 */
|
|
393
|
+
resource: string;
|
|
394
|
+
/** 目标资源中作为当前字段值的字段名。 */
|
|
395
|
+
value_field: string;
|
|
396
|
+
/** 目标资源中用于回显的字段名。 */
|
|
397
|
+
label_field: string;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* 资源视图集合。
|
|
401
|
+
*
|
|
402
|
+
* group 缺失表示需要时可自动推导 default;group=false 表示整类视图禁用。
|
|
403
|
+
*/
|
|
404
|
+
export interface ResourceViews {
|
|
405
|
+
/** 默认资源页简写,等价于 pages.default。 */
|
|
406
|
+
page?: false | PageView;
|
|
407
|
+
/** 资源页组合配置。 */
|
|
408
|
+
pages?: false | Record<string, PageView>;
|
|
409
|
+
/** 默认表单视图简写,等价于 forms.default。 */
|
|
410
|
+
form?: false | FormView;
|
|
411
|
+
/** 表单视图集合。 */
|
|
412
|
+
forms?: false | Record<string, false | FormView>;
|
|
413
|
+
/** 默认表格视图简写,等价于 tables.default。 */
|
|
414
|
+
table?: false | TableView;
|
|
415
|
+
/** 表格视图集合。 */
|
|
416
|
+
tables?: false | Record<string, false | TableView>;
|
|
417
|
+
/** 默认搜索视图简写,等价于 searches.default。 */
|
|
418
|
+
search?: false | SearchView;
|
|
419
|
+
/** 搜索视图集合。 */
|
|
420
|
+
searches?: false | Record<string, false | SearchView>;
|
|
421
|
+
/** 默认详情视图简写,等价于 details.default。 */
|
|
422
|
+
detail?: false | DetailView;
|
|
423
|
+
/** 详情视图集合。 */
|
|
424
|
+
details?: false | Record<string, false | DetailView>;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* 资源页组合配置。
|
|
428
|
+
*
|
|
429
|
+
* mode=page 时,runtime 根据该配置组合 search、table、form 和 detail。
|
|
430
|
+
*/
|
|
431
|
+
export interface PageView {
|
|
432
|
+
/** 使用的搜索视图名,默认可取 default。 */
|
|
433
|
+
search?: string;
|
|
434
|
+
/** 使用的表格视图名,默认可取 default。 */
|
|
435
|
+
table?: string;
|
|
436
|
+
/** 新增动作使用的表单视图名。 */
|
|
437
|
+
createForm?: string;
|
|
438
|
+
/** 编辑动作使用的表单视图名。 */
|
|
439
|
+
updateForm?: string;
|
|
440
|
+
/** 查看动作使用的详情视图名。 */
|
|
441
|
+
detail?: string;
|
|
442
|
+
/** 页面级附加属性,由 renderer 或业务适配层解释。 */
|
|
443
|
+
props?: Record<string, unknown>;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* 外层包装器类型。
|
|
447
|
+
*/
|
|
448
|
+
export type WrapperType = 'default' | 'card' | 'dialog' | 'drawer' | 'panel' | string;
|
|
449
|
+
/**
|
|
450
|
+
* 表单或详情的外层包装配置。
|
|
451
|
+
*
|
|
452
|
+
* 独立渲染时通常使用 default/card/panel;从列表动作打开时通常使用 dialog/drawer。
|
|
453
|
+
*/
|
|
454
|
+
export interface WrapperConfig {
|
|
455
|
+
/** 包装器类型。 */
|
|
456
|
+
type?: WrapperType;
|
|
457
|
+
/** 包装器属性,例如宽度、标题对齐、遮罩行为。 */
|
|
458
|
+
props?: Record<string, unknown>;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* 底部操作区配置。
|
|
462
|
+
*
|
|
463
|
+
* false 表示明确隐藏 footer;未设置时由 runtime 根据上下文生成默认按钮。
|
|
464
|
+
*/
|
|
465
|
+
export type FooterConfig = false | {
|
|
466
|
+
/** footer 容器属性。 */
|
|
467
|
+
props?: Record<string, unknown>;
|
|
468
|
+
/** 显式按钮列表。缺失时 runtime 生成 submit/reset 或 submit/cancel。 */
|
|
469
|
+
actions?: ActionRef[];
|
|
470
|
+
};
|
|
471
|
+
/**
|
|
472
|
+
* 表单打开前的数据加载方式。
|
|
473
|
+
*
|
|
474
|
+
* create 场景通常不加载数据;edit 场景默认通过 detail 接口取得完整编辑数据。
|
|
475
|
+
*/
|
|
476
|
+
export interface FormLoadConfig {
|
|
477
|
+
/** 数据来源。none 不填充,record 使用当前行,detail 请求详情接口。 */
|
|
478
|
+
type: 'none' | 'record' | 'detail';
|
|
479
|
+
/** 请求 detail 时使用的 view 名称,缺失时使用当前 form view 名称。 */
|
|
480
|
+
view?: string;
|
|
481
|
+
/** 请求 detail 时携带的附加参数。 */
|
|
482
|
+
params?: Record<string, unknown>;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* 表单视图。
|
|
486
|
+
*
|
|
487
|
+
* Form 只描述布局和默认展示配置。创建、编辑、关闭和刷新由 action 与渲染上下文决定。
|
|
488
|
+
*/
|
|
489
|
+
export interface FormView {
|
|
490
|
+
/** 表单标题。 */
|
|
491
|
+
title?: string;
|
|
492
|
+
/** 表单说明。 */
|
|
493
|
+
help?: string;
|
|
494
|
+
/** 表单外层包装配置。 */
|
|
495
|
+
wrapper?: WrapperConfig;
|
|
496
|
+
/** 表单底部操作区。false 表示隐藏。 */
|
|
497
|
+
footer?: FooterConfig;
|
|
498
|
+
/** 打开表单前的数据加载配置。 */
|
|
499
|
+
load?: FormLoadConfig;
|
|
500
|
+
span?: number;
|
|
501
|
+
gap?: number;
|
|
502
|
+
/** 字段名简写。后端导出轻量 views 时可用该字段表达字段顺序。 */
|
|
503
|
+
fields?: string[];
|
|
504
|
+
/** 表单布局节点。 */
|
|
505
|
+
children?: ViewNode[];
|
|
506
|
+
/** 表单级附加属性。 */
|
|
507
|
+
props?: Record<string, unknown>;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* 详情视图。
|
|
511
|
+
*
|
|
512
|
+
* Detail 是独立展示协议,不等同于 readonly form。
|
|
513
|
+
*/
|
|
514
|
+
export interface DetailView {
|
|
515
|
+
/** 详情标题。 */
|
|
516
|
+
title?: string;
|
|
517
|
+
/** 详情说明。 */
|
|
518
|
+
help?: string;
|
|
519
|
+
/** 详情外层包装配置。 */
|
|
520
|
+
wrapper?: WrapperConfig;
|
|
521
|
+
span?: number;
|
|
522
|
+
gap?: number;
|
|
523
|
+
/** 字段名简写。后端导出轻量 views 时可用该字段表达字段顺序。 */
|
|
524
|
+
fields?: string[];
|
|
525
|
+
/** 详情布局节点。 */
|
|
526
|
+
children?: ViewNode[];
|
|
527
|
+
/** 详情级附加属性。 */
|
|
528
|
+
props?: Record<string, unknown>;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* 字段可选值来源模式。
|
|
532
|
+
*/
|
|
533
|
+
export type FieldOptionsMode = 'static' | 'dictionary' | 'reference' | 'remote';
|
|
534
|
+
/** 候选值约束策略。closed 只接受候选来源中的值,open 允许自定义值。 */
|
|
535
|
+
export type FieldOptionValuePolicy = 'closed' | 'open';
|
|
536
|
+
/**
|
|
537
|
+
* 字段可选值配置。
|
|
538
|
+
*
|
|
539
|
+
* `mode=static` 时使用 `items`;`mode=dictionary` 时由数据字典服务按 code 加载;
|
|
540
|
+
* `mode=reference` 时根据字段 reference 加载目标资源候选项。
|
|
541
|
+
*/
|
|
542
|
+
export interface FieldOptionsConfig {
|
|
543
|
+
/** 选项来源模式。 */
|
|
544
|
+
mode: FieldOptionsMode;
|
|
545
|
+
/** 候选值约束策略;缺失时按 closed 处理。 */
|
|
546
|
+
value_policy?: FieldOptionValuePolicy;
|
|
547
|
+
/** 静态选项列表,通常在 mode=static 时使用。 */
|
|
548
|
+
items?: OptionItem[];
|
|
549
|
+
/** 数据字典来源,通常在 mode=dictionary 时使用。 */
|
|
550
|
+
dictionary?: DictionaryOptionSourceConfig;
|
|
551
|
+
/** 资源引用候选查询配置,通常在 mode=reference 时使用。 */
|
|
552
|
+
reference?: ReferenceOptionQueryConfig;
|
|
553
|
+
/** 远程选项配置,通常在 mode=remote 时交给 DataAdapter 或 hooks 解析。 */
|
|
554
|
+
remote?: RemoteDataSourceConfig;
|
|
555
|
+
}
|
|
556
|
+
/** 数据字典候选项来源。 */
|
|
557
|
+
export interface DictionaryOptionSourceConfig {
|
|
558
|
+
/** 数据字典模块中的稳定字典编码。 */
|
|
559
|
+
code: string;
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* 候选项过滤规则。
|
|
563
|
+
*/
|
|
564
|
+
export interface FieldOptionFilterConfig {
|
|
565
|
+
/** 过滤字段名。 */
|
|
566
|
+
field: string;
|
|
567
|
+
/** 过滤操作符。 */
|
|
568
|
+
operator?: string;
|
|
569
|
+
/** 固定过滤值。 */
|
|
570
|
+
value?: unknown;
|
|
571
|
+
/** 过滤值来源字段或上下文键,例如 form.category_id。 */
|
|
572
|
+
from?: string;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* 候选项排序规则。
|
|
576
|
+
*/
|
|
577
|
+
export interface FieldOptionSortConfig {
|
|
578
|
+
/** 排序字段名。 */
|
|
579
|
+
field: string;
|
|
580
|
+
/** 排序方向。 */
|
|
581
|
+
order?: 'asc' | 'desc' | string;
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* 资源引用候选项查询配置。
|
|
585
|
+
*/
|
|
586
|
+
export interface ReferenceOptionQueryConfig {
|
|
587
|
+
/** 搜索字段。 */
|
|
588
|
+
search_field?: string;
|
|
589
|
+
/** 禁用状态字段。 */
|
|
590
|
+
disabled_field?: string;
|
|
591
|
+
/** 父级字段。树形关联选项会用到。 */
|
|
592
|
+
parent_field?: string;
|
|
593
|
+
/** 候选项分组稳定值字段。 */
|
|
594
|
+
group_field?: string;
|
|
595
|
+
/** 候选项分组展示名称字段。 */
|
|
596
|
+
group_label_field?: string;
|
|
597
|
+
/** 候选项补充说明字段。 */
|
|
598
|
+
description_field?: string;
|
|
599
|
+
/** 需要随选项一并返回的元信息字段。 */
|
|
600
|
+
meta_fields?: string[];
|
|
601
|
+
/** 固定过滤条件。 */
|
|
602
|
+
filters?: FieldOptionFilterConfig[];
|
|
603
|
+
/** 固定排序配置。 */
|
|
604
|
+
sorts?: FieldOptionSortConfig[];
|
|
605
|
+
/** 单次查询数量。 */
|
|
606
|
+
limit?: number;
|
|
607
|
+
/** 加载模式。paged 表示搜索分页,tree 表示树形懒加载,all 表示显式全量。 */
|
|
608
|
+
load_mode?: 'paged' | 'tree' | 'all';
|
|
609
|
+
/** 附加参数。 */
|
|
610
|
+
params?: Record<string, unknown>;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* 远程选项来源配置。
|
|
614
|
+
*/
|
|
615
|
+
export interface RemoteDataSourceConfig {
|
|
616
|
+
/** 远程候选项来源。provider 表示后端托管,client 表示前端直连 URL。 */
|
|
617
|
+
target?: 'provider' | 'client' | string;
|
|
618
|
+
/** 前端直连候选项接口地址,仅 target=client 时使用。 */
|
|
619
|
+
url?: string;
|
|
620
|
+
/** 远程能力提供者。 */
|
|
621
|
+
provider?: string;
|
|
622
|
+
/** 远程能力键。保留给前端适配层组合 provider/key。 */
|
|
623
|
+
key?: string;
|
|
624
|
+
/** 远程请求方法。 */
|
|
625
|
+
method?: string;
|
|
626
|
+
/** 选项值字段。 */
|
|
627
|
+
value_field?: string;
|
|
628
|
+
/** 选项标签字段。 */
|
|
629
|
+
label_field?: string;
|
|
630
|
+
/** 禁用状态字段。 */
|
|
631
|
+
disabled_field?: string;
|
|
632
|
+
/** 父级字段。树形远程选项会用到。 */
|
|
633
|
+
parent_field?: string;
|
|
634
|
+
/** 候选项分组稳定值字段。 */
|
|
635
|
+
group_field?: string;
|
|
636
|
+
/** 候选项分组展示名称字段。 */
|
|
637
|
+
group_label_field?: string;
|
|
638
|
+
/** 候选项补充说明字段。 */
|
|
639
|
+
description_field?: string;
|
|
640
|
+
/** 需要随选项一并返回的元信息字段。 */
|
|
641
|
+
meta_fields?: string[];
|
|
642
|
+
/** 远程关键字查询参数名。 */
|
|
643
|
+
keyword_param?: string;
|
|
644
|
+
/** 固定过滤条件。 */
|
|
645
|
+
filters?: FieldOptionFilterConfig[];
|
|
646
|
+
/** 固定排序配置。 */
|
|
647
|
+
sorts?: FieldOptionSortConfig[];
|
|
648
|
+
/** 单次查询数量。 */
|
|
649
|
+
limit?: number;
|
|
650
|
+
/** 加载模式。paged 表示搜索分页,tree 表示树形懒加载,all 表示显式全量。 */
|
|
651
|
+
load_mode?: 'paged' | 'tree' | 'all';
|
|
652
|
+
/** 请求参数。 */
|
|
653
|
+
params?: Record<string, unknown>;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* 字段组件回写策略。
|
|
657
|
+
*
|
|
658
|
+
* always 表示每次命中事件都覆盖目标字段;empty 表示仅在目标字段为空时写入。
|
|
659
|
+
* 当前空值由消费端按 undefined、null、空字符串和空数组判断。
|
|
660
|
+
*/
|
|
661
|
+
export type WriteBackStrategy = 'always' | 'empty';
|
|
662
|
+
/**
|
|
663
|
+
* 字段组件联动回写规则。
|
|
664
|
+
*
|
|
665
|
+
* 该规则属于前端 UI 层协议,只在组件主动提供变更上下文时生效。
|
|
666
|
+
* 第一阶段 from 仅约定为简单路径,例如 value、asset.id、asset.metadata.duration、assets.0.id。
|
|
667
|
+
* 第一阶段 to 仅约定为当前表单内顶层字段名,不支持跨资源、跨表单或嵌套路径写入。
|
|
668
|
+
*/
|
|
669
|
+
export interface WriteBackRule {
|
|
670
|
+
/** 从组件变更上下文读取值的路径。 */
|
|
671
|
+
from: string;
|
|
672
|
+
/** 写入当前表单的目标字段名。 */
|
|
673
|
+
to: string;
|
|
674
|
+
/** 写入策略。缺失时按 always 处理。 */
|
|
675
|
+
strategy?: WriteBackStrategy;
|
|
676
|
+
/** 触发事件列表。缺失或空数组表示不限制事件。 */
|
|
677
|
+
events?: string[];
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* 组件变更上下文。
|
|
681
|
+
*
|
|
682
|
+
* 不同组件暴露的上下文不同。基础组件通常只暴露 value;资源组件会额外暴露 asset、assets 和资源事件。
|
|
683
|
+
*/
|
|
684
|
+
export interface ComponentChangeContext {
|
|
685
|
+
/** 当前组件写入主字段的最终值。 */
|
|
686
|
+
value?: unknown;
|
|
687
|
+
/** 组件变更事件,例如 upload、pick、change。 */
|
|
688
|
+
event?: string;
|
|
689
|
+
/** 组件自定义上下文。 */
|
|
690
|
+
[key: string]: unknown;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* 通用节点 props。
|
|
694
|
+
*
|
|
695
|
+
* props 允许组件透传 UI 库差异化配置,因此协议仅固定跨组件稳定字段。
|
|
696
|
+
*/
|
|
697
|
+
export interface ViewNodeProps {
|
|
698
|
+
/** 字段联动回写规则。仅支持提供变更上下文的组件。 */
|
|
699
|
+
writeBack?: WriteBackRule[];
|
|
700
|
+
/** 允许组件继续扩展自身 props。 */
|
|
701
|
+
[key: string]: unknown;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* 资源类型。
|
|
705
|
+
*/
|
|
706
|
+
export type AssetType = 'image' | 'video' | 'audio' | 'file' | string;
|
|
707
|
+
/**
|
|
708
|
+
* 资源组件值模式。
|
|
709
|
+
*
|
|
710
|
+
* url 表示提交资源 URL;id 表示提交资源 ID;asset 表示提交完整资源对象。
|
|
711
|
+
*/
|
|
712
|
+
export type AssetValueMode = 'url' | 'id' | 'asset';
|
|
713
|
+
/**
|
|
714
|
+
* 资源元信息。
|
|
715
|
+
*
|
|
716
|
+
* 媒体解析结果、转码信息和业务扩展信息都放在 metadata 中。后端返回值是最终可信来源。
|
|
717
|
+
*/
|
|
718
|
+
export interface AssetMetadata {
|
|
719
|
+
/** 音视频时长,单位秒。 */
|
|
720
|
+
duration?: number;
|
|
721
|
+
/** 封面资源 ID。 */
|
|
722
|
+
coverAssetId?: string | number;
|
|
723
|
+
/** 封面 URL。 */
|
|
724
|
+
coverUrl?: string;
|
|
725
|
+
/** 媒体宽度。 */
|
|
726
|
+
width?: number;
|
|
727
|
+
/** 媒体高度。 */
|
|
728
|
+
height?: number;
|
|
729
|
+
/** 编码格式。 */
|
|
730
|
+
codec?: string;
|
|
731
|
+
/** 码率。 */
|
|
732
|
+
bitrate?: number;
|
|
733
|
+
/** 业务扩展元信息。 */
|
|
734
|
+
[key: string]: unknown;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* 资源对象。
|
|
738
|
+
*/
|
|
739
|
+
export interface AssetDescriptor {
|
|
740
|
+
/** 资源 ID。valueMode=id 时必须存在,否则消费端应忽略该资源并输出错误日志。 */
|
|
741
|
+
id?: string | number;
|
|
742
|
+
/** 资源可访问 URL。 */
|
|
743
|
+
url: string;
|
|
744
|
+
/** 文件名。 */
|
|
745
|
+
name?: string;
|
|
746
|
+
/** 展示标题。 */
|
|
747
|
+
title?: string;
|
|
748
|
+
/** MIME 类型。 */
|
|
749
|
+
mime?: string;
|
|
750
|
+
/** 文件大小,单位字节。 */
|
|
751
|
+
size?: number;
|
|
752
|
+
/** 资源类型。 */
|
|
753
|
+
type?: AssetType;
|
|
754
|
+
/** 资源元信息。 */
|
|
755
|
+
metadata?: AssetMetadata;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* 资源上传/选择组件 props。
|
|
759
|
+
*/
|
|
760
|
+
export interface AssetComponentProps extends ViewNodeProps {
|
|
761
|
+
/** 输出值模式,默认 url。 */
|
|
762
|
+
valueMode?: AssetValueMode;
|
|
763
|
+
/** 文件 accept 限制,例如 image/*、video/*、.pdf。 */
|
|
764
|
+
accept?: string;
|
|
765
|
+
/** 是否允许多选。 */
|
|
766
|
+
multiple?: boolean;
|
|
767
|
+
/** 数量限制。0 表示不限制。 */
|
|
768
|
+
limit?: number;
|
|
769
|
+
/** 单个文件最大字节数。0 或缺失表示不增加前端大小限制。 */
|
|
770
|
+
maxSize?: number;
|
|
771
|
+
/** 是否允许编辑资源标题。该配置只影响 UI,不决定输出值模式。 */
|
|
772
|
+
editableTitle?: boolean;
|
|
773
|
+
/** editableTitle 的兼容别名。 */
|
|
774
|
+
editable?: boolean;
|
|
775
|
+
/** 上传按钮文案。 */
|
|
776
|
+
uploadText?: string;
|
|
777
|
+
/** 当前字段使用的专用上传地址;配置后不经过资源中心,也不开放已有资源选择。 */
|
|
778
|
+
uploadEndpoint?: string;
|
|
779
|
+
/** 资源选择按钮文案。 */
|
|
780
|
+
pickText?: string;
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* 富文本工具栏模式。
|
|
784
|
+
*/
|
|
785
|
+
export type RichTextToolbarMode = 'simple' | 'default' | 'full' | 'custom';
|
|
786
|
+
/**
|
|
787
|
+
* 富文本工具栏吸顶边界。
|
|
788
|
+
*/
|
|
789
|
+
export type RichTextToolbarBoundary = 'field' | 'form' | 'page' | string;
|
|
790
|
+
/**
|
|
791
|
+
* 富文本工具栏配置。
|
|
792
|
+
*
|
|
793
|
+
* 不同编辑器可以将该通用配置映射到自身工具栏能力;无法识别的工具项由具体编辑器适配器忽略。
|
|
794
|
+
*/
|
|
795
|
+
export interface RichTextToolbarConfig {
|
|
796
|
+
/** 工具栏预设模式。 */
|
|
797
|
+
mode?: RichTextToolbarMode;
|
|
798
|
+
/** 是否启用工具栏吸顶。 */
|
|
799
|
+
sticky?: boolean;
|
|
800
|
+
/** 吸顶偏移量。 */
|
|
801
|
+
stickyOffset?: number | string;
|
|
802
|
+
/** 吸顶边界。第一阶段主要由具体编辑器适配器解释。 */
|
|
803
|
+
stickyBoundary?: RichTextToolbarBoundary;
|
|
804
|
+
/** 显式工具项。 */
|
|
805
|
+
items?: string[];
|
|
806
|
+
/** 从预设或显式工具项中排除的工具项。 */
|
|
807
|
+
exclude?: string[];
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* 富文本组件 props。
|
|
811
|
+
*/
|
|
812
|
+
export interface RichTextComponentProps extends ViewNodeProps {
|
|
813
|
+
/** 编辑器实现标识,例如 markdown、tinymce、wang、editorjs。 */
|
|
814
|
+
editor?: string;
|
|
815
|
+
/** 占位提示。 */
|
|
816
|
+
placeholder?: string;
|
|
817
|
+
/** 编辑器高度。 */
|
|
818
|
+
height?: number | string;
|
|
819
|
+
/** 加载提示。 */
|
|
820
|
+
loadingText?: string;
|
|
821
|
+
/** 工具栏配置。 */
|
|
822
|
+
toolbar?: RichTextToolbarConfig;
|
|
823
|
+
/** 透传给具体编辑器适配器的配置。 */
|
|
824
|
+
editorProps?: Record<string, unknown>;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* 节点静态插槽内容。
|
|
828
|
+
*
|
|
829
|
+
* 第一阶段只支持纯文本和图标,不支持任意组件、按钮或事件处理。复杂组合输入应使用自定义组件实现。
|
|
830
|
+
*/
|
|
831
|
+
export type ViewNodeSlotContent = {
|
|
832
|
+
/** 纯文本插槽。 */
|
|
833
|
+
type: 'text';
|
|
834
|
+
/** 插槽文本。 */
|
|
835
|
+
text: string;
|
|
836
|
+
} | {
|
|
837
|
+
/** 图标插槽。 */
|
|
838
|
+
type: 'icon';
|
|
839
|
+
/** 图标 key,由具体 UI adapter 解析。 */
|
|
840
|
+
icon: string;
|
|
841
|
+
};
|
|
842
|
+
/**
|
|
843
|
+
* 节点静态插槽。
|
|
844
|
+
*
|
|
845
|
+
* 当前主要面向单行输入类组件。组件或 UI adapter 不支持时应忽略。
|
|
846
|
+
*/
|
|
847
|
+
export interface ViewNodeSlots {
|
|
848
|
+
/** 输入框内部前缀。 */
|
|
849
|
+
prefix?: ViewNodeSlotContent;
|
|
850
|
+
/** 输入框内部后缀。 */
|
|
851
|
+
suffix?: ViewNodeSlotContent;
|
|
852
|
+
/** 输入框外部前置内容。 */
|
|
853
|
+
prepend?: ViewNodeSlotContent;
|
|
854
|
+
/** 输入框外部后置内容。 */
|
|
855
|
+
append?: ViewNodeSlotContent;
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* 嵌入视图数据绑定。
|
|
859
|
+
*
|
|
860
|
+
* form-array 表示父表单 values 中的数组字段;relation-list 表示父资源关联的完整子资源列表。
|
|
861
|
+
*/
|
|
862
|
+
export type ViewNodeBinding = FormArrayBinding | RelationListBinding;
|
|
863
|
+
/**
|
|
864
|
+
* 父表单数组绑定。
|
|
865
|
+
*
|
|
866
|
+
* 适合 JSON 字段随父表单一起保存的轻量明细配置。
|
|
867
|
+
*/
|
|
868
|
+
export interface FormArrayBinding {
|
|
869
|
+
/** 绑定类型。 */
|
|
870
|
+
type: 'form-array';
|
|
871
|
+
/** 父表单 values 中的数组字段名。 */
|
|
872
|
+
field: string;
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* 子资源关联列表绑定。
|
|
876
|
+
*
|
|
877
|
+
* 适合订单明细、活动商品、角色权限等完整资源或中间表关系。
|
|
878
|
+
*/
|
|
879
|
+
export interface RelationListBinding {
|
|
880
|
+
/** 绑定类型。 */
|
|
881
|
+
type: 'relation-list';
|
|
882
|
+
/** 父资源上的关系名,例如 items、products、permissions。 */
|
|
883
|
+
relation: string;
|
|
884
|
+
/** 子资源或目标资源编码。也可由 ViewNode.resource 提供,二者存在时应保持一致。 */
|
|
885
|
+
resource?: string;
|
|
886
|
+
/** 父资源主键字段。缺失时使用父资源 primaryKey。 */
|
|
887
|
+
parentKey?: string;
|
|
888
|
+
/** 关系类型。缺失时按 has-many 处理。 */
|
|
889
|
+
relationType?: 'has-many' | 'many-to-many' | string;
|
|
890
|
+
/** has-many 关系下子资源指向父资源的外键字段。 */
|
|
891
|
+
foreignKey?: string;
|
|
892
|
+
/** many-to-many 或 through 关系配置。 */
|
|
893
|
+
through?: RelationThroughBinding;
|
|
894
|
+
/** 是否要求父记录已存在。完整资源模式建议默认 true。 */
|
|
895
|
+
requireParent?: boolean;
|
|
896
|
+
/** 父记录不存在时的展示策略。 */
|
|
897
|
+
whenParentMissing?: 'disabled' | 'hidden' | 'readonly';
|
|
898
|
+
/** 子列表查询配置。 */
|
|
899
|
+
query?: RelationListQueryConfig;
|
|
900
|
+
/** 子列表分页配置。 */
|
|
901
|
+
pagination?: RelationListPaginationConfig;
|
|
902
|
+
/** 子资源操作后的默认刷新策略。 */
|
|
903
|
+
refresh?: RelationListRefreshConfig;
|
|
904
|
+
/** 子资源操作配置。 */
|
|
905
|
+
operations?: RelationListOperationsConfig;
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* 中间表关系配置。
|
|
909
|
+
*/
|
|
910
|
+
export interface RelationThroughBinding {
|
|
911
|
+
/** 中间资源编码,例如 campaign_product。 */
|
|
912
|
+
resource: string;
|
|
913
|
+
/** 中间资源指向父资源的字段,例如 campaign_id。 */
|
|
914
|
+
parentForeignKey: string;
|
|
915
|
+
/** 中间资源指向目标资源的字段,例如 product_id。 */
|
|
916
|
+
targetForeignKey: string;
|
|
917
|
+
/** 目标资源主键字段,缺失时使用目标资源 primaryKey。 */
|
|
918
|
+
targetKey?: string;
|
|
919
|
+
/** 是否展示或编辑中间表字段。 */
|
|
920
|
+
exposeThroughFields?: boolean;
|
|
921
|
+
/** 需要展示或编辑的中间表字段。 */
|
|
922
|
+
throughFields?: string[];
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* 子资源列表查询配置。
|
|
926
|
+
*/
|
|
927
|
+
export interface RelationListQueryConfig {
|
|
928
|
+
/** 是否自动附加 foreignKey = parent[parentKey] 过滤。默认 true。 */
|
|
929
|
+
inheritParentFilter?: boolean;
|
|
930
|
+
/** 固定请求参数。 */
|
|
931
|
+
params?: Record<string, unknown>;
|
|
932
|
+
/** 固定过滤条件。 */
|
|
933
|
+
filters?: FieldOptionFilterConfig[];
|
|
934
|
+
/** 默认排序。 */
|
|
935
|
+
sorts?: FieldOptionSortConfig[];
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* 子资源列表分页配置。
|
|
939
|
+
*/
|
|
940
|
+
export interface RelationListPaginationConfig {
|
|
941
|
+
/** 是否启用分页。 */
|
|
942
|
+
enabled?: boolean;
|
|
943
|
+
/** 默认每页条数。 */
|
|
944
|
+
pageSize?: number;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* 子资源列表刷新策略。
|
|
948
|
+
*/
|
|
949
|
+
export interface RelationListRefreshConfig {
|
|
950
|
+
/** 新增后刷新策略。 */
|
|
951
|
+
afterCreate?: RelationListRefreshMode;
|
|
952
|
+
/** 更新后刷新策略。 */
|
|
953
|
+
afterUpdate?: RelationListRefreshMode;
|
|
954
|
+
/** 删除后刷新策略。 */
|
|
955
|
+
afterDelete?: RelationListRefreshMode;
|
|
956
|
+
/** 操作成功后是否刷新父详情,用于父资源汇总字段。 */
|
|
957
|
+
parent?: boolean;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* 子资源列表刷新模式。
|
|
961
|
+
*/
|
|
962
|
+
export type RelationListRefreshMode = 'reload-current' | 'reload-first' | 'none';
|
|
963
|
+
/**
|
|
964
|
+
* 子资源列表操作集合。
|
|
965
|
+
*/
|
|
966
|
+
export interface RelationListOperationsConfig {
|
|
967
|
+
/** 创建新的目标资源并建立关系。 */
|
|
968
|
+
create?: RelationListOperationConfig;
|
|
969
|
+
/** 选择已有目标资源并建立关系。 */
|
|
970
|
+
attach?: RelationListOperationConfig;
|
|
971
|
+
/** 编辑目标资源或关系字段。 */
|
|
972
|
+
update?: RelationListOperationConfig;
|
|
973
|
+
/** 只解除关系,不删除目标资源。 */
|
|
974
|
+
detach?: RelationListOperationConfig;
|
|
975
|
+
/** 删除目标资源。 */
|
|
976
|
+
delete?: RelationListOperationConfig;
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* 子资源列表操作配置。
|
|
980
|
+
*/
|
|
981
|
+
export interface RelationListOperationConfig {
|
|
982
|
+
/** 是否启用该操作。操作配置存在时默认 true;未配置该操作时不开放。 */
|
|
983
|
+
enabled?: boolean;
|
|
984
|
+
/** 关系操作按钮文案。缺失时使用内置动作文案。 */
|
|
985
|
+
title?: string;
|
|
986
|
+
/** 关系操作按钮图标。 */
|
|
987
|
+
icon?: string;
|
|
988
|
+
/** 关系操作按钮类型。 */
|
|
989
|
+
type?: string;
|
|
990
|
+
/** 关系操作执行前确认。delete/detach 缺失时使用内置确认配置。 */
|
|
991
|
+
confirm?: ConfirmConfig;
|
|
992
|
+
/** 关系操作按钮附加属性。 */
|
|
993
|
+
props?: Record<string, unknown>;
|
|
994
|
+
/** 按钮位置。缺失时 create/attach 使用 toolbar,其余操作使用 row。 */
|
|
995
|
+
placement?: RelationListOperationPlacement;
|
|
996
|
+
/** 点击按钮后的输入收集方式。缺失时按关系操作语义推导。 */
|
|
997
|
+
interaction?: RelationListOperationInteraction;
|
|
998
|
+
/** 输入准备完成后的数据执行方式。缺失时使用资源 CRUD。 */
|
|
999
|
+
execution?: RelationListOperationExecution;
|
|
1000
|
+
/** 操作成功后的刷新策略,优先级高于 binding.refresh。 */
|
|
1001
|
+
refresh?: RelationListRefreshMode;
|
|
1002
|
+
/** 操作成功后是否刷新父详情。 */
|
|
1003
|
+
refreshParent?: boolean;
|
|
1004
|
+
}
|
|
1005
|
+
/** 关系操作按钮位置。 */
|
|
1006
|
+
export type RelationListOperationPlacement = 'toolbar' | 'row';
|
|
1007
|
+
/** 关系操作交互方式。 */
|
|
1008
|
+
export type RelationListOperationInteraction = RelationListFormInteraction | RelationListSelectionInteraction | RelationListDirectInteraction | RelationListHandlerInteraction;
|
|
1009
|
+
/** 通过目标资源表单收集操作输入。 */
|
|
1010
|
+
export interface RelationListFormInteraction {
|
|
1011
|
+
type: 'form';
|
|
1012
|
+
/** 目标资源 Form View。 */
|
|
1013
|
+
form?: string;
|
|
1014
|
+
/** 表单初始状态。create 使用默认值,edit 使用当前行记录。 */
|
|
1015
|
+
mode?: 'create' | 'edit';
|
|
1016
|
+
}
|
|
1017
|
+
/** 通过目标资源表格选择操作对象。 */
|
|
1018
|
+
export interface RelationListSelectionInteraction {
|
|
1019
|
+
type: 'selection';
|
|
1020
|
+
/** 目标资源 Table View。 */
|
|
1021
|
+
table?: string;
|
|
1022
|
+
/** 是否允许一次选择多条资源。默认 true。 */
|
|
1023
|
+
multiple?: boolean;
|
|
1024
|
+
/** 候选数据范围。attach 默认 unassigned,其余操作默认 related。 */
|
|
1025
|
+
source?: 'related' | 'unassigned' | 'all';
|
|
1026
|
+
}
|
|
1027
|
+
/** 点击按钮后不再收集输入,直接执行操作。 */
|
|
1028
|
+
export interface RelationListDirectInteraction {
|
|
1029
|
+
type: 'direct';
|
|
1030
|
+
}
|
|
1031
|
+
/** 将完整前端交互委托给宿主 onAction 或已注册的 session action handler。 */
|
|
1032
|
+
export interface RelationListHandlerInteraction {
|
|
1033
|
+
type: 'handler';
|
|
1034
|
+
/** 前端交互处理标识。 */
|
|
1035
|
+
handler: string;
|
|
1036
|
+
}
|
|
1037
|
+
/** 关系操作最终执行方式。 */
|
|
1038
|
+
export type RelationListOperationExecution = RelationListResourceExecution | RelationListActionExecution;
|
|
1039
|
+
/** 使用关系语义对应的资源 CRUD。 */
|
|
1040
|
+
export interface RelationListResourceExecution {
|
|
1041
|
+
type: 'resource';
|
|
1042
|
+
}
|
|
1043
|
+
/** 使用 DataAdapter.executeAction 执行业务动作。 */
|
|
1044
|
+
export interface RelationListActionExecution {
|
|
1045
|
+
type: 'action';
|
|
1046
|
+
/** 业务 action key,例如 order_item.attachExisting。 */
|
|
1047
|
+
action: string;
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* 布局节点类型。
|
|
1051
|
+
*/
|
|
1052
|
+
export type ViewNodeType = 'field' | 'group' | 'section' | 'card' | 'collapse' | 'collapse-item' | 'grid' | 'row' | 'col' | 'tabs' | 'tab' | 'divider' | 'custom' | 'view';
|
|
1053
|
+
/**
|
|
1054
|
+
* 表单和详情共用的布局节点。
|
|
1055
|
+
*
|
|
1056
|
+
* field 节点通过 field 引用 ResourceField;view 节点用于在当前布局中嵌入 table/form/detail/search。
|
|
1057
|
+
*/
|
|
1058
|
+
export interface ViewNode {
|
|
1059
|
+
/** 节点唯一标识。设计器和嵌套 scope 会用到。 */
|
|
1060
|
+
id?: string;
|
|
1061
|
+
/** 节点运行名称。tab 等需要稳定组件 name 的节点优先使用该值;缺失时可退回 id。 */
|
|
1062
|
+
name?: string;
|
|
1063
|
+
/** 节点类型。 */
|
|
1064
|
+
type: ViewNodeType;
|
|
1065
|
+
/** 字段名。仅 field 节点使用。 */
|
|
1066
|
+
field?: string;
|
|
1067
|
+
/** 当前节点展示标题。不会修改 ResourceField.label。 */
|
|
1068
|
+
title?: string;
|
|
1069
|
+
/** 字段节点标题旁的补充提示。由 UI adapter 通过可聚焦的提示入口展示。 */
|
|
1070
|
+
tip?: string;
|
|
1071
|
+
/** 当前节点辅助说明。常用于字段说明或区域说明。 */
|
|
1072
|
+
help?: string;
|
|
1073
|
+
/** 逻辑组件 key,例如 rich-text、status-tag、custom-card。 */
|
|
1074
|
+
component?: string;
|
|
1075
|
+
/** 嵌入视图的渲染模式。仅 view 节点使用。 */
|
|
1076
|
+
mode?: RenderMode;
|
|
1077
|
+
/** 嵌入视图名,例如 contacts。仅 view 节点使用。 */
|
|
1078
|
+
view?: string;
|
|
1079
|
+
/** 嵌入外部资源编码。第一阶段可先不实现。 */
|
|
1080
|
+
resource?: string;
|
|
1081
|
+
/** 栅格跨度。默认由 renderer 决定。 */
|
|
1082
|
+
span?: number;
|
|
1083
|
+
/** 子节点间距。 */
|
|
1084
|
+
gap?: number;
|
|
1085
|
+
/** 节点附加属性。组件协议固定字段见 ViewNodeProps,具体组件仍可扩展自身 props。 */
|
|
1086
|
+
props?: ViewNodeProps;
|
|
1087
|
+
/** 节点静态插槽。第一阶段主要由 text/password 等单行输入类组件消费。 */
|
|
1088
|
+
slots?: ViewNodeSlots;
|
|
1089
|
+
/** 嵌入视图数据绑定。主要用于 form-array 和 relation-list 这类表单内嵌列表。 */
|
|
1090
|
+
binding?: ViewNodeBinding;
|
|
1091
|
+
/** 节点 CSS class。 */
|
|
1092
|
+
className?: string;
|
|
1093
|
+
/** 节点内联样式。只建议放少量静态样式。 */
|
|
1094
|
+
style?: Record<string, string | number>;
|
|
1095
|
+
/** 节点专属数据源。常用于覆盖字段默认选项来源。 */
|
|
1096
|
+
dataSource?: DataSourceConfig;
|
|
1097
|
+
/** 子节点。布局容器、card、tab 和 custom 容器会使用。 */
|
|
1098
|
+
children?: ViewNode[];
|
|
1099
|
+
/** 显示条件。条件不满足时节点不渲染。 */
|
|
1100
|
+
show_when?: Condition;
|
|
1101
|
+
/** 禁用条件。主要用于 field 节点。 */
|
|
1102
|
+
disabled_when?: Condition;
|
|
1103
|
+
/** 只读条件。主要用于 field 节点。 */
|
|
1104
|
+
readonly_when?: Condition;
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* 表格视图。
|
|
1108
|
+
*/
|
|
1109
|
+
export interface TableView {
|
|
1110
|
+
/** 表格标题。 */
|
|
1111
|
+
title?: string;
|
|
1112
|
+
/** 表格说明。 */
|
|
1113
|
+
help?: string;
|
|
1114
|
+
/** 表格数据模式。tree 表示使用资源树接口加载根节点和子节点。 */
|
|
1115
|
+
mode?: 'list' | 'tree' | string;
|
|
1116
|
+
/** 树形表格展示配置,仅 mode=tree 时生效。 */
|
|
1117
|
+
tree?: TableTreeConfig;
|
|
1118
|
+
/** 序号列配置。true 使用默认序号列,false 不显示。 */
|
|
1119
|
+
index?: boolean | TableIndexConfig;
|
|
1120
|
+
/** 选择列配置。false 表示不显示选择列。 */
|
|
1121
|
+
selection?: false | TableSelectionConfig;
|
|
1122
|
+
/** 顶部工具栏。false 表示不显示工具栏。 */
|
|
1123
|
+
toolbar?: false | TableToolbarConfig;
|
|
1124
|
+
/** 字段名简写。后端导出轻量 views 时可用该字段表达列顺序。 */
|
|
1125
|
+
fields?: string[];
|
|
1126
|
+
/** 表格列。缺失时按 listable 字段推导。 */
|
|
1127
|
+
columns?: TableColumn[];
|
|
1128
|
+
/** 行操作列。false 表示不显示操作列。数组表示只配置 actions。 */
|
|
1129
|
+
operate?: false | ActionRef[] | TableOperateConfig;
|
|
1130
|
+
/** 分页配置。true 使用默认分页,false 不显示分页。 */
|
|
1131
|
+
pagination?: boolean | TablePaginationConfig;
|
|
1132
|
+
/** 表格编辑配置。第一阶段主要用于 relation-list 的行内编辑声明。 */
|
|
1133
|
+
editing?: TableEditingConfig;
|
|
1134
|
+
/** 表格级附加属性。 */
|
|
1135
|
+
props?: Record<string, unknown>;
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* 树形表格展示配置。
|
|
1139
|
+
*/
|
|
1140
|
+
export interface TableTreeConfig {
|
|
1141
|
+
/** 默认展开策略。all 表示一次性加载完整树;level/keys 表示在懒加载模式下展开指定范围。 */
|
|
1142
|
+
default_expand?: 'none' | 'level' | 'keys' | 'all' | string;
|
|
1143
|
+
/** default_expand=level 时默认展开到的层级。 */
|
|
1144
|
+
expand_level?: number;
|
|
1145
|
+
/** default_expand=keys 时默认展开的节点主键。 */
|
|
1146
|
+
expanded_keys?: Array<string | number>;
|
|
1147
|
+
/** 承载层级缩进和展开控件的列 id 或字段名。缺失时使用第一数据列。 */
|
|
1148
|
+
expand_column?: string;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* 表格序号列配置。
|
|
1152
|
+
*/
|
|
1153
|
+
export interface TableIndexConfig {
|
|
1154
|
+
/** 序号列表头。 */
|
|
1155
|
+
title?: string;
|
|
1156
|
+
/** 序号列宽度。 */
|
|
1157
|
+
width?: number;
|
|
1158
|
+
/** 固定方向。 */
|
|
1159
|
+
fixed?: 'left' | 'right';
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* 表格选择列配置。
|
|
1163
|
+
*/
|
|
1164
|
+
export interface TableSelectionConfig {
|
|
1165
|
+
/** checkbox 表示多选,radio 表示单选。 */
|
|
1166
|
+
type: 'checkbox' | 'radio';
|
|
1167
|
+
/** 禁用某一行选择的条件。 */
|
|
1168
|
+
disabled_when?: Condition;
|
|
1169
|
+
/** 选择列附加属性。 */
|
|
1170
|
+
props?: Record<string, unknown>;
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* 表格工具栏配置。
|
|
1174
|
+
*/
|
|
1175
|
+
export interface TableToolbarConfig {
|
|
1176
|
+
/** 左侧动作。 */
|
|
1177
|
+
left?: ActionRef[];
|
|
1178
|
+
/** 右侧动作。 */
|
|
1179
|
+
right?: ActionRef[];
|
|
1180
|
+
/** 批量动作。scope 默认是 batch,选中项为空时默认禁用。 */
|
|
1181
|
+
batch?: ActionRef[];
|
|
1182
|
+
/** 动作简写,等价于 left。 */
|
|
1183
|
+
actions?: ActionRef[];
|
|
1184
|
+
/** 工具栏快捷筛选项。 */
|
|
1185
|
+
filters?: TableFilterConfig[];
|
|
1186
|
+
/** 工具栏容器属性。 */
|
|
1187
|
+
props?: Record<string, unknown>;
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* 表格工具栏快捷筛选项。
|
|
1191
|
+
*
|
|
1192
|
+
* 完整搜索表单使用 SearchView;toolbar filters 用于状态、快捷视图等轻量筛选。
|
|
1193
|
+
*/
|
|
1194
|
+
export interface TableFilterConfig {
|
|
1195
|
+
/** 字段名。通常引用 ResourceField.name。 */
|
|
1196
|
+
field?: string;
|
|
1197
|
+
/** 筛选项标题。 */
|
|
1198
|
+
title?: string;
|
|
1199
|
+
/** 查询操作符。缺失时可按字段类型推导。 */
|
|
1200
|
+
operator?: string;
|
|
1201
|
+
/** 筛选组件 key,例如 segmented、select。 */
|
|
1202
|
+
component?: string;
|
|
1203
|
+
/** 默认值。 */
|
|
1204
|
+
defaultValue?: unknown;
|
|
1205
|
+
/** 静态选项。 */
|
|
1206
|
+
options?: OptionItem[];
|
|
1207
|
+
/** 异步数据源。 */
|
|
1208
|
+
dataSource?: DataSourceConfig;
|
|
1209
|
+
/** 筛选组件附加属性。 */
|
|
1210
|
+
props?: Record<string, unknown>;
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* 表格行操作列配置。
|
|
1214
|
+
*/
|
|
1215
|
+
export interface TableOperateConfig {
|
|
1216
|
+
/** 操作列表头。 */
|
|
1217
|
+
title?: string;
|
|
1218
|
+
/** 操作列宽度。 */
|
|
1219
|
+
width?: number;
|
|
1220
|
+
/** 最小列宽。 */
|
|
1221
|
+
minWidth?: number;
|
|
1222
|
+
/** 固定方向。 */
|
|
1223
|
+
fixed?: 'left' | 'right';
|
|
1224
|
+
/** 对齐方式。 */
|
|
1225
|
+
align?: 'left' | 'center' | 'right';
|
|
1226
|
+
/** 是否将过多操作自动折叠为更多操作。只有显式设为 true 时才启用。 */
|
|
1227
|
+
collapse?: boolean;
|
|
1228
|
+
/** 是否使用按钮组包裹行操作。默认 true。 */
|
|
1229
|
+
group?: boolean;
|
|
1230
|
+
/** 行操作动作。 */
|
|
1231
|
+
actions?: ActionRef[];
|
|
1232
|
+
/** 操作列附加属性。 */
|
|
1233
|
+
props?: Record<string, unknown>;
|
|
1234
|
+
}
|
|
1235
|
+
/**
|
|
1236
|
+
* 表格分页配置。
|
|
1237
|
+
*/
|
|
1238
|
+
export interface TablePaginationConfig {
|
|
1239
|
+
/** 默认每页条数。 */
|
|
1240
|
+
pageSize?: number;
|
|
1241
|
+
/** 可选每页条数。 */
|
|
1242
|
+
pageSizes?: number[];
|
|
1243
|
+
/** 分页组件附加属性。 */
|
|
1244
|
+
props?: Record<string, unknown>;
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* 表格编辑配置。
|
|
1248
|
+
*
|
|
1249
|
+
* 该配置是表格视图能力,普通列表和嵌套关系列表都可以消费。第一阶段建议只实现 saveMode=row。
|
|
1250
|
+
*/
|
|
1251
|
+
export interface TableEditingConfig {
|
|
1252
|
+
/** 编辑模式。none/default 表示不启用行内编辑。 */
|
|
1253
|
+
mode?: 'none' | 'inline' | string;
|
|
1254
|
+
/** 新增记录展示方式。inline 表示插入行编辑;dialog/drawer 表示复用表单视图。 */
|
|
1255
|
+
createMode?: 'inline' | 'dialog' | 'drawer' | string;
|
|
1256
|
+
/** 更新记录展示方式。 */
|
|
1257
|
+
updateMode?: 'inline' | 'dialog' | 'drawer' | string;
|
|
1258
|
+
/** 保存粒度。第一阶段建议只实现 row。 */
|
|
1259
|
+
saveMode?: 'row' | 'batch' | string;
|
|
1260
|
+
/** 允许行内编辑的字段。缺失时按 columns 中可编辑字段推导。 */
|
|
1261
|
+
fields?: string[];
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* 表格列。
|
|
1265
|
+
*
|
|
1266
|
+
* 字段列使用 field;非字段列使用 type=custom 并提供 id。
|
|
1267
|
+
*/
|
|
1268
|
+
export interface TableColumn {
|
|
1269
|
+
/** 自定义列标识。非字段列必填。 */
|
|
1270
|
+
id?: string;
|
|
1271
|
+
/** 列类型。缺失且存在 field 时按字段列处理。 */
|
|
1272
|
+
type?: 'field' | 'custom';
|
|
1273
|
+
/** 字段名。字段列必须引用 ResourceField.name。 */
|
|
1274
|
+
field?: string;
|
|
1275
|
+
/** 当前列标题。缺失时使用 ResourceField.label。 */
|
|
1276
|
+
title?: string;
|
|
1277
|
+
/** 逻辑展示组件 key。缺失时根据字段类型推导。 */
|
|
1278
|
+
component?: string;
|
|
1279
|
+
/** 字符串模板,例如 "${amount}-单价:${price}/元"。 */
|
|
1280
|
+
template?: string;
|
|
1281
|
+
/** 计算表达式。由受限表达式执行器求值。 */
|
|
1282
|
+
value?: ValueExpression;
|
|
1283
|
+
/** 展示格式化配置。 */
|
|
1284
|
+
format?: FormatConfig;
|
|
1285
|
+
/** 固定列宽。 */
|
|
1286
|
+
width?: number;
|
|
1287
|
+
/** 最小列宽。 */
|
|
1288
|
+
minWidth?: number;
|
|
1289
|
+
/** 固定方向。 */
|
|
1290
|
+
fixed?: 'left' | 'right';
|
|
1291
|
+
/** 对齐方式。 */
|
|
1292
|
+
align?: 'left' | 'center' | 'right';
|
|
1293
|
+
/** 是否允许排序。缺失时使用 ResourceField.sortable。 */
|
|
1294
|
+
sortable?: boolean;
|
|
1295
|
+
/** 列组件附加属性。 */
|
|
1296
|
+
props?: Record<string, unknown>;
|
|
1297
|
+
/** 显示条件。 */
|
|
1298
|
+
show_when?: Condition;
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* 搜索视图。
|
|
1302
|
+
*/
|
|
1303
|
+
export interface SearchView {
|
|
1304
|
+
/** 搜索区标题。通常不展示。 */
|
|
1305
|
+
title?: string;
|
|
1306
|
+
/** 搜索展示模式。inline 表示轻量内联搜索区。 */
|
|
1307
|
+
mode?: 'inline' | 'advanced' | string;
|
|
1308
|
+
/** 字段名简写。后端导出轻量 views 时可用该字段表达搜索项顺序。 */
|
|
1309
|
+
fields?: string[];
|
|
1310
|
+
/** 搜索项。缺失时按 searchable 字段推导。 */
|
|
1311
|
+
items?: SearchItem[];
|
|
1312
|
+
/** 搜索按钮。false 表示不显示按钮;缺失时生成查询和重置。 */
|
|
1313
|
+
actions?: false | ActionRef[];
|
|
1314
|
+
/** 搜索区布局配置。 */
|
|
1315
|
+
layout?: SearchLayoutConfig;
|
|
1316
|
+
span?: number;
|
|
1317
|
+
gap?: number;
|
|
1318
|
+
/** 是否默认收起。 */
|
|
1319
|
+
collapsed?: boolean;
|
|
1320
|
+
/** 搜索区附加属性。 */
|
|
1321
|
+
props?: Record<string, unknown>;
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* 搜索区布局配置。
|
|
1325
|
+
*/
|
|
1326
|
+
export interface SearchLayoutConfig {
|
|
1327
|
+
/** 每行列数。 */
|
|
1328
|
+
columns?: number;
|
|
1329
|
+
/** 搜索项间距。 */
|
|
1330
|
+
gap?: number;
|
|
1331
|
+
/** 收起时保留的行数。 */
|
|
1332
|
+
collapsedRows?: number;
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* 搜索项。
|
|
1336
|
+
*
|
|
1337
|
+
* 默认不显示 label,placeholder 使用 title 或 ResourceField.label。
|
|
1338
|
+
*/
|
|
1339
|
+
export interface SearchItem {
|
|
1340
|
+
/** 字段名,必须引用 ResourceField.name。 */
|
|
1341
|
+
field: string;
|
|
1342
|
+
/** 当前搜索项标题。可作为 placeholder 来源。 */
|
|
1343
|
+
title?: string;
|
|
1344
|
+
/** 查询操作符。缺失时根据字段类型推导。 */
|
|
1345
|
+
operator?: string;
|
|
1346
|
+
/** 可选查询操作符集合。存在时搜索项通常需要展示操作符选择。 */
|
|
1347
|
+
operators?: string[];
|
|
1348
|
+
/** 搜索组件 key。缺失时根据搜索场景推导。 */
|
|
1349
|
+
component?: string;
|
|
1350
|
+
/** 搜索组件附加属性。 */
|
|
1351
|
+
props?: Record<string, unknown>;
|
|
1352
|
+
/** 搜索项专属数据源。常用于 select、relation 等搜索组件。 */
|
|
1353
|
+
dataSource?: DataSourceConfig;
|
|
1354
|
+
/** 栅格跨度。 */
|
|
1355
|
+
span?: number;
|
|
1356
|
+
gap?: number;
|
|
1357
|
+
/** 是否显示 label。默认 false。 */
|
|
1358
|
+
show_label?: boolean;
|
|
1359
|
+
/** 显示条件。 */
|
|
1360
|
+
show_when?: Condition;
|
|
1361
|
+
}
|
|
1362
|
+
/** 动作作用域。 */
|
|
1363
|
+
export type ActionScope = 'collection' | 'resource' | 'record' | 'batch' | 'form' | 'self' | string;
|
|
1364
|
+
/** 动作类型。 */
|
|
1365
|
+
export type ActionKind = 'builtin' | 'custom' | 'request' | 'navigate' | string;
|
|
1366
|
+
/**
|
|
1367
|
+
* 动作引用。
|
|
1368
|
+
*
|
|
1369
|
+
* 出现在 toolbar、operate、batchActions、footer.actions 等 UI 位置。
|
|
1370
|
+
*/
|
|
1371
|
+
export interface ActionRef {
|
|
1372
|
+
/** 动作标识。可指向内置动作,也可引用 schema.actions。 */
|
|
1373
|
+
action: string;
|
|
1374
|
+
/** 当前按钮文案。缺失时可使用 ActionDefinition.title。 */
|
|
1375
|
+
title?: string;
|
|
1376
|
+
/** 图标 key。具体图标由 UI adapter 解析。 */
|
|
1377
|
+
icon?: string;
|
|
1378
|
+
/** 按钮类型或动作展示类型。type=dropdown 时表示下拉动作组。 */
|
|
1379
|
+
type?: string;
|
|
1380
|
+
/** 动作作用域。缺失时由所在位置推导。 */
|
|
1381
|
+
scope?: ActionScope;
|
|
1382
|
+
/** 子动作。用于下拉按钮或更多操作。 */
|
|
1383
|
+
children?: ActionRef[];
|
|
1384
|
+
/** 自定义按钮组件 key。 */
|
|
1385
|
+
component?: string;
|
|
1386
|
+
/** 按钮组件附加属性。 */
|
|
1387
|
+
props?: Record<string, unknown>;
|
|
1388
|
+
/** 执行前确认配置。 */
|
|
1389
|
+
confirm?: ConfirmConfig;
|
|
1390
|
+
/** 显示条件。 */
|
|
1391
|
+
show_when?: Condition;
|
|
1392
|
+
/** 禁用条件。scope=batch 时选中项为空会默认禁用。 */
|
|
1393
|
+
disabled_when?: Condition;
|
|
1394
|
+
/** 成功后的前端效果。局部配置优先于 ActionDefinition。 */
|
|
1395
|
+
afterSuccess?: ActionAfterEffect;
|
|
1396
|
+
/** 失败后的前端效果。局部配置优先于 ActionDefinition。 */
|
|
1397
|
+
afterError?: ActionAfterEffect;
|
|
1398
|
+
}
|
|
1399
|
+
/**
|
|
1400
|
+
* 顶层动作定义。
|
|
1401
|
+
*
|
|
1402
|
+
* 用于集中定义自定义动作或覆盖内置动作的默认行为。
|
|
1403
|
+
*/
|
|
1404
|
+
export interface ActionDefinition {
|
|
1405
|
+
/** 动作默认标题。 */
|
|
1406
|
+
title?: string;
|
|
1407
|
+
/** 默认图标 key。 */
|
|
1408
|
+
icon?: string;
|
|
1409
|
+
/** 默认按钮类型。 */
|
|
1410
|
+
type?: string;
|
|
1411
|
+
/** 动作类型。custom 通常交给 DataAdapter.executeAction。 */
|
|
1412
|
+
kind?: ActionKind;
|
|
1413
|
+
/** 默认作用域。 */
|
|
1414
|
+
scope?: ActionScope;
|
|
1415
|
+
/** 业务处理标识,例如 customer.archive。 */
|
|
1416
|
+
handler?: string;
|
|
1417
|
+
/** 是否启用。false 时引用该动作的位置应禁用或隐藏。 */
|
|
1418
|
+
enabled?: boolean;
|
|
1419
|
+
/** 动作打开表单、详情或页面时的展示方式。 */
|
|
1420
|
+
presentation?: ActionPresentation;
|
|
1421
|
+
/** 执行前确认配置。 */
|
|
1422
|
+
confirm?: ConfirmConfig;
|
|
1423
|
+
/** 显示条件。 */
|
|
1424
|
+
show_when?: Condition;
|
|
1425
|
+
/** 禁用条件。 */
|
|
1426
|
+
disabled_when?: Condition;
|
|
1427
|
+
/** 成功后的默认前端效果。 */
|
|
1428
|
+
afterSuccess?: ActionAfterEffect;
|
|
1429
|
+
/** 失败后的默认前端效果。 */
|
|
1430
|
+
afterError?: ActionAfterEffect;
|
|
1431
|
+
/** 动作附加属性。 */
|
|
1432
|
+
props?: Record<string, unknown>;
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* 动作展示方式。
|
|
1436
|
+
*/
|
|
1437
|
+
export interface ActionPresentation {
|
|
1438
|
+
/** 展示类型,例如 dialog、drawer、page。 */
|
|
1439
|
+
type?: 'default' | 'dialog' | 'drawer' | 'page' | string;
|
|
1440
|
+
/** 嵌套场景中的挂载位置。默认 self。 */
|
|
1441
|
+
mount?: 'self' | 'parent' | 'root' | string;
|
|
1442
|
+
/** 展示组件附加属性。 */
|
|
1443
|
+
props?: Record<string, unknown>;
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* 动作确认框配置。
|
|
1447
|
+
*/
|
|
1448
|
+
export interface ConfirmConfig {
|
|
1449
|
+
/** 确认框标题。 */
|
|
1450
|
+
title?: string;
|
|
1451
|
+
/** 确认框内容。 */
|
|
1452
|
+
content?: string;
|
|
1453
|
+
/** 确认组件附加属性。 */
|
|
1454
|
+
props?: Record<string, unknown>;
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* 动作完成后的前端效果。
|
|
1458
|
+
*/
|
|
1459
|
+
export interface ActionAfterEffect {
|
|
1460
|
+
/** 关闭目标。true 表示关闭当前动作打开的 wrapper。 */
|
|
1461
|
+
close?: boolean | string;
|
|
1462
|
+
/** 刷新目标,例如 source、table:default、root.table:default。 */
|
|
1463
|
+
refresh?: string[];
|
|
1464
|
+
/** 成功或失败提示文案。 */
|
|
1465
|
+
message?: string;
|
|
1466
|
+
/** 跳转地址或路由标识。 */
|
|
1467
|
+
navigate?: string;
|
|
1468
|
+
/** 重置目标,例如 form:default。 */
|
|
1469
|
+
reset?: string[];
|
|
1470
|
+
/** 额外触发的事件名。 */
|
|
1471
|
+
emit?: string;
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* 数据源配置。
|
|
1475
|
+
*
|
|
1476
|
+
* 字段默认数据源优先来自 ResourceField.options。节点级 dataSource 用于覆盖当前 UI 场景。
|
|
1477
|
+
*/
|
|
1478
|
+
export type DataSourceConfig = StaticOptionsDataSource | RemoteOptionsDataSource | DictionaryOptionsDataSource | ReferenceDataSource;
|
|
1479
|
+
/**
|
|
1480
|
+
* 静态选项数据源。
|
|
1481
|
+
*/
|
|
1482
|
+
export interface StaticOptionsDataSource {
|
|
1483
|
+
/** 数据源类型。 */
|
|
1484
|
+
type: 'static-options';
|
|
1485
|
+
/** 静态选项列表。 */
|
|
1486
|
+
options: OptionItem[];
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* 远程选项数据源。
|
|
1490
|
+
*
|
|
1491
|
+
* source 是业务数据源标识,由 DataAdapter 或 hooks.resolveOptions 解释。
|
|
1492
|
+
*/
|
|
1493
|
+
export interface RemoteOptionsDataSource {
|
|
1494
|
+
/** 数据源类型。 */
|
|
1495
|
+
type: 'remote-options';
|
|
1496
|
+
/** 业务数据源标识,例如 category.options。 */
|
|
1497
|
+
source: string;
|
|
1498
|
+
/** 请求参数。 */
|
|
1499
|
+
params?: Record<string, unknown>;
|
|
1500
|
+
}
|
|
1501
|
+
/** 数据字典数据源。 */
|
|
1502
|
+
export interface DictionaryOptionsDataSource {
|
|
1503
|
+
type: 'dictionary';
|
|
1504
|
+
/** 数据字典模块中的稳定字典编码。 */
|
|
1505
|
+
code: string;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* 资源引用候选项数据源。
|
|
1509
|
+
*/
|
|
1510
|
+
export interface ReferenceDataSource {
|
|
1511
|
+
/** 数据源类型。 */
|
|
1512
|
+
type: 'reference';
|
|
1513
|
+
/** 关联资源编码。 */
|
|
1514
|
+
resource: string;
|
|
1515
|
+
/** 选项值字段。 */
|
|
1516
|
+
value_field: string;
|
|
1517
|
+
/** 选项标签字段。 */
|
|
1518
|
+
label_field: string;
|
|
1519
|
+
/** 搜索字段。 */
|
|
1520
|
+
search_field?: string;
|
|
1521
|
+
/** 禁用状态字段。 */
|
|
1522
|
+
disabled_field?: string;
|
|
1523
|
+
/** 父级字段。树形关联选项会用到。 */
|
|
1524
|
+
parent_field?: string;
|
|
1525
|
+
/** 候选项分组稳定值字段。 */
|
|
1526
|
+
group_field?: string;
|
|
1527
|
+
/** 候选项分组展示名称字段。 */
|
|
1528
|
+
group_label_field?: string;
|
|
1529
|
+
/** 候选项补充说明字段。 */
|
|
1530
|
+
description_field?: string;
|
|
1531
|
+
/** 需要随选项一并返回的元信息字段。 */
|
|
1532
|
+
meta_fields?: string[];
|
|
1533
|
+
/** 固定过滤条件。 */
|
|
1534
|
+
filters?: FieldOptionFilterConfig[];
|
|
1535
|
+
/** 固定排序配置。 */
|
|
1536
|
+
sorts?: FieldOptionSortConfig[];
|
|
1537
|
+
/** 单次查询数量。 */
|
|
1538
|
+
limit?: number;
|
|
1539
|
+
/** 加载模式。paged 表示搜索分页,tree 表示树形懒加载,all 表示显式全量。 */
|
|
1540
|
+
load_mode?: 'paged' | 'tree' | 'all';
|
|
1541
|
+
/** 附加参数。 */
|
|
1542
|
+
params?: Record<string, unknown>;
|
|
1543
|
+
}
|
|
1544
|
+
/** 普通候选项允许保存的 JSON 标量值。 */
|
|
1545
|
+
export type OptionValue = string | number | boolean;
|
|
1546
|
+
/** 候选项分组。 */
|
|
1547
|
+
export interface OptionGroup {
|
|
1548
|
+
/** 分组稳定值。 */
|
|
1549
|
+
value: OptionValue;
|
|
1550
|
+
/** 分组展示名称。 */
|
|
1551
|
+
label: string;
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* 选项项。
|
|
1555
|
+
*/
|
|
1556
|
+
export interface OptionItem {
|
|
1557
|
+
/** 选项标签。 */
|
|
1558
|
+
label: string;
|
|
1559
|
+
/** 选项值。 */
|
|
1560
|
+
value: OptionValue;
|
|
1561
|
+
/** 是否禁用。 */
|
|
1562
|
+
disabled?: boolean;
|
|
1563
|
+
/** 下拉列表中的补充说明。 */
|
|
1564
|
+
description?: string;
|
|
1565
|
+
/** 所属分组;不支持分组的 UI adapter 可以忽略。 */
|
|
1566
|
+
group?: OptionGroup;
|
|
1567
|
+
/** 子选项。树形选择会用到。 */
|
|
1568
|
+
children?: OptionItem[];
|
|
1569
|
+
/** 父级值。树形选择会用到。 */
|
|
1570
|
+
parent_value?: unknown;
|
|
1571
|
+
/** 是否仍有子节点。树形懒加载会用到。 */
|
|
1572
|
+
has_children?: boolean;
|
|
1573
|
+
/** 搜索结果路径标签。树形搜索会用到。 */
|
|
1574
|
+
path_labels?: string[];
|
|
1575
|
+
/** 选项附加属性。 */
|
|
1576
|
+
meta?: Record<string, unknown>;
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* relation 候选项结果。
|
|
1580
|
+
*/
|
|
1581
|
+
export interface RelationOptionsResult {
|
|
1582
|
+
/** 当前候选项。 */
|
|
1583
|
+
results: OptionItem[];
|
|
1584
|
+
/** 已选值回显候选项。 */
|
|
1585
|
+
selected?: OptionItem[];
|
|
1586
|
+
/** 符合条件的总数量。 */
|
|
1587
|
+
total?: number;
|
|
1588
|
+
/** 当前页码。 */
|
|
1589
|
+
page?: number;
|
|
1590
|
+
/** 当前分页大小。 */
|
|
1591
|
+
limit?: number;
|
|
1592
|
+
/** 是否还有更多候选项。 */
|
|
1593
|
+
has_more?: boolean;
|
|
1594
|
+
/** 附加信息。 */
|
|
1595
|
+
meta?: Record<string, unknown>;
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* 稳定条件协议支持的字段操作符。
|
|
1599
|
+
*/
|
|
1600
|
+
export type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'in' | 'not_in' | 'empty' | 'not_empty';
|
|
1601
|
+
/**
|
|
1602
|
+
* 条件表达式。
|
|
1603
|
+
*
|
|
1604
|
+
* 简单条件使用 field/op/value;组合条件使用 all/any/not。
|
|
1605
|
+
* expr 是预留的受限表达式字段,运行时实现前应通过 diagnostics 明确提示不支持。
|
|
1606
|
+
*/
|
|
1607
|
+
export interface Condition {
|
|
1608
|
+
/** 全部子条件成立。 */
|
|
1609
|
+
all?: Condition[];
|
|
1610
|
+
/** 任一子条件成立。 */
|
|
1611
|
+
any?: Condition[];
|
|
1612
|
+
/** 子条件不成立。 */
|
|
1613
|
+
not?: Condition;
|
|
1614
|
+
/** 字段名。 */
|
|
1615
|
+
field?: string;
|
|
1616
|
+
/** 操作符,例如 eq、neq、contains、in。缺失时按 eq 处理。 */
|
|
1617
|
+
op?: ConditionOperator;
|
|
1618
|
+
/** 比较值。 */
|
|
1619
|
+
value?: unknown;
|
|
1620
|
+
/** selection 为空。常用于批量按钮禁用。 */
|
|
1621
|
+
selection_empty?: boolean;
|
|
1622
|
+
/** 受限表达式。 */
|
|
1623
|
+
expr?: string;
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* 值计算表达式类型。
|
|
1627
|
+
*
|
|
1628
|
+
* literal 返回静态值;field/path 从表达式上下文读取值;template 做字符串插值;
|
|
1629
|
+
* concat/sum 聚合子表达式或字段;now/today 等时间函数复用 FieldValueExpression 的时间输出约定。
|
|
1630
|
+
*/
|
|
1631
|
+
export type ValueExpressionType = 'literal' | 'field' | 'path' | 'template' | 'concat' | 'sum' | 'now' | 'today' | 'start_of_day' | 'end_of_day' | 'start_of_month' | 'end_of_month' | string;
|
|
1632
|
+
/**
|
|
1633
|
+
* 值计算表达式。
|
|
1634
|
+
*
|
|
1635
|
+
* 该协议是受限结构化表达式,不执行任意 JavaScript。消费端只能解释明确支持的 type。
|
|
1636
|
+
*/
|
|
1637
|
+
export interface ValueExpression {
|
|
1638
|
+
/** 表达式类型,例如 field、template、sum。 */
|
|
1639
|
+
type: ValueExpressionType;
|
|
1640
|
+
/** literal 使用的静态值。 */
|
|
1641
|
+
value?: unknown;
|
|
1642
|
+
/** field 表达式读取当前表单字段值。 */
|
|
1643
|
+
field?: string;
|
|
1644
|
+
/** path 表达式读取表达式上下文路径,例如 form.amount、row.price、payload.parentValue。 */
|
|
1645
|
+
path?: string;
|
|
1646
|
+
/** template 表达式使用的字符串模板,例如 "${form.first_name} ${form.last_name}"。 */
|
|
1647
|
+
template?: string;
|
|
1648
|
+
/** concat 等组合表达式使用的子表达式。 */
|
|
1649
|
+
items?: ValueExpression[];
|
|
1650
|
+
/** sum 等字段聚合表达式使用的当前表单字段集合。 */
|
|
1651
|
+
fields?: string[];
|
|
1652
|
+
/** concat 输出时使用的分隔符。 */
|
|
1653
|
+
separator?: string;
|
|
1654
|
+
/** 时间类表达式的偏移量。 */
|
|
1655
|
+
offset?: FieldValueExpressionOffset;
|
|
1656
|
+
/** 时间类表达式输出格式。 */
|
|
1657
|
+
format?: 'date' | 'datetime' | 'time' | 'timestamp' | string;
|
|
1658
|
+
/** 时间类表达式使用的时区。 */
|
|
1659
|
+
timezone?: string;
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* 展示格式化配置。
|
|
1663
|
+
*/
|
|
1664
|
+
export interface FormatConfig {
|
|
1665
|
+
/** 格式化类型。 */
|
|
1666
|
+
type: 'datetime' | 'date' | 'time' | 'number' | 'currency' | 'percent' | 'enum' | 'custom' | string;
|
|
1667
|
+
/** 日期时间格式或自定义格式模板。 */
|
|
1668
|
+
pattern?: string;
|
|
1669
|
+
/** 货币代码,例如 CNY。 */
|
|
1670
|
+
currency?: string;
|
|
1671
|
+
/** 格式化器附加属性。 */
|
|
1672
|
+
props?: Record<string, unknown>;
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* SparqView 支持的渲染模式。
|
|
1676
|
+
*/
|
|
1677
|
+
export type RenderMode = 'page' | 'form' | 'table' | 'search' | 'detail';
|
|
1678
|
+
//# sourceMappingURL=types.d.ts.map
|