@qingflow-tech/qingflow-cli 1.1.43-beta.3 → 1.1.43-beta.4
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/README.md +3 -3
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/skills/qingflow-app-form/SKILL.md +7 -5
- package/skills/qingflow-cli/reference/builder/30-schema-fields.md +14 -13
- package/src/qingflow_mcp/app_form_compat.py +11 -27
- package/src/qingflow_mcp/app_form_validator.py +201 -35
- package/src/qingflow_mcp/builder_facade/app_form.py +762 -148
- package/src/qingflow_mcp/builder_facade/app_form_schema.py +114 -3
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +310 -245
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +85 -32
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +82 -30
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +113 -37
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +87 -64
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +83 -28
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +83 -28
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +85 -32
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +95 -40
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +100 -28
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +212 -117
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +82 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +143 -161
- package/src/qingflow_mcp/builder_facade/service.py +3 -2
- package/src/qingflow_mcp/response_trim.py +2 -0
- package/src/qingflow_mcp/server_app_builder.py +2 -2
|
@@ -2,7 +2,28 @@
|
|
|
2
2
|
"$defs": {
|
|
3
3
|
"CodeBlockBinding": {
|
|
4
4
|
"additionalProperties": false,
|
|
5
|
-
"
|
|
5
|
+
"allOf": [
|
|
6
|
+
{
|
|
7
|
+
"if": {
|
|
8
|
+
"properties": {
|
|
9
|
+
"outputs": {
|
|
10
|
+
"minItems": 1
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"required": [
|
|
14
|
+
"outputs"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"then": {
|
|
18
|
+
"properties": {
|
|
19
|
+
"code": {
|
|
20
|
+
"pattern": "(^|[^A-Za-z0-9_$])qf_output\\s*=(?!=)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"description": "代码块的输入、代码和输出映射;配置 outputs 时,代码必须显式给 qf_output 赋值,仅 return 对象不会产生可回写结果。每个输出目标还必须满足应用级唯一性规则,不能与任何代码块或 Q-Linker 的其他输出指向同一实际字段。多个生产方需要回写时,请选择不同目标字段或合并为一个生产方。",
|
|
6
27
|
"properties": {
|
|
7
28
|
"autoTrigger": {
|
|
8
29
|
"description": "是否在输入变化时自动执行代码块。",
|
|
@@ -12,7 +33,7 @@
|
|
|
12
33
|
]
|
|
13
34
|
},
|
|
14
35
|
"code": {
|
|
15
|
-
"description": "
|
|
36
|
+
"description": "业务代码源码;MCP/CLI 仅保存,不执行。inputs 声明的 var 会由 Builder 自动注入。配置 outputs 时必须显式赋值 qf_output,例如 qf_output = { score: input.score };,仅 return 对象或比较 qf_output 不会回写。",
|
|
16
37
|
"minLength": 1,
|
|
17
38
|
"type": "string"
|
|
18
39
|
},
|
|
@@ -38,14 +59,14 @@
|
|
|
38
59
|
]
|
|
39
60
|
},
|
|
40
61
|
"inputs": {
|
|
41
|
-
"description": "当前表单字段到代码变量的映射。",
|
|
62
|
+
"description": "当前表单字段到代码变量的映射。Builder 会在保存时自动生成读取 qf_field 的代码前缀;业务 code 直接使用 var,不要手写 qf_field.{字段名$$ID$$}。",
|
|
42
63
|
"items": {
|
|
43
64
|
"$ref": "#/$defs/CodeBlockInputBinding"
|
|
44
65
|
},
|
|
45
66
|
"type": "array"
|
|
46
67
|
},
|
|
47
68
|
"outputs": {
|
|
48
|
-
"description": "
|
|
69
|
+
"description": "代码输出路径到目标字段的映射;每个 path 必须从代码显式赋值的 qf_output 中读取,且所有 targetField 在整个应用的代码块和 Q-Linker 输出中必须全局唯一。",
|
|
49
70
|
"items": {
|
|
50
71
|
"$ref": "#/$defs/CodeBlockOutputBinding"
|
|
51
72
|
},
|
|
@@ -72,14 +93,14 @@
|
|
|
72
93
|
},
|
|
73
94
|
"CodeBlockInputBinding": {
|
|
74
95
|
"additionalProperties": false,
|
|
75
|
-
"description": "
|
|
96
|
+
"description": "一个表单字段到代码变量的映射;Builder 自动生成后端字段读取前缀。",
|
|
76
97
|
"properties": {
|
|
77
98
|
"field": {
|
|
78
99
|
"$ref": "#/$defs/FieldSelector",
|
|
79
100
|
"description": "输入来源字段。"
|
|
80
101
|
},
|
|
81
102
|
"var": {
|
|
82
|
-
"description": "
|
|
103
|
+
"description": "业务 code 中直接使用的 JavaScript 变量名;null 表示由 Builder 生成合法且唯一的变量名。",
|
|
83
104
|
"type": [
|
|
84
105
|
"string",
|
|
85
106
|
"null"
|
|
@@ -93,7 +114,7 @@
|
|
|
93
114
|
},
|
|
94
115
|
"CodeBlockOutputBinding": {
|
|
95
116
|
"additionalProperties": false,
|
|
96
|
-
"description": "
|
|
117
|
+
"description": "一个代码输出值到表单字段的映射;同一实际目标字段在整个应用中只能被一个代码块或 Q-Linker 输出映射写入。",
|
|
97
118
|
"properties": {
|
|
98
119
|
"alias": {
|
|
99
120
|
"description": "输出别名;用于后续数据关联引用。",
|
|
@@ -101,7 +122,7 @@
|
|
|
101
122
|
"type": "string"
|
|
102
123
|
},
|
|
103
124
|
"aliasId": {
|
|
104
|
-
"description": "后端生成的输出别名 ID
|
|
125
|
+
"description": "后端生成的输出别名 ID;新增输出时省略,Builder 在首次写入后按 alias 与 path 自动回填再保存关系。更新已有输出时必须保留 get 返回值,不得自行编造或置空。",
|
|
105
126
|
"minimum": 1,
|
|
106
127
|
"type": "integer"
|
|
107
128
|
},
|
|
@@ -112,7 +133,7 @@
|
|
|
112
133
|
},
|
|
113
134
|
"targetField": {
|
|
114
135
|
"$ref": "#/$defs/FieldSelector",
|
|
115
|
-
"description": "
|
|
136
|
+
"description": "接收结果的当前表单字段;该字段在整个应用的全部代码块和 Q-Linker outputs 中只能作为 targetField 出现一次,不得被多个输出关系重复写入。"
|
|
116
137
|
}
|
|
117
138
|
},
|
|
118
139
|
"required": [
|
|
@@ -123,15 +144,71 @@
|
|
|
123
144
|
"type": "object"
|
|
124
145
|
},
|
|
125
146
|
"FieldCommon": {
|
|
147
|
+
"allOf": [
|
|
148
|
+
{
|
|
149
|
+
"if": {
|
|
150
|
+
"properties": {
|
|
151
|
+
"defaultType": {
|
|
152
|
+
"const": 2
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"required": [
|
|
156
|
+
"defaultType"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"then": {
|
|
160
|
+
"properties": {
|
|
161
|
+
"defaultValue": {
|
|
162
|
+
"type": "null"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"if": {
|
|
169
|
+
"properties": {
|
|
170
|
+
"defaultType": {
|
|
171
|
+
"const": 3
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"required": [
|
|
175
|
+
"defaultType"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"then": {
|
|
179
|
+
"properties": {
|
|
180
|
+
"defaultValue": {
|
|
181
|
+
"minLength": 1,
|
|
182
|
+
"type": [
|
|
183
|
+
"string",
|
|
184
|
+
"null"
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"anyOf": [
|
|
192
|
+
{
|
|
193
|
+
"required": [
|
|
194
|
+
"queId"
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"required": [
|
|
199
|
+
"name"
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
],
|
|
126
203
|
"description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
|
|
127
204
|
"properties": {
|
|
128
|
-
"
|
|
129
|
-
"description": "
|
|
205
|
+
"beingRequired": {
|
|
206
|
+
"description": "该字段是否必填;缺失时保留已有字段当前值。",
|
|
130
207
|
"type": "boolean"
|
|
131
208
|
},
|
|
132
209
|
"defaultType": {
|
|
133
210
|
"default": 1,
|
|
134
|
-
"description": "
|
|
211
|
+
"description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
|
|
135
212
|
"enum": [
|
|
136
213
|
1,
|
|
137
214
|
2,
|
|
@@ -141,39 +218,40 @@
|
|
|
141
218
|
},
|
|
142
219
|
"defaultValue": {
|
|
143
220
|
"$ref": "#/$defs/ScalarDefaultValue",
|
|
144
|
-
"description": "
|
|
145
|
-
},
|
|
146
|
-
"description": {
|
|
147
|
-
"description": "字段说明;null 或空字符串表示清空。",
|
|
148
|
-
"type": [
|
|
149
|
-
"string",
|
|
150
|
-
"null"
|
|
151
|
-
]
|
|
221
|
+
"description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
|
|
152
222
|
},
|
|
153
223
|
"name": {
|
|
154
|
-
"description": "
|
|
224
|
+
"description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
|
|
155
225
|
"minLength": 1,
|
|
156
226
|
"type": "string"
|
|
157
227
|
},
|
|
158
228
|
"queId": {
|
|
159
|
-
"description": "已有字段的后端 ID
|
|
229
|
+
"description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
|
|
160
230
|
"minimum": 1,
|
|
161
231
|
"type": "integer"
|
|
162
232
|
},
|
|
163
|
-
"
|
|
164
|
-
"description": "
|
|
165
|
-
"type":
|
|
233
|
+
"questionDescription": {
|
|
234
|
+
"description": "字段说明;null 或空字符串表示清空。",
|
|
235
|
+
"type": [
|
|
236
|
+
"string",
|
|
237
|
+
"null"
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
"questionType": {
|
|
241
|
+
"description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
|
|
242
|
+
"type": "string"
|
|
166
243
|
},
|
|
167
244
|
"width": {
|
|
168
|
-
"description": "
|
|
169
|
-
"
|
|
170
|
-
|
|
245
|
+
"description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
|
|
246
|
+
"enum": [
|
|
247
|
+
25,
|
|
248
|
+
50,
|
|
249
|
+
75,
|
|
250
|
+
100
|
|
251
|
+
],
|
|
171
252
|
"type": "integer"
|
|
172
253
|
}
|
|
173
254
|
},
|
|
174
|
-
"required": [
|
|
175
|
-
"name"
|
|
176
|
-
],
|
|
177
255
|
"type": "object"
|
|
178
256
|
},
|
|
179
257
|
"FieldSelector": {
|
|
@@ -190,7 +268,7 @@
|
|
|
190
268
|
]
|
|
191
269
|
}
|
|
192
270
|
],
|
|
193
|
-
"description": "
|
|
271
|
+
"description": "字段选择器;用于定位应用的数据标题、数据封面、自定义编号取值来源或其他配置引用的字段。至少提供 queId 或 name,两者同时提供时必须指向同一字段。",
|
|
194
272
|
"properties": {
|
|
195
273
|
"name": {
|
|
196
274
|
"description": "字段名称;仅在当前作用域内唯一时可用于解析。",
|
|
@@ -206,11 +284,9 @@
|
|
|
206
284
|
"type": "object"
|
|
207
285
|
},
|
|
208
286
|
"ScalarDefaultValue": {
|
|
209
|
-
"description": "
|
|
287
|
+
"description": "后端 queDefaultValue 支持的普通字段默认值;非空值必须是字符串,显式 null 表示清除默认值。数字和布尔值应先转换为字符串,对象和数组必须使用字段专用默认值配置。需要配置结构化默认值时,通过 AppForm Schema 查询能力传入当前 schema_version,并将字段的 questionType 作为 field_type 获取该字段类型的详细 Schema,再按其中的字段专用 config 定义填写。",
|
|
210
288
|
"type": [
|
|
211
289
|
"null",
|
|
212
|
-
"boolean",
|
|
213
|
-
"number",
|
|
214
290
|
"string"
|
|
215
291
|
]
|
|
216
292
|
}
|
|
@@ -226,12 +302,12 @@
|
|
|
226
302
|
"config": {
|
|
227
303
|
"$ref": "#/$defs/CodeBlockConfig"
|
|
228
304
|
},
|
|
229
|
-
"
|
|
305
|
+
"questionType": {
|
|
230
306
|
"const": "code_block"
|
|
231
307
|
}
|
|
232
308
|
},
|
|
233
309
|
"required": [
|
|
234
|
-
"
|
|
310
|
+
"questionType",
|
|
235
311
|
"config"
|
|
236
312
|
]
|
|
237
313
|
}
|
|
@@ -15,14 +15,11 @@
|
|
|
15
15
|
"type": "string"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"required": [
|
|
19
|
-
"name"
|
|
20
|
-
],
|
|
21
18
|
"type": "object"
|
|
22
19
|
},
|
|
23
20
|
"DataRelationCondition": {
|
|
24
21
|
"additionalProperties": false,
|
|
25
|
-
"description": "
|
|
22
|
+
"description": "一条数据关联过滤条件;sourceField 必须属于数据来源,operator 必须适用于该字段类型。固定值请使用 literal operand,不要直接声明后端 matchRules。",
|
|
26
23
|
"properties": {
|
|
27
24
|
"operand": {
|
|
28
25
|
"$ref": "#/$defs/DataRelationOperand",
|
|
@@ -148,7 +145,7 @@
|
|
|
148
145
|
]
|
|
149
146
|
},
|
|
150
147
|
"DataRelationFilters": {
|
|
151
|
-
"description": "simple 模式的外层组为 OR、组内条件为 AND;advanced 模式使用完整公式。",
|
|
148
|
+
"description": "simple 模式的外层组为 OR、组内条件为 AND;advanced 模式使用完整公式。simple 条件只声明业务值,builder 会生成后端保存所需的 judgeValues 和 judgeValueDetails,不要在声明中直接填写这两个后端属性。",
|
|
152
149
|
"oneOf": [
|
|
153
150
|
{
|
|
154
151
|
"additionalProperties": false,
|
|
@@ -204,9 +201,9 @@
|
|
|
204
201
|
"const": "literal"
|
|
205
202
|
},
|
|
206
203
|
"values": {
|
|
207
|
-
"description": "
|
|
204
|
+
"description": "固定比较值列表;值必须使用字符串。选择类来源字段填写已有选项的展示文本,builder 会在 apply 时解析为后端 optId;解析不到会在写入前报错。is_empty/is_not_empty 必须传空数组,其他运算符至少传一项。",
|
|
208
205
|
"items": {
|
|
209
|
-
"
|
|
206
|
+
"type": "string"
|
|
210
207
|
},
|
|
211
208
|
"type": "array"
|
|
212
209
|
}
|
|
@@ -409,15 +406,71 @@
|
|
|
409
406
|
]
|
|
410
407
|
},
|
|
411
408
|
"FieldCommon": {
|
|
409
|
+
"allOf": [
|
|
410
|
+
{
|
|
411
|
+
"if": {
|
|
412
|
+
"properties": {
|
|
413
|
+
"defaultType": {
|
|
414
|
+
"const": 2
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"required": [
|
|
418
|
+
"defaultType"
|
|
419
|
+
]
|
|
420
|
+
},
|
|
421
|
+
"then": {
|
|
422
|
+
"properties": {
|
|
423
|
+
"defaultValue": {
|
|
424
|
+
"type": "null"
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"if": {
|
|
431
|
+
"properties": {
|
|
432
|
+
"defaultType": {
|
|
433
|
+
"const": 3
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"required": [
|
|
437
|
+
"defaultType"
|
|
438
|
+
]
|
|
439
|
+
},
|
|
440
|
+
"then": {
|
|
441
|
+
"properties": {
|
|
442
|
+
"defaultValue": {
|
|
443
|
+
"minLength": 1,
|
|
444
|
+
"type": [
|
|
445
|
+
"string",
|
|
446
|
+
"null"
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
],
|
|
453
|
+
"anyOf": [
|
|
454
|
+
{
|
|
455
|
+
"required": [
|
|
456
|
+
"queId"
|
|
457
|
+
]
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"required": [
|
|
461
|
+
"name"
|
|
462
|
+
]
|
|
463
|
+
}
|
|
464
|
+
],
|
|
412
465
|
"description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
|
|
413
466
|
"properties": {
|
|
414
|
-
"
|
|
415
|
-
"description": "
|
|
467
|
+
"beingRequired": {
|
|
468
|
+
"description": "该字段是否必填;缺失时保留已有字段当前值。",
|
|
416
469
|
"type": "boolean"
|
|
417
470
|
},
|
|
418
471
|
"defaultType": {
|
|
419
472
|
"default": 1,
|
|
420
|
-
"description": "
|
|
473
|
+
"description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
|
|
421
474
|
"enum": [
|
|
422
475
|
1,
|
|
423
476
|
2,
|
|
@@ -427,39 +480,40 @@
|
|
|
427
480
|
},
|
|
428
481
|
"defaultValue": {
|
|
429
482
|
"$ref": "#/$defs/ScalarDefaultValue",
|
|
430
|
-
"description": "
|
|
431
|
-
},
|
|
432
|
-
"description": {
|
|
433
|
-
"description": "字段说明;null 或空字符串表示清空。",
|
|
434
|
-
"type": [
|
|
435
|
-
"string",
|
|
436
|
-
"null"
|
|
437
|
-
]
|
|
483
|
+
"description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
|
|
438
484
|
},
|
|
439
485
|
"name": {
|
|
440
|
-
"description": "
|
|
486
|
+
"description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
|
|
441
487
|
"minLength": 1,
|
|
442
488
|
"type": "string"
|
|
443
489
|
},
|
|
444
490
|
"queId": {
|
|
445
|
-
"description": "已有字段的后端 ID
|
|
491
|
+
"description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
|
|
446
492
|
"minimum": 1,
|
|
447
493
|
"type": "integer"
|
|
448
494
|
},
|
|
449
|
-
"
|
|
450
|
-
"description": "
|
|
451
|
-
"type":
|
|
495
|
+
"questionDescription": {
|
|
496
|
+
"description": "字段说明;null 或空字符串表示清空。",
|
|
497
|
+
"type": [
|
|
498
|
+
"string",
|
|
499
|
+
"null"
|
|
500
|
+
]
|
|
501
|
+
},
|
|
502
|
+
"questionType": {
|
|
503
|
+
"description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
|
|
504
|
+
"type": "string"
|
|
452
505
|
},
|
|
453
506
|
"width": {
|
|
454
|
-
"description": "
|
|
455
|
-
"
|
|
456
|
-
|
|
507
|
+
"description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
|
|
508
|
+
"enum": [
|
|
509
|
+
25,
|
|
510
|
+
50,
|
|
511
|
+
75,
|
|
512
|
+
100
|
|
513
|
+
],
|
|
457
514
|
"type": "integer"
|
|
458
515
|
}
|
|
459
516
|
},
|
|
460
|
-
"required": [
|
|
461
|
-
"name"
|
|
462
|
-
],
|
|
463
517
|
"type": "object"
|
|
464
518
|
},
|
|
465
519
|
"FieldSelector": {
|
|
@@ -476,7 +530,7 @@
|
|
|
476
530
|
]
|
|
477
531
|
}
|
|
478
532
|
],
|
|
479
|
-
"description": "
|
|
533
|
+
"description": "字段选择器;用于定位应用的数据标题、数据封面、自定义编号取值来源或其他配置引用的字段。至少提供 queId 或 name,两者同时提供时必须指向同一字段。",
|
|
480
534
|
"properties": {
|
|
481
535
|
"name": {
|
|
482
536
|
"description": "字段名称;仅在当前作用域内唯一时可用于解析。",
|
|
@@ -491,41 +545,10 @@
|
|
|
491
545
|
},
|
|
492
546
|
"type": "object"
|
|
493
547
|
},
|
|
494
|
-
"JsonValue": {
|
|
495
|
-
"description": "数据关联字面量支持的任意 JSON 值。",
|
|
496
|
-
"oneOf": [
|
|
497
|
-
{
|
|
498
|
-
"type": "null"
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
"type": "boolean"
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
"type": "number"
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
"type": "string"
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
"items": {
|
|
511
|
-
"$ref": "#/$defs/JsonValue"
|
|
512
|
-
},
|
|
513
|
-
"type": "array"
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
"additionalProperties": {
|
|
517
|
-
"$ref": "#/$defs/JsonValue"
|
|
518
|
-
},
|
|
519
|
-
"type": "object"
|
|
520
|
-
}
|
|
521
|
-
]
|
|
522
|
-
},
|
|
523
548
|
"ScalarDefaultValue": {
|
|
524
|
-
"description": "
|
|
549
|
+
"description": "后端 queDefaultValue 支持的普通字段默认值;非空值必须是字符串,显式 null 表示清除默认值。数字和布尔值应先转换为字符串,对象和数组必须使用字段专用默认值配置。需要配置结构化默认值时,通过 AppForm Schema 查询能力传入当前 schema_version,并将字段的 questionType 作为 field_type 获取该字段类型的详细 Schema,再按其中的字段专用 config 定义填写。",
|
|
525
550
|
"type": [
|
|
526
551
|
"null",
|
|
527
|
-
"boolean",
|
|
528
|
-
"number",
|
|
529
552
|
"string"
|
|
530
553
|
]
|
|
531
554
|
}
|
|
@@ -541,12 +564,12 @@
|
|
|
541
564
|
"config": {
|
|
542
565
|
"$ref": "#/$defs/DataRelationConfig"
|
|
543
566
|
},
|
|
544
|
-
"
|
|
567
|
+
"questionType": {
|
|
545
568
|
"const": "data_relation"
|
|
546
569
|
}
|
|
547
570
|
},
|
|
548
571
|
"required": [
|
|
549
|
-
"
|
|
572
|
+
"questionType",
|
|
550
573
|
"config"
|
|
551
574
|
]
|
|
552
575
|
}
|
|
@@ -6,15 +6,71 @@
|
|
|
6
6
|
"type": "object"
|
|
7
7
|
},
|
|
8
8
|
"FieldCommon": {
|
|
9
|
+
"allOf": [
|
|
10
|
+
{
|
|
11
|
+
"if": {
|
|
12
|
+
"properties": {
|
|
13
|
+
"defaultType": {
|
|
14
|
+
"const": 2
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": [
|
|
18
|
+
"defaultType"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"then": {
|
|
22
|
+
"properties": {
|
|
23
|
+
"defaultValue": {
|
|
24
|
+
"type": "null"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"if": {
|
|
31
|
+
"properties": {
|
|
32
|
+
"defaultType": {
|
|
33
|
+
"const": 3
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"defaultType"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"then": {
|
|
41
|
+
"properties": {
|
|
42
|
+
"defaultValue": {
|
|
43
|
+
"minLength": 1,
|
|
44
|
+
"type": [
|
|
45
|
+
"string",
|
|
46
|
+
"null"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"anyOf": [
|
|
54
|
+
{
|
|
55
|
+
"required": [
|
|
56
|
+
"queId"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"required": [
|
|
61
|
+
"name"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
],
|
|
9
65
|
"description": "顶层业务字段的公共属性;字段类型由 TopField 的判别分支定义。",
|
|
10
66
|
"properties": {
|
|
11
|
-
"
|
|
12
|
-
"description": "
|
|
67
|
+
"beingRequired": {
|
|
68
|
+
"description": "该字段是否必填;缺失时保留已有字段当前值。",
|
|
13
69
|
"type": "boolean"
|
|
14
70
|
},
|
|
15
71
|
"defaultType": {
|
|
16
72
|
"default": 1,
|
|
17
|
-
"description": "
|
|
73
|
+
"description": "默认值类型,与 defaultValue 联动;1 表示静态值,2 表示关联/绑定值且 defaultValue 只能省略或为 null,3 表示公式值且提供 defaultValue 时必须为非空公式文本。省略 defaultType 但提供 defaultValue 时按 1 处理。",
|
|
18
74
|
"enum": [
|
|
19
75
|
1,
|
|
20
76
|
2,
|
|
@@ -24,47 +80,46 @@
|
|
|
24
80
|
},
|
|
25
81
|
"defaultValue": {
|
|
26
82
|
"$ref": "#/$defs/ScalarDefaultValue",
|
|
27
|
-
"description": "
|
|
28
|
-
},
|
|
29
|
-
"description": {
|
|
30
|
-
"description": "字段说明;null 或空字符串表示清空。",
|
|
31
|
-
"type": [
|
|
32
|
-
"string",
|
|
33
|
-
"null"
|
|
34
|
-
]
|
|
83
|
+
"description": "普通字段的默认值;后端 queDefaultValue 为字符串,因此数字等字面量也必须以字符串传入。defaultType 为 1 时表示静态文本,为 3 时表示公式文本,为 2 时不携带字面量默认值。表格、地址、附件、引用等结构化默认值必须放在具体字段 config.defaultValues。显式 null 表示清除默认值。"
|
|
35
84
|
},
|
|
36
85
|
"name": {
|
|
37
|
-
"description": "
|
|
86
|
+
"description": "字段展示名称;新增字段必填,已有字段可在携带 queId 时省略;同一父级内唯一。",
|
|
38
87
|
"minLength": 1,
|
|
39
88
|
"type": "string"
|
|
40
89
|
},
|
|
41
90
|
"queId": {
|
|
42
|
-
"description": "已有字段的后端 ID
|
|
91
|
+
"description": "已有字段的后端 ID;更新时用于精确定位并复用,新增字段通常省略。",
|
|
43
92
|
"minimum": 1,
|
|
44
93
|
"type": "integer"
|
|
45
94
|
},
|
|
46
|
-
"
|
|
47
|
-
"description": "
|
|
48
|
-
"type":
|
|
95
|
+
"questionDescription": {
|
|
96
|
+
"description": "字段说明;null 或空字符串表示清空。",
|
|
97
|
+
"type": [
|
|
98
|
+
"string",
|
|
99
|
+
"null"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"questionType": {
|
|
103
|
+
"description": "字段类型;具体可用值由当前字段详情 Schema 的判别分支约束。",
|
|
104
|
+
"type": "string"
|
|
49
105
|
},
|
|
50
106
|
"width": {
|
|
51
|
-
"description": "
|
|
52
|
-
"
|
|
53
|
-
|
|
107
|
+
"description": "字段在所在行的宽度百分比;只能选择 25、50、75 或 100。",
|
|
108
|
+
"enum": [
|
|
109
|
+
25,
|
|
110
|
+
50,
|
|
111
|
+
75,
|
|
112
|
+
100
|
|
113
|
+
],
|
|
54
114
|
"type": "integer"
|
|
55
115
|
}
|
|
56
116
|
},
|
|
57
|
-
"required": [
|
|
58
|
-
"name"
|
|
59
|
-
],
|
|
60
117
|
"type": "object"
|
|
61
118
|
},
|
|
62
119
|
"ScalarDefaultValue": {
|
|
63
|
-
"description": "
|
|
120
|
+
"description": "后端 queDefaultValue 支持的普通字段默认值;非空值必须是字符串,显式 null 表示清除默认值。数字和布尔值应先转换为字符串,对象和数组必须使用字段专用默认值配置。需要配置结构化默认值时,通过 AppForm Schema 查询能力传入当前 schema_version,并将字段的 questionType 作为 field_type 获取该字段类型的详细 Schema,再按其中的字段专用 config 定义填写。",
|
|
64
121
|
"type": [
|
|
65
122
|
"null",
|
|
66
|
-
"boolean",
|
|
67
|
-
"number",
|
|
68
123
|
"string"
|
|
69
124
|
]
|
|
70
125
|
}
|
|
@@ -80,12 +135,12 @@
|
|
|
80
135
|
"config": {
|
|
81
136
|
"$ref": "#/$defs/EmptyConfig"
|
|
82
137
|
},
|
|
83
|
-
"
|
|
138
|
+
"questionType": {
|
|
84
139
|
"const": "date"
|
|
85
140
|
}
|
|
86
141
|
},
|
|
87
142
|
"required": [
|
|
88
|
-
"
|
|
143
|
+
"questionType"
|
|
89
144
|
]
|
|
90
145
|
}
|
|
91
146
|
],
|