@dckj-npm/dc-material 0.1.376 → 0.1.378
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/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/custom-form/requirements.html +48 -0
- package/build/docs/custom-form.html +48 -0
- package/build/docs/index.html +3 -3
- package/build/docs/teletext-list.html +3 -3
- package/build/docs/{umi.6743fcd4.css → umi.b31e14a3.css} +1 -1
- package/build/docs/umi.e6e366c9.js +1 -0
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/docs/~demos/teletext-list-demo-1.html +3 -3
- package/build/docs/~demos/teletext-list-demo.html +3 -3
- package/build/lowcode/assets-daily.json +13 -13
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +2 -2
- package/dist/BizComps.js.map +1 -1
- package/es/components/custom-form/CUSTOM_FORM_OPERATION_MANUAL.md +284 -0
- package/es/components/custom-form/custom-form.d.ts +168 -2
- package/es/components/custom-form/custom-form.js +444 -24
- package/es/components/custom-form/index.d.ts +1 -1
- package/es/components/custom-form/index.scss +1 -1
- package/es/components/custom-form/schema.json +1374 -0
- package/es/components/teletext-list/teletext-list-item.d.ts +14 -77
- package/es/components/teletext-list/teletext-list-item.js +153 -165
- package/es/components/teletext-list/teletext-list-item.scss +53 -4
- package/es/components/teletext-list/teletext-list.d.ts +60 -4
- package/es/components/teletext-list/teletext-list.js +55 -37
- package/lib/components/custom-form/CUSTOM_FORM_OPERATION_MANUAL.md +284 -0
- package/lib/components/custom-form/custom-form.d.ts +168 -2
- package/lib/components/custom-form/custom-form.js +449 -29
- package/lib/components/custom-form/index.d.ts +1 -1
- package/lib/components/custom-form/index.scss +1 -1
- package/lib/components/custom-form/schema.json +1374 -0
- package/lib/components/teletext-list/teletext-list-item.d.ts +14 -77
- package/lib/components/teletext-list/teletext-list-item.js +153 -164
- package/lib/components/teletext-list/teletext-list-item.scss +53 -4
- package/lib/components/teletext-list/teletext-list.d.ts +60 -4
- package/lib/components/teletext-list/teletext-list.js +55 -37
- package/lowcode/custom-form/meta.ts +1500 -118
- package/lowcode/teletext-list/meta.ts +457 -703
- package/lowcode/teletext-list/meta.ts.bak +821 -0
- package/lowcode_es/custom-form/meta.js +1932 -144
- package/lowcode_es/meta.js +1 -1
- package/lowcode_es/teletext-list/meta.js +689 -598
- package/lowcode_es/teletext-list/meta.ts.bak +821 -0
- package/lowcode_lib/custom-form/meta.js +1932 -144
- package/lowcode_lib/meta.js +1 -1
- package/lowcode_lib/teletext-list/meta.js +689 -598
- package/lowcode_lib/teletext-list/meta.ts.bak +821 -0
- package/package.json +3 -3
- package/build/docs/umi.d20b1d99.js +0 -1
|
@@ -19,59 +19,203 @@ var CustomFormMeta = {
|
|
|
19
19
|
component: {
|
|
20
20
|
isContainer: true
|
|
21
21
|
},
|
|
22
|
-
props: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
label: '三列',
|
|
36
|
-
value: 3
|
|
37
|
-
}, {
|
|
38
|
-
label: '四列',
|
|
39
|
-
value: 4
|
|
40
|
-
}],
|
|
41
|
-
options: [{
|
|
42
|
-
label: '一列',
|
|
43
|
-
value: 1
|
|
44
|
-
}, {
|
|
45
|
-
label: '二列',
|
|
46
|
-
value: 2
|
|
47
|
-
}, {
|
|
48
|
-
label: '三列',
|
|
49
|
-
value: 3
|
|
50
|
-
}, {
|
|
51
|
-
label: '四列',
|
|
52
|
-
value: 4
|
|
53
|
-
}]
|
|
22
|
+
props: [
|
|
23
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
24
|
+
// 分组一:全局布局
|
|
25
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
26
|
+
{
|
|
27
|
+
type: 'group',
|
|
28
|
+
title: '全局布局',
|
|
29
|
+
name: 'layoutGroup',
|
|
30
|
+
display: 'accordion',
|
|
31
|
+
items: [{
|
|
32
|
+
title: {
|
|
33
|
+
label: '列数',
|
|
34
|
+
tip: '表单的整体列数,所有表单项按此列数排列。\n单列适合简单表单,多列适合信息密集的编辑页面。'
|
|
54
35
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
36
|
+
name: 'columns',
|
|
37
|
+
setter: {
|
|
38
|
+
componentName: 'RadioGroupSetter',
|
|
39
|
+
props: {
|
|
40
|
+
options: [{
|
|
41
|
+
title: '一列',
|
|
42
|
+
value: 1
|
|
43
|
+
}, {
|
|
44
|
+
title: '二列',
|
|
45
|
+
value: 2
|
|
46
|
+
}, {
|
|
47
|
+
title: '三列',
|
|
48
|
+
value: 3
|
|
49
|
+
}, {
|
|
50
|
+
title: '四列',
|
|
51
|
+
value: 4
|
|
52
|
+
}]
|
|
53
|
+
},
|
|
54
|
+
initialValue: 1
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
title: {
|
|
58
|
+
label: '标签位置',
|
|
59
|
+
tip: '表单标签相对于输入框的位置:\n· 顶部(top):标签在输入框上方,适合移动端或字段较多时\n· 左侧(left):标签在输入框左侧,传统表单样式,配合「标签宽度」使用\n· 内嵌(inset):标签显示在输入框内部,输入时标签浮动到上方'
|
|
60
|
+
},
|
|
61
|
+
name: 'labelAlign',
|
|
62
|
+
setter: {
|
|
63
|
+
componentName: 'RadioGroupSetter',
|
|
64
|
+
props: {
|
|
65
|
+
options: [{
|
|
66
|
+
title: '顶部',
|
|
67
|
+
value: 'top'
|
|
68
|
+
}, {
|
|
69
|
+
title: '左侧',
|
|
70
|
+
value: 'left'
|
|
71
|
+
}, {
|
|
72
|
+
title: '内嵌',
|
|
73
|
+
value: 'inset'
|
|
74
|
+
}]
|
|
75
|
+
},
|
|
76
|
+
initialValue: 'top'
|
|
77
|
+
},
|
|
78
|
+
extraProps: {
|
|
79
|
+
setValue: function setValue(target, value) {
|
|
80
|
+
if (value === 'left') {
|
|
81
|
+
target.getProps().setPropValue('labelCol', {
|
|
82
|
+
fixedSpan: 4
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
target.getProps().setPropValue('labelCol', null);
|
|
86
|
+
}
|
|
87
|
+
target.getProps().setPropValue('labelAlign', value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
title: {
|
|
92
|
+
label: '标签宽度',
|
|
93
|
+
tip: '当标签位置为「左侧」时,设置标签列的固定宽度(格宫列数,1~24)。\nJSON 示例:{ "fixedSpan": 6 } 意为标签占 6 格。\n不填则自动宽度。常用值:4(短标签)、6(中等标签)、8(长标签)'
|
|
94
|
+
},
|
|
95
|
+
name: 'labelCol.fixedSpan',
|
|
96
|
+
condition: function condition(target) {
|
|
97
|
+
return target.getProps().getPropValue('labelAlign') === 'left';
|
|
98
|
+
},
|
|
99
|
+
setter: {
|
|
100
|
+
componentName: 'NumberSetter',
|
|
101
|
+
props: {
|
|
102
|
+
min: 1,
|
|
103
|
+
max: 12
|
|
104
|
+
},
|
|
105
|
+
initialValue: 4
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
title: {
|
|
109
|
+
label: '行间距',
|
|
110
|
+
tip: '每行表单项之间的上下间距(像素)。\n默认 0。建议设为 8~16px 让表单更舒适。'
|
|
111
|
+
},
|
|
112
|
+
name: '!rowGap',
|
|
113
|
+
extraProps: {
|
|
114
|
+
getValue: function getValue(target) {
|
|
115
|
+
var _sp$;
|
|
116
|
+
var sp = target.getProps().getPropValue('spacing');
|
|
117
|
+
return Array.isArray(sp) ? (_sp$ = sp[0]) !== null && _sp$ !== void 0 ? _sp$ : 0 : 0;
|
|
118
|
+
},
|
|
119
|
+
setValue: function setValue(target, value) {
|
|
120
|
+
var _sp$2;
|
|
121
|
+
var sp = target.getProps().getPropValue('spacing');
|
|
122
|
+
var colGap = Array.isArray(sp) ? (_sp$2 = sp[1]) !== null && _sp$2 !== void 0 ? _sp$2 : 16 : 16;
|
|
123
|
+
target.getProps().setPropValue('spacing', [value, colGap]);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
setter: {
|
|
127
|
+
componentName: 'NumberSetter',
|
|
128
|
+
props: {
|
|
129
|
+
min: 0,
|
|
130
|
+
max: 100
|
|
131
|
+
},
|
|
132
|
+
initialValue: 0
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
title: {
|
|
136
|
+
label: '列间距',
|
|
137
|
+
tip: '多列表单中各列之间的左右间距(像素)。\n默认 16px。单列表单中此设置无明显效果。'
|
|
138
|
+
},
|
|
139
|
+
name: '!colGap',
|
|
140
|
+
extraProps: {
|
|
141
|
+
getValue: function getValue(target) {
|
|
142
|
+
var _sp$3;
|
|
143
|
+
var sp = target.getProps().getPropValue('spacing');
|
|
144
|
+
return Array.isArray(sp) ? (_sp$3 = sp[1]) !== null && _sp$3 !== void 0 ? _sp$3 : 16 : 16;
|
|
145
|
+
},
|
|
146
|
+
setValue: function setValue(target, value) {
|
|
147
|
+
var _sp$4;
|
|
148
|
+
var sp = target.getProps().getPropValue('spacing');
|
|
149
|
+
var rowGap = Array.isArray(sp) ? (_sp$4 = sp[0]) !== null && _sp$4 !== void 0 ? _sp$4 : 0 : 0;
|
|
150
|
+
target.getProps().setPropValue('spacing', [rowGap, value]);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
setter: {
|
|
154
|
+
componentName: 'NumberSetter',
|
|
155
|
+
props: {
|
|
156
|
+
min: 0,
|
|
157
|
+
max: 100
|
|
158
|
+
},
|
|
159
|
+
initialValue: 16
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
title: {
|
|
163
|
+
label: '组件宽度占满',
|
|
164
|
+
tip: '全局控制所有表单项的输入组件是否撑满容器宽度(100%)。\n开启后相当为每个表单项设置 fullWidth=true。\n单个表单项的「宽度占满」设置优先级更高,可覆盖此全局值。'
|
|
165
|
+
},
|
|
166
|
+
name: 'fullWidth',
|
|
167
|
+
setter: {
|
|
168
|
+
componentName: 'BoolSetter',
|
|
169
|
+
initialValue: true
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
title: {
|
|
173
|
+
label: '表单状态',
|
|
174
|
+
tip: '编辑态:正常填写表单。\n只读态:所有输入框变为纯文本显示,空值显示"—"。\n常用于"查看详情"场景,绑定变量可动态切换编辑/只读。'
|
|
175
|
+
},
|
|
176
|
+
name: '!status',
|
|
177
|
+
extraProps: {
|
|
178
|
+
getValue: function getValue(target) {
|
|
179
|
+
return target.getProps().getPropValue('isPreview') ? 'readonly' : 'editable';
|
|
180
|
+
},
|
|
181
|
+
setValue: function setValue(target, value) {
|
|
182
|
+
target.getProps().setPropValue('isPreview', value === 'readonly');
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
setter: {
|
|
186
|
+
componentName: 'RadioGroupSetter',
|
|
187
|
+
props: {
|
|
188
|
+
options: [{
|
|
189
|
+
title: '编辑',
|
|
190
|
+
value: 'editable'
|
|
191
|
+
}, {
|
|
192
|
+
title: '只读',
|
|
193
|
+
value: 'readonly'
|
|
194
|
+
}]
|
|
195
|
+
},
|
|
196
|
+
initialValue: 'editable'
|
|
197
|
+
}
|
|
198
|
+
}, {
|
|
199
|
+
title: {
|
|
200
|
+
label: '空态文案',
|
|
201
|
+
tip: '当没有任何表单项时展示的提示文字。'
|
|
202
|
+
},
|
|
203
|
+
name: 'emptyContent',
|
|
204
|
+
setter: {
|
|
205
|
+
componentName: 'StringSetter',
|
|
206
|
+
isRequired: false,
|
|
207
|
+
initialValue: '添加表单项'
|
|
208
|
+
}
|
|
209
|
+
}]
|
|
210
|
+
},
|
|
211
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
212
|
+
// 分组二:表单项配置
|
|
213
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
214
|
+
{
|
|
215
|
+
title: {
|
|
216
|
+
label: '表单项',
|
|
217
|
+
tip: '配置表单中每一行的字段。\n每个表单项需要填写「字段名」和「标题」,其余可选。\n字段名(field)是提交数据时的 key,需要与后端接口字段名保持一致。'
|
|
218
|
+
},
|
|
75
219
|
name: 'formItems',
|
|
76
220
|
setter: {
|
|
77
221
|
componentName: 'ArraySetter',
|
|
@@ -80,8 +224,13 @@ var CustomFormMeta = {
|
|
|
80
224
|
componentName: 'ObjectSetter',
|
|
81
225
|
props: {
|
|
82
226
|
config: {
|
|
83
|
-
items: [
|
|
84
|
-
|
|
227
|
+
items: [
|
|
228
|
+
// ── 基础
|
|
229
|
+
{
|
|
230
|
+
title: {
|
|
231
|
+
label: '字段名',
|
|
232
|
+
tip: '必填。提交表单时该字段的 key 名称,需与后端接口字段名一致。\n例如:user_name、phone、banquet_date'
|
|
233
|
+
},
|
|
85
234
|
name: 'field',
|
|
86
235
|
setter: {
|
|
87
236
|
componentName: 'StringSetter',
|
|
@@ -89,58 +238,131 @@ var CustomFormMeta = {
|
|
|
89
238
|
initialValue: ''
|
|
90
239
|
}
|
|
91
240
|
}, {
|
|
92
|
-
title:
|
|
241
|
+
title: {
|
|
242
|
+
label: '标题',
|
|
243
|
+
tip: '表单项左侧(或上方)显示的文字标签。\n例如:姓名、手机号、宴请日期'
|
|
244
|
+
},
|
|
93
245
|
name: 'label',
|
|
246
|
+
important: true,
|
|
247
|
+
display: 'inline',
|
|
94
248
|
setter: {
|
|
95
249
|
componentName: 'StringSetter',
|
|
96
250
|
isRequired: false,
|
|
97
251
|
initialValue: ''
|
|
98
252
|
}
|
|
99
253
|
}, {
|
|
100
|
-
title:
|
|
254
|
+
title: {
|
|
255
|
+
label: '必填',
|
|
256
|
+
tip: '开启后标题旁显示红色星号,并在提交时自动校验该字段不能为空。'
|
|
257
|
+
},
|
|
101
258
|
name: 'required',
|
|
102
259
|
setter: {
|
|
103
260
|
componentName: 'BoolSetter',
|
|
104
261
|
isRequired: false,
|
|
105
262
|
initialValue: false
|
|
106
263
|
}
|
|
107
|
-
},
|
|
108
|
-
|
|
264
|
+
},
|
|
265
|
+
// ── 组件类型
|
|
266
|
+
{
|
|
267
|
+
title: {
|
|
268
|
+
label: '组件类型',
|
|
269
|
+
tip: '选择该字段使用哪种输入控件:\n· 输入框(Input):单行文本,最常用\n· 多行文本(TextArea):适合备注、描述\n· 下拉选择(Select):从预设选项中选一个\n· 单选组(RadioGroup):横排单选按钮\n· 复选组(CheckboxGroup):多选框\n· 数字输入(NumberPicker):带加减按钮的数字\n· 日期选择(DatePicker):日历弹出选日期\n· 上传(Upload):文件/图片上传'
|
|
270
|
+
},
|
|
109
271
|
name: 'componentType',
|
|
272
|
+
important: true,
|
|
273
|
+
display: 'inline',
|
|
110
274
|
setter: {
|
|
111
275
|
componentName: 'SelectSetter',
|
|
112
276
|
props: {
|
|
113
277
|
options: [{
|
|
114
|
-
label: '输入框',
|
|
278
|
+
label: '输入框 (Input)',
|
|
115
279
|
value: 'Input'
|
|
116
280
|
}, {
|
|
117
|
-
label: '多行文本',
|
|
281
|
+
label: '多行文本 (TextArea)',
|
|
118
282
|
value: 'TextArea'
|
|
119
283
|
}, {
|
|
120
|
-
label: '下拉选择',
|
|
284
|
+
label: '下拉选择 (Select)',
|
|
121
285
|
value: 'Select'
|
|
122
286
|
}, {
|
|
123
|
-
label: '单选组',
|
|
287
|
+
label: '单选组 (RadioGroup)',
|
|
124
288
|
value: 'RadioGroup'
|
|
125
289
|
}, {
|
|
126
|
-
label: '复选组',
|
|
290
|
+
label: '复选组 (CheckboxGroup)',
|
|
127
291
|
value: 'CheckboxGroup'
|
|
128
292
|
}, {
|
|
129
|
-
label: '数字输入',
|
|
293
|
+
label: '数字输入 (NumberPicker)',
|
|
130
294
|
value: 'NumberPicker'
|
|
131
295
|
}, {
|
|
132
|
-
label: '日期选择',
|
|
296
|
+
label: '日期选择 (DatePicker)',
|
|
133
297
|
value: 'DatePicker'
|
|
134
298
|
}, {
|
|
135
|
-
label: '
|
|
299
|
+
label: '日期时间 (DateTimePicker)',
|
|
300
|
+
value: 'DateTimePicker'
|
|
301
|
+
}, {
|
|
302
|
+
label: '上传 (Upload)',
|
|
136
303
|
value: 'Upload'
|
|
137
304
|
}]
|
|
138
305
|
},
|
|
139
306
|
initialValue: 'Input'
|
|
140
307
|
}
|
|
141
|
-
},
|
|
142
|
-
|
|
308
|
+
},
|
|
309
|
+
// ── 输入提示(仅对支持 placeholder 的组件显示)
|
|
310
|
+
{
|
|
311
|
+
title: {
|
|
312
|
+
label: '输入提示',
|
|
313
|
+
tip: '显示在输入框内的灰色提示文字(placeholder)。\n例如:请输入姓名、请选择日期'
|
|
314
|
+
},
|
|
315
|
+
name: 'placeholder',
|
|
316
|
+
condition: function condition(target) {
|
|
317
|
+
var _target$parent, _target$parent$getPro;
|
|
318
|
+
var t = ((_target$parent = target.parent) === null || _target$parent === void 0 ? void 0 : (_target$parent$getPro = _target$parent.getPropValue) === null || _target$parent$getPro === void 0 ? void 0 : _target$parent$getPro.call(_target$parent, 'componentType')) || 'Input';
|
|
319
|
+
return !['Upload', 'RadioGroup', 'CheckboxGroup'].includes(t);
|
|
320
|
+
},
|
|
321
|
+
setter: {
|
|
322
|
+
componentName: 'StringSetter',
|
|
323
|
+
isRequired: false,
|
|
324
|
+
initialValue: ''
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
// ── 默认值
|
|
328
|
+
{
|
|
329
|
+
title: {
|
|
330
|
+
label: '默认值',
|
|
331
|
+
tip: '该字段的初始默认值,表单打开时自动填入。\n· 文本类型填写字符串,例如:待处理\n· 数字类型填写数字,例如:0\n· 日期类型填写格式化字符串,例如:2026-01-01\n· 下拉/单选填写选项的 value 值,例如:male\n· 复选框填写数组,例如:["a","b"]\n\n优先级高于"全局初始值"(initialValues)中同名字段。'
|
|
332
|
+
},
|
|
333
|
+
name: 'initialValue',
|
|
334
|
+
setter: {
|
|
335
|
+
componentName: 'MixedSetter',
|
|
336
|
+
props: {
|
|
337
|
+
setters: [{
|
|
338
|
+
componentName: 'StringSetter',
|
|
339
|
+
title: '字符串'
|
|
340
|
+
}, {
|
|
341
|
+
componentName: 'NumberSetter',
|
|
342
|
+
title: '数字'
|
|
343
|
+
}, {
|
|
344
|
+
componentName: 'BoolSetter',
|
|
345
|
+
title: '布尔'
|
|
346
|
+
}, {
|
|
347
|
+
componentName: 'JsonSetter',
|
|
348
|
+
title: 'JSON(数组/对象)'
|
|
349
|
+
}]
|
|
350
|
+
},
|
|
351
|
+
isRequired: false
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
// ── 选项(下拉/单选/复选)
|
|
355
|
+
{
|
|
356
|
+
title: {
|
|
357
|
+
label: '选项列表',
|
|
358
|
+
tip: '仅在组件类型为「下拉选择」「单选组」「复选组」时生效。\n每个选项需配置:\n· 名称(label):界面上显示的文字,例如:男\n· 值(value):提交时实际传给后端的值,例如:male'
|
|
359
|
+
},
|
|
143
360
|
name: 'options',
|
|
361
|
+
condition: function condition(target) {
|
|
362
|
+
var _target$parent2, _target$parent2$getPr, _target$parent3, _target$parent3$paren, _target$parent3$paren2;
|
|
363
|
+
var t = ((_target$parent2 = target.parent) === null || _target$parent2 === void 0 ? void 0 : (_target$parent2$getPr = _target$parent2.getPropValue) === null || _target$parent2$getPr === void 0 ? void 0 : _target$parent2$getPr.call(_target$parent2, 'componentType')) || ((_target$parent3 = target.parent) === null || _target$parent3 === void 0 ? void 0 : (_target$parent3$paren = _target$parent3.parent) === null || _target$parent3$paren === void 0 ? void 0 : (_target$parent3$paren2 = _target$parent3$paren.getPropValue) === null || _target$parent3$paren2 === void 0 ? void 0 : _target$parent3$paren2.call(_target$parent3$paren, 'componentType'));
|
|
364
|
+
return ['Select', 'RadioGroup', 'CheckboxGroup'].includes(t);
|
|
365
|
+
},
|
|
144
366
|
setter: {
|
|
145
367
|
componentName: 'ArraySetter',
|
|
146
368
|
props: {
|
|
@@ -149,7 +371,10 @@ var CustomFormMeta = {
|
|
|
149
371
|
props: {
|
|
150
372
|
config: {
|
|
151
373
|
items: [{
|
|
152
|
-
title:
|
|
374
|
+
title: {
|
|
375
|
+
label: '名称',
|
|
376
|
+
tip: '选项显示的文字'
|
|
377
|
+
},
|
|
153
378
|
name: 'label',
|
|
154
379
|
setter: {
|
|
155
380
|
componentName: 'StringSetter',
|
|
@@ -157,7 +382,10 @@ var CustomFormMeta = {
|
|
|
157
382
|
initialValue: ''
|
|
158
383
|
}
|
|
159
384
|
}, {
|
|
160
|
-
title:
|
|
385
|
+
title: {
|
|
386
|
+
label: '值',
|
|
387
|
+
tip: '提交时传给后端的实际值'
|
|
388
|
+
},
|
|
161
389
|
name: 'value',
|
|
162
390
|
setter: {
|
|
163
391
|
componentName: 'StringSetter',
|
|
@@ -171,129 +399,1689 @@ var CustomFormMeta = {
|
|
|
171
399
|
},
|
|
172
400
|
initialValue: []
|
|
173
401
|
}
|
|
174
|
-
},
|
|
175
|
-
|
|
402
|
+
},
|
|
403
|
+
// ── 动态选项绑定(阶段二)
|
|
404
|
+
{
|
|
405
|
+
title: {
|
|
406
|
+
label: '动态选项绑定',
|
|
407
|
+
tip: '仅在组件类型为「下拉选择」「单选组」「复选组」时生效。\n绑定后优先级高于上方「选项列表」(静态配置)。\n支持绑定页面变量或数据源返回的数组,数组格式为 [{label, value}, ...]。\n常见用法:将套餐列表、城市列表等接口数据直接绑定到选项。'
|
|
408
|
+
},
|
|
409
|
+
name: 'optionsBind',
|
|
410
|
+
condition: function condition(target) {
|
|
411
|
+
var _target$parent4, _target$parent4$getPr, _target$parent5, _target$parent5$paren, _target$parent5$paren2;
|
|
412
|
+
var t = ((_target$parent4 = target.parent) === null || _target$parent4 === void 0 ? void 0 : (_target$parent4$getPr = _target$parent4.getPropValue) === null || _target$parent4$getPr === void 0 ? void 0 : _target$parent4$getPr.call(_target$parent4, 'componentType')) || ((_target$parent5 = target.parent) === null || _target$parent5 === void 0 ? void 0 : (_target$parent5$paren = _target$parent5.parent) === null || _target$parent5$paren === void 0 ? void 0 : (_target$parent5$paren2 = _target$parent5$paren.getPropValue) === null || _target$parent5$paren2 === void 0 ? void 0 : _target$parent5$paren2.call(_target$parent5$paren, 'componentType'));
|
|
413
|
+
return ['Select', 'RadioGroup', 'CheckboxGroup'].includes(t);
|
|
414
|
+
},
|
|
415
|
+
setter: {
|
|
416
|
+
componentName: 'SetterFormVariable',
|
|
417
|
+
props: {
|
|
418
|
+
attributes: [{
|
|
419
|
+
label: '选项数据',
|
|
420
|
+
value: 'optionsBind',
|
|
421
|
+
children: [{
|
|
422
|
+
label: '显示文字',
|
|
423
|
+
isRequire: true,
|
|
424
|
+
value: 'label'
|
|
425
|
+
}, {
|
|
426
|
+
label: '选项值',
|
|
427
|
+
isRequire: true,
|
|
428
|
+
value: 'value'
|
|
429
|
+
}]
|
|
430
|
+
}]
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
// ── 布局
|
|
435
|
+
{
|
|
436
|
+
title: {
|
|
437
|
+
label: '列跨度',
|
|
438
|
+
tip: '该表单项横向占几列(不超过表单总列数)。\n例如总列数为 4,设置为 2 则占一半宽度,设置为 4 则独占一行。'
|
|
439
|
+
},
|
|
176
440
|
name: 'columnSpan',
|
|
441
|
+
setter: {
|
|
442
|
+
componentName: 'RadioGroupSetter',
|
|
443
|
+
props: {
|
|
444
|
+
options: [{
|
|
445
|
+
title: '1格',
|
|
446
|
+
value: 1
|
|
447
|
+
}, {
|
|
448
|
+
title: '2格',
|
|
449
|
+
value: 2
|
|
450
|
+
}, {
|
|
451
|
+
title: '3格',
|
|
452
|
+
value: 3
|
|
453
|
+
}, {
|
|
454
|
+
title: '4格',
|
|
455
|
+
value: 4
|
|
456
|
+
}]
|
|
457
|
+
},
|
|
458
|
+
initialValue: 1
|
|
459
|
+
}
|
|
460
|
+
}, {
|
|
461
|
+
title: {
|
|
462
|
+
label: '尺寸',
|
|
463
|
+
tip: '单个表单项的组件尺寸,优先级高于表单全局 size。\n不设置时继承表单全局尺寸(默认 medium)。'
|
|
464
|
+
},
|
|
465
|
+
name: 'size',
|
|
466
|
+
setter: {
|
|
467
|
+
componentName: 'RadioGroupSetter',
|
|
468
|
+
props: {
|
|
469
|
+
options: [{
|
|
470
|
+
title: '小',
|
|
471
|
+
value: 'small'
|
|
472
|
+
}, {
|
|
473
|
+
title: '中',
|
|
474
|
+
value: 'medium'
|
|
475
|
+
}, {
|
|
476
|
+
title: '大',
|
|
477
|
+
value: 'large'
|
|
478
|
+
}]
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}, {
|
|
482
|
+
title: {
|
|
483
|
+
label: '宽度占满',
|
|
484
|
+
tip: '开启后该表单项的输入组件宽度为 100%,撑满所在列的宽度。\n默认开启,通常不需要关闭。'
|
|
485
|
+
},
|
|
486
|
+
name: 'fullWidth',
|
|
487
|
+
setter: {
|
|
488
|
+
componentName: 'BoolSetter',
|
|
489
|
+
initialValue: true
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
// ── 提示信息
|
|
493
|
+
{
|
|
494
|
+
title: {
|
|
495
|
+
label: '错误提示',
|
|
496
|
+
tip: '校验失败时显示的自定义错误文字,涵盖必填为空与正则/格式不匹配两种情况。\n不填则由组件自动生成,例如"xxx 不能为空"或"格式不正确"。\n示例:请输入正确的 11 位手机号'
|
|
497
|
+
},
|
|
498
|
+
name: '!helpMsg',
|
|
499
|
+
extraProps: {
|
|
500
|
+
getValue: function getValue(target) {
|
|
501
|
+
var _target$parent6, _target$parent6$getPr, _target$parent7, _target$parent7$getPr, _target$parent7$getPr2;
|
|
502
|
+
return ((_target$parent6 = target.parent) === null || _target$parent6 === void 0 ? void 0 : (_target$parent6$getPr = _target$parent6.getPropValue) === null || _target$parent6$getPr === void 0 ? void 0 : _target$parent6$getPr.call(_target$parent6, 'help')) || ((_target$parent7 = target.parent) === null || _target$parent7 === void 0 ? void 0 : (_target$parent7$getPr = _target$parent7.getPropValue) === null || _target$parent7$getPr === void 0 ? void 0 : (_target$parent7$getPr2 = _target$parent7$getPr.call(_target$parent7, 'formItemProps')) === null || _target$parent7$getPr2 === void 0 ? void 0 : _target$parent7$getPr2.requiredMessage) || '';
|
|
503
|
+
},
|
|
504
|
+
setValue: function setValue(target, value) {
|
|
505
|
+
var _target$parent8, _target$parent8$setPr, _target$parent9, _target$parent9$getPr, _target$parent0, _target$parent0$setPr;
|
|
506
|
+
(_target$parent8 = target.parent) === null || _target$parent8 === void 0 ? void 0 : (_target$parent8$setPr = _target$parent8.setPropValue) === null || _target$parent8$setPr === void 0 ? void 0 : _target$parent8$setPr.call(_target$parent8, 'help', value || undefined);
|
|
507
|
+
var fp = _extends({}, ((_target$parent9 = target.parent) === null || _target$parent9 === void 0 ? void 0 : (_target$parent9$getPr = _target$parent9.getPropValue) === null || _target$parent9$getPr === void 0 ? void 0 : _target$parent9$getPr.call(_target$parent9, 'formItemProps')) || {});
|
|
508
|
+
if (!value) {
|
|
509
|
+
delete fp.requiredMessage;
|
|
510
|
+
} else {
|
|
511
|
+
fp.requiredMessage = value;
|
|
512
|
+
}
|
|
513
|
+
(_target$parent0 = target.parent) === null || _target$parent0 === void 0 ? void 0 : (_target$parent0$setPr = _target$parent0.setPropValue) === null || _target$parent0$setPr === void 0 ? void 0 : _target$parent0$setPr.call(_target$parent0, 'formItemProps', fp);
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
setter: {
|
|
517
|
+
componentName: 'StringSetter',
|
|
518
|
+
isRequired: false,
|
|
519
|
+
initialValue: ''
|
|
520
|
+
}
|
|
521
|
+
}, {
|
|
522
|
+
title: {
|
|
523
|
+
label: '补充说明',
|
|
524
|
+
tip: '始终显示在输入框下方的灰色提示文字,与错误提示共存,用于告知用户填写要求或格式。\n例如:手机号用于接收预订通知短信'
|
|
525
|
+
},
|
|
526
|
+
name: 'extra',
|
|
527
|
+
setter: {
|
|
528
|
+
componentName: 'StringSetter',
|
|
529
|
+
isRequired: false,
|
|
530
|
+
initialValue: ''
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
// ── 组件属性(结构化,按组件类型分组)
|
|
534
|
+
// ── 通用:禁用
|
|
535
|
+
{
|
|
536
|
+
title: {
|
|
537
|
+
label: '禁用',
|
|
538
|
+
tip: '开启后该输入组件变为禁用状态,用户无法编辑。'
|
|
539
|
+
},
|
|
540
|
+
name: '!disabled',
|
|
541
|
+
condition: function condition(target) {
|
|
542
|
+
var _target$parent1, _target$parent1$getPr;
|
|
543
|
+
var t = ((_target$parent1 = target.parent) === null || _target$parent1 === void 0 ? void 0 : (_target$parent1$getPr = _target$parent1.getPropValue) === null || _target$parent1$getPr === void 0 ? void 0 : _target$parent1$getPr.call(_target$parent1, 'componentType')) || 'Input';
|
|
544
|
+
return !['Upload'].includes(t);
|
|
545
|
+
},
|
|
546
|
+
extraProps: {
|
|
547
|
+
getValue: function getValue(target) {
|
|
548
|
+
var _target$parent10, _target$parent10$getP, _target$parent10$getP2;
|
|
549
|
+
return (_target$parent10 = target.parent) === null || _target$parent10 === void 0 ? void 0 : (_target$parent10$getP = _target$parent10.getPropValue) === null || _target$parent10$getP === void 0 ? void 0 : (_target$parent10$getP2 = _target$parent10$getP.call(_target$parent10, 'componentProps')) === null || _target$parent10$getP2 === void 0 ? void 0 : _target$parent10$getP2.disabled;
|
|
550
|
+
},
|
|
551
|
+
setValue: function setValue(target, value) {
|
|
552
|
+
var _target$parent11, _target$parent11$getP, _target$parent12, _target$parent12$setP;
|
|
553
|
+
var cp = _extends({}, ((_target$parent11 = target.parent) === null || _target$parent11 === void 0 ? void 0 : (_target$parent11$getP = _target$parent11.getPropValue) === null || _target$parent11$getP === void 0 ? void 0 : _target$parent11$getP.call(_target$parent11, 'componentProps')) || {});
|
|
554
|
+
cp.disabled = value;
|
|
555
|
+
(_target$parent12 = target.parent) === null || _target$parent12 === void 0 ? void 0 : (_target$parent12$setP = _target$parent12.setPropValue) === null || _target$parent12$setP === void 0 ? void 0 : _target$parent12$setP.call(_target$parent12, 'componentProps', cp);
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
setter: {
|
|
559
|
+
componentName: 'BoolSetter',
|
|
560
|
+
initialValue: false
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
// ── Input:最大字符数 / 只读
|
|
564
|
+
{
|
|
565
|
+
title: {
|
|
566
|
+
label: '最大字符数',
|
|
567
|
+
tip: '输入框最多允许输入的字符数。\n超出后无法继续输入。配合「显示计数」使用效果更好。'
|
|
568
|
+
},
|
|
569
|
+
name: '!maxLength',
|
|
570
|
+
condition: function condition(target) {
|
|
571
|
+
var _target$parent13, _target$parent13$getP;
|
|
572
|
+
var t = ((_target$parent13 = target.parent) === null || _target$parent13 === void 0 ? void 0 : (_target$parent13$getP = _target$parent13.getPropValue) === null || _target$parent13$getP === void 0 ? void 0 : _target$parent13$getP.call(_target$parent13, 'componentType')) || 'Input';
|
|
573
|
+
return ['Input', 'TextArea'].includes(t);
|
|
574
|
+
},
|
|
575
|
+
extraProps: {
|
|
576
|
+
getValue: function getValue(target) {
|
|
577
|
+
var _target$parent14, _target$parent14$getP, _target$parent14$getP2;
|
|
578
|
+
return (_target$parent14 = target.parent) === null || _target$parent14 === void 0 ? void 0 : (_target$parent14$getP = _target$parent14.getPropValue) === null || _target$parent14$getP === void 0 ? void 0 : (_target$parent14$getP2 = _target$parent14$getP.call(_target$parent14, 'componentProps')) === null || _target$parent14$getP2 === void 0 ? void 0 : _target$parent14$getP2.maxLength;
|
|
579
|
+
},
|
|
580
|
+
setValue: function setValue(target, value) {
|
|
581
|
+
var _target$parent15, _target$parent15$getP, _target$parent16, _target$parent16$setP;
|
|
582
|
+
var cp = _extends({}, ((_target$parent15 = target.parent) === null || _target$parent15 === void 0 ? void 0 : (_target$parent15$getP = _target$parent15.getPropValue) === null || _target$parent15$getP === void 0 ? void 0 : _target$parent15$getP.call(_target$parent15, 'componentProps')) || {});
|
|
583
|
+
if (value === undefined || value === null || value === '') {
|
|
584
|
+
delete cp.maxLength;
|
|
585
|
+
} else {
|
|
586
|
+
cp.maxLength = value;
|
|
587
|
+
}
|
|
588
|
+
(_target$parent16 = target.parent) === null || _target$parent16 === void 0 ? void 0 : (_target$parent16$setP = _target$parent16.setPropValue) === null || _target$parent16$setP === void 0 ? void 0 : _target$parent16$setP.call(_target$parent16, 'componentProps', cp);
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
setter: {
|
|
592
|
+
componentName: 'NumberSetter',
|
|
593
|
+
props: {
|
|
594
|
+
min: 1
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}, {
|
|
598
|
+
title: {
|
|
599
|
+
label: '显示计数',
|
|
600
|
+
tip: '开启后在输入框右下角显示"已输入/最大字符数"计数器。\n需配合「最大字符数」使用。'
|
|
601
|
+
},
|
|
602
|
+
name: '!hasLimitHint',
|
|
603
|
+
condition: function condition(target) {
|
|
604
|
+
var _target$parent17, _target$parent17$getP;
|
|
605
|
+
var t = ((_target$parent17 = target.parent) === null || _target$parent17 === void 0 ? void 0 : (_target$parent17$getP = _target$parent17.getPropValue) === null || _target$parent17$getP === void 0 ? void 0 : _target$parent17$getP.call(_target$parent17, 'componentType')) || 'Input';
|
|
606
|
+
return ['Input', 'TextArea'].includes(t);
|
|
607
|
+
},
|
|
608
|
+
extraProps: {
|
|
609
|
+
getValue: function getValue(target) {
|
|
610
|
+
var _target$parent18, _target$parent18$getP, _target$parent18$getP2;
|
|
611
|
+
return (_target$parent18 = target.parent) === null || _target$parent18 === void 0 ? void 0 : (_target$parent18$getP = _target$parent18.getPropValue) === null || _target$parent18$getP === void 0 ? void 0 : (_target$parent18$getP2 = _target$parent18$getP.call(_target$parent18, 'componentProps')) === null || _target$parent18$getP2 === void 0 ? void 0 : _target$parent18$getP2.hasLimitHint;
|
|
612
|
+
},
|
|
613
|
+
setValue: function setValue(target, value) {
|
|
614
|
+
var _target$parent19, _target$parent19$getP, _target$parent20, _target$parent20$setP;
|
|
615
|
+
var cp = _extends({}, ((_target$parent19 = target.parent) === null || _target$parent19 === void 0 ? void 0 : (_target$parent19$getP = _target$parent19.getPropValue) === null || _target$parent19$getP === void 0 ? void 0 : _target$parent19$getP.call(_target$parent19, 'componentProps')) || {});
|
|
616
|
+
cp.hasLimitHint = value;
|
|
617
|
+
(_target$parent20 = target.parent) === null || _target$parent20 === void 0 ? void 0 : (_target$parent20$setP = _target$parent20.setPropValue) === null || _target$parent20$setP === void 0 ? void 0 : _target$parent20$setP.call(_target$parent20, 'componentProps', cp);
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
setter: {
|
|
621
|
+
componentName: 'BoolSetter',
|
|
622
|
+
initialValue: false
|
|
623
|
+
}
|
|
624
|
+
}, {
|
|
625
|
+
title: {
|
|
626
|
+
label: '只读',
|
|
627
|
+
tip: '开启后输入框内容不可编辑(与禁用不同,只读不改变样式)。\n常用于"自动计算填入"的字段,如套餐价格。'
|
|
628
|
+
},
|
|
629
|
+
name: '!readOnly',
|
|
630
|
+
condition: function condition(target) {
|
|
631
|
+
var _target$parent21, _target$parent21$getP;
|
|
632
|
+
var t = ((_target$parent21 = target.parent) === null || _target$parent21 === void 0 ? void 0 : (_target$parent21$getP = _target$parent21.getPropValue) === null || _target$parent21$getP === void 0 ? void 0 : _target$parent21$getP.call(_target$parent21, 'componentType')) || 'Input';
|
|
633
|
+
return ['Input', 'TextArea'].includes(t);
|
|
634
|
+
},
|
|
635
|
+
extraProps: {
|
|
636
|
+
getValue: function getValue(target) {
|
|
637
|
+
var _target$parent22, _target$parent22$getP, _target$parent22$getP2;
|
|
638
|
+
return (_target$parent22 = target.parent) === null || _target$parent22 === void 0 ? void 0 : (_target$parent22$getP = _target$parent22.getPropValue) === null || _target$parent22$getP === void 0 ? void 0 : (_target$parent22$getP2 = _target$parent22$getP.call(_target$parent22, 'componentProps')) === null || _target$parent22$getP2 === void 0 ? void 0 : _target$parent22$getP2.readOnly;
|
|
639
|
+
},
|
|
640
|
+
setValue: function setValue(target, value) {
|
|
641
|
+
var _target$parent23, _target$parent23$getP, _target$parent24, _target$parent24$setP;
|
|
642
|
+
var cp = _extends({}, ((_target$parent23 = target.parent) === null || _target$parent23 === void 0 ? void 0 : (_target$parent23$getP = _target$parent23.getPropValue) === null || _target$parent23$getP === void 0 ? void 0 : _target$parent23$getP.call(_target$parent23, 'componentProps')) || {});
|
|
643
|
+
cp.readOnly = value;
|
|
644
|
+
(_target$parent24 = target.parent) === null || _target$parent24 === void 0 ? void 0 : (_target$parent24$setP = _target$parent24.setPropValue) === null || _target$parent24$setP === void 0 ? void 0 : _target$parent24$setP.call(_target$parent24, 'componentProps', cp);
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
setter: {
|
|
648
|
+
componentName: 'BoolSetter',
|
|
649
|
+
initialValue: false
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
// ── TextArea:行数
|
|
653
|
+
{
|
|
654
|
+
title: {
|
|
655
|
+
label: '显示行数',
|
|
656
|
+
tip: '多行文本框默认显示的行数(高度)。默认 4 行。'
|
|
657
|
+
},
|
|
658
|
+
name: '!rows',
|
|
659
|
+
condition: function condition(target) {
|
|
660
|
+
var _target$parent25, _target$parent25$getP;
|
|
661
|
+
return ((_target$parent25 = target.parent) === null || _target$parent25 === void 0 ? void 0 : (_target$parent25$getP = _target$parent25.getPropValue) === null || _target$parent25$getP === void 0 ? void 0 : _target$parent25$getP.call(_target$parent25, 'componentType')) === 'TextArea';
|
|
662
|
+
},
|
|
663
|
+
extraProps: {
|
|
664
|
+
getValue: function getValue(target) {
|
|
665
|
+
var _target$parent26, _target$parent26$getP, _target$parent26$getP2;
|
|
666
|
+
return (_target$parent26 = target.parent) === null || _target$parent26 === void 0 ? void 0 : (_target$parent26$getP = _target$parent26.getPropValue) === null || _target$parent26$getP === void 0 ? void 0 : (_target$parent26$getP2 = _target$parent26$getP.call(_target$parent26, 'componentProps')) === null || _target$parent26$getP2 === void 0 ? void 0 : _target$parent26$getP2.rows;
|
|
667
|
+
},
|
|
668
|
+
setValue: function setValue(target, value) {
|
|
669
|
+
var _target$parent27, _target$parent27$getP, _target$parent28, _target$parent28$setP;
|
|
670
|
+
var cp = _extends({}, ((_target$parent27 = target.parent) === null || _target$parent27 === void 0 ? void 0 : (_target$parent27$getP = _target$parent27.getPropValue) === null || _target$parent27$getP === void 0 ? void 0 : _target$parent27$getP.call(_target$parent27, 'componentProps')) || {});
|
|
671
|
+
cp.rows = value;
|
|
672
|
+
(_target$parent28 = target.parent) === null || _target$parent28 === void 0 ? void 0 : (_target$parent28$setP = _target$parent28.setPropValue) === null || _target$parent28$setP === void 0 ? void 0 : _target$parent28$setP.call(_target$parent28, 'componentProps', cp);
|
|
673
|
+
}
|
|
674
|
+
},
|
|
177
675
|
setter: {
|
|
178
676
|
componentName: 'NumberSetter',
|
|
179
677
|
props: {
|
|
180
678
|
min: 1,
|
|
181
|
-
max:
|
|
679
|
+
max: 20
|
|
680
|
+
},
|
|
681
|
+
initialValue: 4
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
// ── NumberPicker:范围 / 步长 / 精度
|
|
685
|
+
{
|
|
686
|
+
title: {
|
|
687
|
+
label: '最小值',
|
|
688
|
+
tip: '数字输入框允许输入的最小值。'
|
|
689
|
+
},
|
|
690
|
+
name: '!min',
|
|
691
|
+
condition: function condition(target) {
|
|
692
|
+
var _target$parent29, _target$parent29$getP;
|
|
693
|
+
return ((_target$parent29 = target.parent) === null || _target$parent29 === void 0 ? void 0 : (_target$parent29$getP = _target$parent29.getPropValue) === null || _target$parent29$getP === void 0 ? void 0 : _target$parent29$getP.call(_target$parent29, 'componentType')) === 'NumberPicker';
|
|
694
|
+
},
|
|
695
|
+
extraProps: {
|
|
696
|
+
getValue: function getValue(target) {
|
|
697
|
+
var _target$parent30, _target$parent30$getP, _target$parent30$getP2;
|
|
698
|
+
return (_target$parent30 = target.parent) === null || _target$parent30 === void 0 ? void 0 : (_target$parent30$getP = _target$parent30.getPropValue) === null || _target$parent30$getP === void 0 ? void 0 : (_target$parent30$getP2 = _target$parent30$getP.call(_target$parent30, 'componentProps')) === null || _target$parent30$getP2 === void 0 ? void 0 : _target$parent30$getP2.min;
|
|
699
|
+
},
|
|
700
|
+
setValue: function setValue(target, value) {
|
|
701
|
+
var _target$parent31, _target$parent31$getP, _target$parent32, _target$parent32$setP;
|
|
702
|
+
var cp = _extends({}, ((_target$parent31 = target.parent) === null || _target$parent31 === void 0 ? void 0 : (_target$parent31$getP = _target$parent31.getPropValue) === null || _target$parent31$getP === void 0 ? void 0 : _target$parent31$getP.call(_target$parent31, 'componentProps')) || {});
|
|
703
|
+
if (value === undefined || value === null || value === '') delete cp.min;else cp.min = value;
|
|
704
|
+
(_target$parent32 = target.parent) === null || _target$parent32 === void 0 ? void 0 : (_target$parent32$setP = _target$parent32.setPropValue) === null || _target$parent32$setP === void 0 ? void 0 : _target$parent32$setP.call(_target$parent32, 'componentProps', cp);
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
setter: {
|
|
708
|
+
componentName: 'NumberSetter'
|
|
709
|
+
}
|
|
710
|
+
}, {
|
|
711
|
+
title: {
|
|
712
|
+
label: '最大值',
|
|
713
|
+
tip: '数字输入框允许输入的最大值。'
|
|
714
|
+
},
|
|
715
|
+
name: '!max',
|
|
716
|
+
condition: function condition(target) {
|
|
717
|
+
var _target$parent33, _target$parent33$getP;
|
|
718
|
+
return ((_target$parent33 = target.parent) === null || _target$parent33 === void 0 ? void 0 : (_target$parent33$getP = _target$parent33.getPropValue) === null || _target$parent33$getP === void 0 ? void 0 : _target$parent33$getP.call(_target$parent33, 'componentType')) === 'NumberPicker';
|
|
719
|
+
},
|
|
720
|
+
extraProps: {
|
|
721
|
+
getValue: function getValue(target) {
|
|
722
|
+
var _target$parent34, _target$parent34$getP, _target$parent34$getP2;
|
|
723
|
+
return (_target$parent34 = target.parent) === null || _target$parent34 === void 0 ? void 0 : (_target$parent34$getP = _target$parent34.getPropValue) === null || _target$parent34$getP === void 0 ? void 0 : (_target$parent34$getP2 = _target$parent34$getP.call(_target$parent34, 'componentProps')) === null || _target$parent34$getP2 === void 0 ? void 0 : _target$parent34$getP2.max;
|
|
724
|
+
},
|
|
725
|
+
setValue: function setValue(target, value) {
|
|
726
|
+
var _target$parent35, _target$parent35$getP, _target$parent36, _target$parent36$setP;
|
|
727
|
+
var cp = _extends({}, ((_target$parent35 = target.parent) === null || _target$parent35 === void 0 ? void 0 : (_target$parent35$getP = _target$parent35.getPropValue) === null || _target$parent35$getP === void 0 ? void 0 : _target$parent35$getP.call(_target$parent35, 'componentProps')) || {});
|
|
728
|
+
if (value === undefined || value === null || value === '') delete cp.max;else cp.max = value;
|
|
729
|
+
(_target$parent36 = target.parent) === null || _target$parent36 === void 0 ? void 0 : (_target$parent36$setP = _target$parent36.setPropValue) === null || _target$parent36$setP === void 0 ? void 0 : _target$parent36$setP.call(_target$parent36, 'componentProps', cp);
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
setter: {
|
|
733
|
+
componentName: 'NumberSetter'
|
|
734
|
+
}
|
|
735
|
+
}, {
|
|
736
|
+
title: {
|
|
737
|
+
label: '步长',
|
|
738
|
+
tip: '每次点击加减按钮时变化的数量。默认 1。'
|
|
739
|
+
},
|
|
740
|
+
name: '!step',
|
|
741
|
+
condition: function condition(target) {
|
|
742
|
+
var _target$parent37, _target$parent37$getP;
|
|
743
|
+
return ((_target$parent37 = target.parent) === null || _target$parent37 === void 0 ? void 0 : (_target$parent37$getP = _target$parent37.getPropValue) === null || _target$parent37$getP === void 0 ? void 0 : _target$parent37$getP.call(_target$parent37, 'componentType')) === 'NumberPicker';
|
|
744
|
+
},
|
|
745
|
+
extraProps: {
|
|
746
|
+
getValue: function getValue(target) {
|
|
747
|
+
var _target$parent38, _target$parent38$getP, _target$parent38$getP2;
|
|
748
|
+
return (_target$parent38 = target.parent) === null || _target$parent38 === void 0 ? void 0 : (_target$parent38$getP = _target$parent38.getPropValue) === null || _target$parent38$getP === void 0 ? void 0 : (_target$parent38$getP2 = _target$parent38$getP.call(_target$parent38, 'componentProps')) === null || _target$parent38$getP2 === void 0 ? void 0 : _target$parent38$getP2.step;
|
|
749
|
+
},
|
|
750
|
+
setValue: function setValue(target, value) {
|
|
751
|
+
var _target$parent39, _target$parent39$getP, _target$parent40, _target$parent40$setP;
|
|
752
|
+
var cp = _extends({}, ((_target$parent39 = target.parent) === null || _target$parent39 === void 0 ? void 0 : (_target$parent39$getP = _target$parent39.getPropValue) === null || _target$parent39$getP === void 0 ? void 0 : _target$parent39$getP.call(_target$parent39, 'componentProps')) || {});
|
|
753
|
+
if (value === undefined || value === null || value === '') delete cp.step;else cp.step = value;
|
|
754
|
+
(_target$parent40 = target.parent) === null || _target$parent40 === void 0 ? void 0 : (_target$parent40$setP = _target$parent40.setPropValue) === null || _target$parent40$setP === void 0 ? void 0 : _target$parent40$setP.call(_target$parent40, 'componentProps', cp);
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
setter: {
|
|
758
|
+
componentName: 'NumberSetter',
|
|
759
|
+
props: {
|
|
760
|
+
min: 0
|
|
182
761
|
},
|
|
183
762
|
initialValue: 1
|
|
184
763
|
}
|
|
185
764
|
}, {
|
|
186
|
-
title:
|
|
187
|
-
|
|
765
|
+
title: {
|
|
766
|
+
label: '小数位数',
|
|
767
|
+
tip: '数字保留几位小数。默认不限制(整数)。'
|
|
768
|
+
},
|
|
769
|
+
name: '!precision',
|
|
770
|
+
condition: function condition(target) {
|
|
771
|
+
var _target$parent41, _target$parent41$getP;
|
|
772
|
+
return ((_target$parent41 = target.parent) === null || _target$parent41 === void 0 ? void 0 : (_target$parent41$getP = _target$parent41.getPropValue) === null || _target$parent41$getP === void 0 ? void 0 : _target$parent41$getP.call(_target$parent41, 'componentType')) === 'NumberPicker';
|
|
773
|
+
},
|
|
774
|
+
extraProps: {
|
|
775
|
+
getValue: function getValue(target) {
|
|
776
|
+
var _target$parent42, _target$parent42$getP, _target$parent42$getP2;
|
|
777
|
+
return (_target$parent42 = target.parent) === null || _target$parent42 === void 0 ? void 0 : (_target$parent42$getP = _target$parent42.getPropValue) === null || _target$parent42$getP === void 0 ? void 0 : (_target$parent42$getP2 = _target$parent42$getP.call(_target$parent42, 'componentProps')) === null || _target$parent42$getP2 === void 0 ? void 0 : _target$parent42$getP2.precision;
|
|
778
|
+
},
|
|
779
|
+
setValue: function setValue(target, value) {
|
|
780
|
+
var _target$parent43, _target$parent43$getP, _target$parent44, _target$parent44$setP;
|
|
781
|
+
var cp = _extends({}, ((_target$parent43 = target.parent) === null || _target$parent43 === void 0 ? void 0 : (_target$parent43$getP = _target$parent43.getPropValue) === null || _target$parent43$getP === void 0 ? void 0 : _target$parent43$getP.call(_target$parent43, 'componentProps')) || {});
|
|
782
|
+
if (value === undefined || value === null || value === '') delete cp.precision;else cp.precision = value;
|
|
783
|
+
(_target$parent44 = target.parent) === null || _target$parent44 === void 0 ? void 0 : (_target$parent44$setP = _target$parent44.setPropValue) === null || _target$parent44$setP === void 0 ? void 0 : _target$parent44$setP.call(_target$parent44, 'componentProps', cp);
|
|
784
|
+
}
|
|
785
|
+
},
|
|
188
786
|
setter: {
|
|
189
|
-
componentName: '
|
|
190
|
-
|
|
787
|
+
componentName: 'NumberSetter',
|
|
788
|
+
props: {
|
|
789
|
+
min: 0,
|
|
790
|
+
max: 10
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
},
|
|
794
|
+
// ── Select:可搜索 / 可清除 / 多选模式
|
|
795
|
+
{
|
|
796
|
+
title: {
|
|
797
|
+
label: '可搜索',
|
|
798
|
+
tip: '开启后下拉框支持输入关键字过滤选项。'
|
|
799
|
+
},
|
|
800
|
+
name: '!showSearch',
|
|
801
|
+
condition: function condition(target) {
|
|
802
|
+
var _target$parent45, _target$parent45$getP;
|
|
803
|
+
return ((_target$parent45 = target.parent) === null || _target$parent45 === void 0 ? void 0 : (_target$parent45$getP = _target$parent45.getPropValue) === null || _target$parent45$getP === void 0 ? void 0 : _target$parent45$getP.call(_target$parent45, 'componentType')) === 'Select';
|
|
804
|
+
},
|
|
805
|
+
extraProps: {
|
|
806
|
+
getValue: function getValue(target) {
|
|
807
|
+
var _target$parent46, _target$parent46$getP, _target$parent46$getP2;
|
|
808
|
+
return (_target$parent46 = target.parent) === null || _target$parent46 === void 0 ? void 0 : (_target$parent46$getP = _target$parent46.getPropValue) === null || _target$parent46$getP === void 0 ? void 0 : (_target$parent46$getP2 = _target$parent46$getP.call(_target$parent46, 'componentProps')) === null || _target$parent46$getP2 === void 0 ? void 0 : _target$parent46$getP2.showSearch;
|
|
809
|
+
},
|
|
810
|
+
setValue: function setValue(target, value) {
|
|
811
|
+
var _target$parent47, _target$parent47$getP, _target$parent48, _target$parent48$setP;
|
|
812
|
+
var cp = _extends({}, ((_target$parent47 = target.parent) === null || _target$parent47 === void 0 ? void 0 : (_target$parent47$getP = _target$parent47.getPropValue) === null || _target$parent47$getP === void 0 ? void 0 : _target$parent47$getP.call(_target$parent47, 'componentProps')) || {});
|
|
813
|
+
cp.showSearch = value;
|
|
814
|
+
(_target$parent48 = target.parent) === null || _target$parent48 === void 0 ? void 0 : (_target$parent48$setP = _target$parent48.setPropValue) === null || _target$parent48$setP === void 0 ? void 0 : _target$parent48$setP.call(_target$parent48, 'componentProps', cp);
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
setter: {
|
|
818
|
+
componentName: 'BoolSetter',
|
|
819
|
+
initialValue: false
|
|
191
820
|
}
|
|
192
821
|
}, {
|
|
193
|
-
title:
|
|
194
|
-
|
|
822
|
+
title: {
|
|
823
|
+
label: '可清除',
|
|
824
|
+
tip: '开启后选择框右侧显示清除图标,点击可清空已选值。'
|
|
825
|
+
},
|
|
826
|
+
name: '!hasClear',
|
|
827
|
+
condition: function condition(target) {
|
|
828
|
+
var _target$parent49, _target$parent49$getP;
|
|
829
|
+
var t = ((_target$parent49 = target.parent) === null || _target$parent49 === void 0 ? void 0 : (_target$parent49$getP = _target$parent49.getPropValue) === null || _target$parent49$getP === void 0 ? void 0 : _target$parent49$getP.call(_target$parent49, 'componentType')) || 'Input';
|
|
830
|
+
return ['Select', 'DatePicker', 'DateTimePicker'].includes(t);
|
|
831
|
+
},
|
|
832
|
+
extraProps: {
|
|
833
|
+
getValue: function getValue(target) {
|
|
834
|
+
var _target$parent50, _target$parent50$getP, _target$parent50$getP2;
|
|
835
|
+
return (_target$parent50 = target.parent) === null || _target$parent50 === void 0 ? void 0 : (_target$parent50$getP = _target$parent50.getPropValue) === null || _target$parent50$getP === void 0 ? void 0 : (_target$parent50$getP2 = _target$parent50$getP.call(_target$parent50, 'componentProps')) === null || _target$parent50$getP2 === void 0 ? void 0 : _target$parent50$getP2.hasClear;
|
|
836
|
+
},
|
|
837
|
+
setValue: function setValue(target, value) {
|
|
838
|
+
var _target$parent51, _target$parent51$getP, _target$parent52, _target$parent52$setP;
|
|
839
|
+
var cp = _extends({}, ((_target$parent51 = target.parent) === null || _target$parent51 === void 0 ? void 0 : (_target$parent51$getP = _target$parent51.getPropValue) === null || _target$parent51$getP === void 0 ? void 0 : _target$parent51$getP.call(_target$parent51, 'componentProps')) || {});
|
|
840
|
+
cp.hasClear = value;
|
|
841
|
+
(_target$parent52 = target.parent) === null || _target$parent52 === void 0 ? void 0 : (_target$parent52$setP = _target$parent52.setPropValue) === null || _target$parent52$setP === void 0 ? void 0 : _target$parent52$setP.call(_target$parent52, 'componentProps', cp);
|
|
842
|
+
}
|
|
843
|
+
},
|
|
195
844
|
setter: {
|
|
196
|
-
componentName: '
|
|
197
|
-
|
|
845
|
+
componentName: 'BoolSetter',
|
|
846
|
+
initialValue: false
|
|
198
847
|
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
848
|
+
}, {
|
|
849
|
+
title: {
|
|
850
|
+
label: '多选模式',
|
|
851
|
+
tip: '设置下拉框的选择模式:\n· 单选(single):只能选一个选项(默认)\n· 多选(multiple):可以选多个,以标签形式展示\n· 标签输入(tag):可以选多个,也支持直接输入新标签'
|
|
852
|
+
},
|
|
853
|
+
name: '!mode',
|
|
854
|
+
condition: function condition(target) {
|
|
855
|
+
var _target$parent53, _target$parent53$getP;
|
|
856
|
+
return ((_target$parent53 = target.parent) === null || _target$parent53 === void 0 ? void 0 : (_target$parent53$getP = _target$parent53.getPropValue) === null || _target$parent53$getP === void 0 ? void 0 : _target$parent53$getP.call(_target$parent53, 'componentType')) === 'Select';
|
|
857
|
+
},
|
|
858
|
+
extraProps: {
|
|
859
|
+
getValue: function getValue(target) {
|
|
860
|
+
var _target$parent54, _target$parent54$getP, _target$parent54$getP2;
|
|
861
|
+
return ((_target$parent54 = target.parent) === null || _target$parent54 === void 0 ? void 0 : (_target$parent54$getP = _target$parent54.getPropValue) === null || _target$parent54$getP === void 0 ? void 0 : (_target$parent54$getP2 = _target$parent54$getP.call(_target$parent54, 'componentProps')) === null || _target$parent54$getP2 === void 0 ? void 0 : _target$parent54$getP2.mode) || 'single';
|
|
862
|
+
},
|
|
863
|
+
setValue: function setValue(target, value) {
|
|
864
|
+
var _target$parent55, _target$parent55$getP, _target$parent56, _target$parent56$setP;
|
|
865
|
+
var cp = _extends({}, ((_target$parent55 = target.parent) === null || _target$parent55 === void 0 ? void 0 : (_target$parent55$getP = _target$parent55.getPropValue) === null || _target$parent55$getP === void 0 ? void 0 : _target$parent55$getP.call(_target$parent55, 'componentProps')) || {});
|
|
866
|
+
cp.mode = value;
|
|
867
|
+
(_target$parent56 = target.parent) === null || _target$parent56 === void 0 ? void 0 : (_target$parent56$setP = _target$parent56.setPropValue) === null || _target$parent56$setP === void 0 ? void 0 : _target$parent56$setP.call(_target$parent56, 'componentProps', cp);
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
setter: {
|
|
871
|
+
componentName: 'RadioGroupSetter',
|
|
872
|
+
props: {
|
|
873
|
+
options: [{
|
|
874
|
+
title: '单选',
|
|
875
|
+
value: 'single'
|
|
876
|
+
}, {
|
|
877
|
+
title: '多选',
|
|
878
|
+
value: 'multiple'
|
|
879
|
+
}, {
|
|
880
|
+
title: '标签',
|
|
881
|
+
value: 'tag'
|
|
882
|
+
}]
|
|
883
|
+
},
|
|
884
|
+
initialValue: 'single'
|
|
885
|
+
}
|
|
886
|
+
},
|
|
887
|
+
// ── DatePicker / DateTimePicker:日期格式
|
|
888
|
+
{
|
|
889
|
+
title: {
|
|
890
|
+
label: '日期格式',
|
|
891
|
+
tip: '日期显示和提交的格式字符串。\n常用:\n· 仅日期:YYYY-MM-DD(默认)\n· 日期+时间:YYYY-MM-DD HH:mm\n· 年月:YYYY-MM'
|
|
892
|
+
},
|
|
893
|
+
name: '!dateFormat',
|
|
894
|
+
condition: function condition(target) {
|
|
895
|
+
var _target$parent57, _target$parent57$getP;
|
|
896
|
+
var t = ((_target$parent57 = target.parent) === null || _target$parent57 === void 0 ? void 0 : (_target$parent57$getP = _target$parent57.getPropValue) === null || _target$parent57$getP === void 0 ? void 0 : _target$parent57$getP.call(_target$parent57, 'componentType')) || 'Input';
|
|
897
|
+
return ['DatePicker', 'DateTimePicker'].includes(t);
|
|
898
|
+
},
|
|
899
|
+
extraProps: {
|
|
900
|
+
getValue: function getValue(target) {
|
|
901
|
+
var _target$parent58, _target$parent58$getP, _target$parent59, _target$parent59$getP, _target$parent59$getP2;
|
|
902
|
+
var t = (_target$parent58 = target.parent) === null || _target$parent58 === void 0 ? void 0 : (_target$parent58$getP = _target$parent58.getPropValue) === null || _target$parent58$getP === void 0 ? void 0 : _target$parent58$getP.call(_target$parent58, 'componentType');
|
|
903
|
+
return ((_target$parent59 = target.parent) === null || _target$parent59 === void 0 ? void 0 : (_target$parent59$getP = _target$parent59.getPropValue) === null || _target$parent59$getP === void 0 ? void 0 : (_target$parent59$getP2 = _target$parent59$getP.call(_target$parent59, 'componentProps')) === null || _target$parent59$getP2 === void 0 ? void 0 : _target$parent59$getP2.format) || (t === 'DateTimePicker' ? 'YYYY-MM-DD HH:mm' : 'YYYY-MM-DD');
|
|
904
|
+
},
|
|
905
|
+
setValue: function setValue(target, value) {
|
|
906
|
+
var _target$parent60, _target$parent60$getP, _target$parent61, _target$parent61$setP;
|
|
907
|
+
var cp = _extends({}, ((_target$parent60 = target.parent) === null || _target$parent60 === void 0 ? void 0 : (_target$parent60$getP = _target$parent60.getPropValue) === null || _target$parent60$getP === void 0 ? void 0 : _target$parent60$getP.call(_target$parent60, 'componentProps')) || {});
|
|
908
|
+
cp.format = value;
|
|
909
|
+
(_target$parent61 = target.parent) === null || _target$parent61 === void 0 ? void 0 : (_target$parent61$setP = _target$parent61.setPropValue) === null || _target$parent61$setP === void 0 ? void 0 : _target$parent61$setP.call(_target$parent61, 'componentProps', cp);
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
setter: {
|
|
913
|
+
componentName: 'StringSetter',
|
|
914
|
+
initialValue: 'YYYY-MM-DD'
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
// ── Upload:文件类型 / 数量限制
|
|
918
|
+
{
|
|
919
|
+
title: {
|
|
920
|
+
label: '允许的文件类型',
|
|
921
|
+
tip: '限制可上传的文件类型(传给 input[accept])。\n例如:image/* 只允许图片,.pdf 只允许 PDF,不填则不限制。'
|
|
922
|
+
},
|
|
923
|
+
name: '!accept',
|
|
924
|
+
condition: function condition(target) {
|
|
925
|
+
var _target$parent62, _target$parent62$getP;
|
|
926
|
+
return ((_target$parent62 = target.parent) === null || _target$parent62 === void 0 ? void 0 : (_target$parent62$getP = _target$parent62.getPropValue) === null || _target$parent62$getP === void 0 ? void 0 : _target$parent62$getP.call(_target$parent62, 'componentType')) === 'Upload';
|
|
927
|
+
},
|
|
928
|
+
extraProps: {
|
|
929
|
+
getValue: function getValue(target) {
|
|
930
|
+
var _target$parent63, _target$parent63$getP, _target$parent63$getP2;
|
|
931
|
+
return (_target$parent63 = target.parent) === null || _target$parent63 === void 0 ? void 0 : (_target$parent63$getP = _target$parent63.getPropValue) === null || _target$parent63$getP === void 0 ? void 0 : (_target$parent63$getP2 = _target$parent63$getP.call(_target$parent63, 'componentProps')) === null || _target$parent63$getP2 === void 0 ? void 0 : _target$parent63$getP2.accept;
|
|
932
|
+
},
|
|
933
|
+
setValue: function setValue(target, value) {
|
|
934
|
+
var _target$parent64, _target$parent64$getP, _target$parent65, _target$parent65$setP;
|
|
935
|
+
var cp = _extends({}, ((_target$parent64 = target.parent) === null || _target$parent64 === void 0 ? void 0 : (_target$parent64$getP = _target$parent64.getPropValue) === null || _target$parent64$getP === void 0 ? void 0 : _target$parent64$getP.call(_target$parent64, 'componentProps')) || {});
|
|
936
|
+
if (!value) delete cp.accept;else cp.accept = value;
|
|
937
|
+
(_target$parent65 = target.parent) === null || _target$parent65 === void 0 ? void 0 : (_target$parent65$setP = _target$parent65.setPropValue) === null || _target$parent65$setP === void 0 ? void 0 : _target$parent65$setP.call(_target$parent65, 'componentProps', cp);
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
setter: {
|
|
941
|
+
componentName: 'StringSetter'
|
|
942
|
+
}
|
|
943
|
+
}, {
|
|
944
|
+
title: {
|
|
945
|
+
label: '最多上传数量',
|
|
946
|
+
tip: '允许上传的最多文件数量,超出后禁止继续上传。不填则不限制。'
|
|
947
|
+
},
|
|
948
|
+
name: '!limit',
|
|
949
|
+
condition: function condition(target) {
|
|
950
|
+
var _target$parent66, _target$parent66$getP;
|
|
951
|
+
return ((_target$parent66 = target.parent) === null || _target$parent66 === void 0 ? void 0 : (_target$parent66$getP = _target$parent66.getPropValue) === null || _target$parent66$getP === void 0 ? void 0 : _target$parent66$getP.call(_target$parent66, 'componentType')) === 'Upload';
|
|
952
|
+
},
|
|
953
|
+
extraProps: {
|
|
954
|
+
getValue: function getValue(target) {
|
|
955
|
+
var _target$parent67, _target$parent67$getP, _target$parent67$getP2;
|
|
956
|
+
return (_target$parent67 = target.parent) === null || _target$parent67 === void 0 ? void 0 : (_target$parent67$getP = _target$parent67.getPropValue) === null || _target$parent67$getP === void 0 ? void 0 : (_target$parent67$getP2 = _target$parent67$getP.call(_target$parent67, 'componentProps')) === null || _target$parent67$getP2 === void 0 ? void 0 : _target$parent67$getP2.limit;
|
|
957
|
+
},
|
|
958
|
+
setValue: function setValue(target, value) {
|
|
959
|
+
var _target$parent68, _target$parent68$getP, _target$parent69, _target$parent69$setP;
|
|
960
|
+
var cp = _extends({}, ((_target$parent68 = target.parent) === null || _target$parent68 === void 0 ? void 0 : (_target$parent68$getP = _target$parent68.getPropValue) === null || _target$parent68$getP === void 0 ? void 0 : _target$parent68$getP.call(_target$parent68, 'componentProps')) || {});
|
|
961
|
+
if (value === undefined || value === null || value === '') delete cp.limit;else cp.limit = value;
|
|
962
|
+
(_target$parent69 = target.parent) === null || _target$parent69 === void 0 ? void 0 : (_target$parent69$setP = _target$parent69.setPropValue) === null || _target$parent69$setP === void 0 ? void 0 : _target$parent69$setP.call(_target$parent69, 'componentProps', cp);
|
|
963
|
+
}
|
|
964
|
+
},
|
|
965
|
+
setter: {
|
|
966
|
+
componentName: 'NumberSetter',
|
|
967
|
+
props: {
|
|
968
|
+
min: 1
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
},
|
|
972
|
+
// ── 表单项控制
|
|
973
|
+
{
|
|
974
|
+
title: {
|
|
975
|
+
label: '自动校验',
|
|
976
|
+
tip: '开启后每次字段值变化时自动触发校验,不需等到提交才验证。\n适合需要即时反馈的场景(如手机号格式)。'
|
|
977
|
+
},
|
|
978
|
+
name: '!autoValidate',
|
|
979
|
+
extraProps: {
|
|
980
|
+
getValue: function getValue(target) {
|
|
981
|
+
var _target$parent70, _target$parent70$getP, _target$parent70$getP2;
|
|
982
|
+
return (_target$parent70 = target.parent) === null || _target$parent70 === void 0 ? void 0 : (_target$parent70$getP = _target$parent70.getPropValue) === null || _target$parent70$getP === void 0 ? void 0 : (_target$parent70$getP2 = _target$parent70$getP.call(_target$parent70, 'formItemProps')) === null || _target$parent70$getP2 === void 0 ? void 0 : _target$parent70$getP2.autoValidate;
|
|
983
|
+
},
|
|
984
|
+
setValue: function setValue(target, value) {
|
|
985
|
+
var _target$parent71, _target$parent71$getP, _target$parent72, _target$parent72$setP;
|
|
986
|
+
var fp = _extends({}, ((_target$parent71 = target.parent) === null || _target$parent71 === void 0 ? void 0 : (_target$parent71$getP = _target$parent71.getPropValue) === null || _target$parent71$getP === void 0 ? void 0 : _target$parent71$getP.call(_target$parent71, 'formItemProps')) || {});
|
|
987
|
+
fp.autoValidate = value;
|
|
988
|
+
(_target$parent72 = target.parent) === null || _target$parent72 === void 0 ? void 0 : (_target$parent72$setP = _target$parent72.setPropValue) === null || _target$parent72$setP === void 0 ? void 0 : _target$parent72$setP.call(_target$parent72, 'formItemProps', fp);
|
|
989
|
+
}
|
|
990
|
+
},
|
|
991
|
+
setter: {
|
|
992
|
+
componentName: 'BoolSetter',
|
|
993
|
+
initialValue: false
|
|
994
|
+
}
|
|
995
|
+
}, {
|
|
996
|
+
title: {
|
|
997
|
+
label: '隐藏冒号',
|
|
998
|
+
tip: '开启后在标题文字后面不显示冒号。'
|
|
999
|
+
},
|
|
1000
|
+
name: '!colon',
|
|
1001
|
+
extraProps: {
|
|
1002
|
+
getValue: function getValue(target) {
|
|
1003
|
+
var _target$parent73, _target$parent73$getP, _target$parent73$getP2;
|
|
1004
|
+
var v = (_target$parent73 = target.parent) === null || _target$parent73 === void 0 ? void 0 : (_target$parent73$getP = _target$parent73.getPropValue) === null || _target$parent73$getP === void 0 ? void 0 : (_target$parent73$getP2 = _target$parent73$getP.call(_target$parent73, 'formItemProps')) === null || _target$parent73$getP2 === void 0 ? void 0 : _target$parent73$getP2.colon;
|
|
1005
|
+
return v === false;
|
|
1006
|
+
},
|
|
1007
|
+
setValue: function setValue(target, value) {
|
|
1008
|
+
var _target$parent74, _target$parent74$getP, _target$parent75, _target$parent75$setP;
|
|
1009
|
+
var fp = _extends({}, ((_target$parent74 = target.parent) === null || _target$parent74 === void 0 ? void 0 : (_target$parent74$getP = _target$parent74.getPropValue) === null || _target$parent74$getP === void 0 ? void 0 : _target$parent74$getP.call(_target$parent74, 'formItemProps')) || {});
|
|
1010
|
+
fp.colon = !value;
|
|
1011
|
+
(_target$parent75 = target.parent) === null || _target$parent75 === void 0 ? void 0 : (_target$parent75$setP = _target$parent75.setPropValue) === null || _target$parent75$setP === void 0 ? void 0 : _target$parent75$setP.call(_target$parent75, 'formItemProps', fp);
|
|
1012
|
+
}
|
|
1013
|
+
},
|
|
1014
|
+
setter: {
|
|
1015
|
+
componentName: 'BoolSetter',
|
|
1016
|
+
initialValue: false
|
|
1017
|
+
}
|
|
1018
|
+
},
|
|
1019
|
+
// ── 表单校验
|
|
1020
|
+
// 最小长度(Input / TextArea / CheckboxGroup)
|
|
1021
|
+
{
|
|
1022
|
+
title: {
|
|
1023
|
+
label: '最少字符数',
|
|
1024
|
+
tip: 'Input/TextArea:输入字符不能少于此数量。\nCheckboxGroup:至少要选几项。'
|
|
1025
|
+
},
|
|
1026
|
+
name: '!minLength',
|
|
1027
|
+
condition: function condition(target) {
|
|
1028
|
+
var _target$parent76, _target$parent76$getP;
|
|
1029
|
+
var t = ((_target$parent76 = target.parent) === null || _target$parent76 === void 0 ? void 0 : (_target$parent76$getP = _target$parent76.getPropValue) === null || _target$parent76$getP === void 0 ? void 0 : _target$parent76$getP.call(_target$parent76, 'componentType')) || 'Input';
|
|
1030
|
+
return ['Input', 'TextArea', 'CheckboxGroup'].includes(t);
|
|
1031
|
+
},
|
|
1032
|
+
extraProps: {
|
|
1033
|
+
getValue: function getValue(target) {
|
|
1034
|
+
var _target$parent77, _target$parent77$getP, _target$parent77$getP2;
|
|
1035
|
+
return (_target$parent77 = target.parent) === null || _target$parent77 === void 0 ? void 0 : (_target$parent77$getP = _target$parent77.getPropValue) === null || _target$parent77$getP === void 0 ? void 0 : (_target$parent77$getP2 = _target$parent77$getP.call(_target$parent77, 'formItemProps')) === null || _target$parent77$getP2 === void 0 ? void 0 : _target$parent77$getP2.minLength;
|
|
1036
|
+
},
|
|
1037
|
+
setValue: function setValue(target, value) {
|
|
1038
|
+
var _target$parent78, _target$parent78$getP, _target$parent79, _target$parent79$setP;
|
|
1039
|
+
var fp = _extends({}, ((_target$parent78 = target.parent) === null || _target$parent78 === void 0 ? void 0 : (_target$parent78$getP = _target$parent78.getPropValue) === null || _target$parent78$getP === void 0 ? void 0 : _target$parent78$getP.call(_target$parent78, 'formItemProps')) || {});
|
|
1040
|
+
if (value === undefined || value === null || value === '') delete fp.minLength;else fp.minLength = value;
|
|
1041
|
+
(_target$parent79 = target.parent) === null || _target$parent79 === void 0 ? void 0 : (_target$parent79$setP = _target$parent79.setPropValue) === null || _target$parent79$setP === void 0 ? void 0 : _target$parent79$setP.call(_target$parent79, 'formItemProps', fp);
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
setter: {
|
|
1045
|
+
componentName: 'NumberSetter',
|
|
1046
|
+
props: {
|
|
1047
|
+
min: 0
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
// 最大长度(Input / TextArea / CheckboxGroup / Select multiple)
|
|
1052
|
+
{
|
|
1053
|
+
title: {
|
|
1054
|
+
label: '最多字符数(校验)',
|
|
1055
|
+
tip: 'Input/TextArea:输入字符不能超过此数量(校验维度,与组件层的最大字符数独立)。\nCheckboxGroup:最多能选几项。'
|
|
1056
|
+
},
|
|
1057
|
+
name: '!maxLengthValidate',
|
|
1058
|
+
condition: function condition(target) {
|
|
1059
|
+
var _target$parent80, _target$parent80$getP;
|
|
1060
|
+
var t = ((_target$parent80 = target.parent) === null || _target$parent80 === void 0 ? void 0 : (_target$parent80$getP = _target$parent80.getPropValue) === null || _target$parent80$getP === void 0 ? void 0 : _target$parent80$getP.call(_target$parent80, 'componentType')) || 'Input';
|
|
1061
|
+
return ['Input', 'TextArea', 'CheckboxGroup'].includes(t);
|
|
1062
|
+
},
|
|
1063
|
+
extraProps: {
|
|
1064
|
+
getValue: function getValue(target) {
|
|
1065
|
+
var _target$parent81, _target$parent81$getP, _target$parent81$getP2;
|
|
1066
|
+
return (_target$parent81 = target.parent) === null || _target$parent81 === void 0 ? void 0 : (_target$parent81$getP = _target$parent81.getPropValue) === null || _target$parent81$getP === void 0 ? void 0 : (_target$parent81$getP2 = _target$parent81$getP.call(_target$parent81, 'formItemProps')) === null || _target$parent81$getP2 === void 0 ? void 0 : _target$parent81$getP2.maxLength;
|
|
1067
|
+
},
|
|
1068
|
+
setValue: function setValue(target, value) {
|
|
1069
|
+
var _target$parent82, _target$parent82$getP, _target$parent83, _target$parent83$setP;
|
|
1070
|
+
var fp = _extends({}, ((_target$parent82 = target.parent) === null || _target$parent82 === void 0 ? void 0 : (_target$parent82$getP = _target$parent82.getPropValue) === null || _target$parent82$getP === void 0 ? void 0 : _target$parent82$getP.call(_target$parent82, 'formItemProps')) || {});
|
|
1071
|
+
if (value === undefined || value === null || value === '') delete fp.maxLength;else fp.maxLength = value;
|
|
1072
|
+
(_target$parent83 = target.parent) === null || _target$parent83 === void 0 ? void 0 : (_target$parent83$setP = _target$parent83.setPropValue) === null || _target$parent83$setP === void 0 ? void 0 : _target$parent83$setP.call(_target$parent83, 'formItemProps', fp);
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
setter: {
|
|
1076
|
+
componentName: 'NumberSetter',
|
|
1077
|
+
props: {
|
|
1078
|
+
min: 0
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
// 最小/最大值(NumberPicker)
|
|
1083
|
+
{
|
|
1084
|
+
title: {
|
|
1085
|
+
label: '最小数值(校验)',
|
|
1086
|
+
tip: '数字字段的最小合法值(校验维度)。'
|
|
1087
|
+
},
|
|
1088
|
+
name: '!minValue',
|
|
1089
|
+
condition: function condition(target) {
|
|
1090
|
+
var _target$parent84, _target$parent84$getP;
|
|
1091
|
+
return ((_target$parent84 = target.parent) === null || _target$parent84 === void 0 ? void 0 : (_target$parent84$getP = _target$parent84.getPropValue) === null || _target$parent84$getP === void 0 ? void 0 : _target$parent84$getP.call(_target$parent84, 'componentType')) === 'NumberPicker';
|
|
1092
|
+
},
|
|
1093
|
+
extraProps: {
|
|
1094
|
+
getValue: function getValue(target) {
|
|
1095
|
+
var _target$parent85, _target$parent85$getP, _target$parent85$getP2;
|
|
1096
|
+
return (_target$parent85 = target.parent) === null || _target$parent85 === void 0 ? void 0 : (_target$parent85$getP = _target$parent85.getPropValue) === null || _target$parent85$getP === void 0 ? void 0 : (_target$parent85$getP2 = _target$parent85$getP.call(_target$parent85, 'formItemProps')) === null || _target$parent85$getP2 === void 0 ? void 0 : _target$parent85$getP2.min;
|
|
1097
|
+
},
|
|
1098
|
+
setValue: function setValue(target, value) {
|
|
1099
|
+
var _target$parent86, _target$parent86$getP, _target$parent87, _target$parent87$setP;
|
|
1100
|
+
var fp = _extends({}, ((_target$parent86 = target.parent) === null || _target$parent86 === void 0 ? void 0 : (_target$parent86$getP = _target$parent86.getPropValue) === null || _target$parent86$getP === void 0 ? void 0 : _target$parent86$getP.call(_target$parent86, 'formItemProps')) || {});
|
|
1101
|
+
if (value === undefined || value === null || value === '') delete fp.min;else fp.min = value;
|
|
1102
|
+
(_target$parent87 = target.parent) === null || _target$parent87 === void 0 ? void 0 : (_target$parent87$setP = _target$parent87.setPropValue) === null || _target$parent87$setP === void 0 ? void 0 : _target$parent87$setP.call(_target$parent87, 'formItemProps', fp);
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
setter: {
|
|
1106
|
+
componentName: 'NumberSetter'
|
|
1107
|
+
}
|
|
1108
|
+
}, {
|
|
1109
|
+
title: {
|
|
1110
|
+
label: '最大数值(校验)',
|
|
1111
|
+
tip: '数字字段的最大合法值(校验维度)。'
|
|
1112
|
+
},
|
|
1113
|
+
name: '!maxValue',
|
|
1114
|
+
condition: function condition(target) {
|
|
1115
|
+
var _target$parent88, _target$parent88$getP;
|
|
1116
|
+
return ((_target$parent88 = target.parent) === null || _target$parent88 === void 0 ? void 0 : (_target$parent88$getP = _target$parent88.getPropValue) === null || _target$parent88$getP === void 0 ? void 0 : _target$parent88$getP.call(_target$parent88, 'componentType')) === 'NumberPicker';
|
|
1117
|
+
},
|
|
1118
|
+
extraProps: {
|
|
1119
|
+
getValue: function getValue(target) {
|
|
1120
|
+
var _target$parent89, _target$parent89$getP, _target$parent89$getP2;
|
|
1121
|
+
return (_target$parent89 = target.parent) === null || _target$parent89 === void 0 ? void 0 : (_target$parent89$getP = _target$parent89.getPropValue) === null || _target$parent89$getP === void 0 ? void 0 : (_target$parent89$getP2 = _target$parent89$getP.call(_target$parent89, 'formItemProps')) === null || _target$parent89$getP2 === void 0 ? void 0 : _target$parent89$getP2.max;
|
|
1122
|
+
},
|
|
1123
|
+
setValue: function setValue(target, value) {
|
|
1124
|
+
var _target$parent90, _target$parent90$getP, _target$parent91, _target$parent91$setP;
|
|
1125
|
+
var fp = _extends({}, ((_target$parent90 = target.parent) === null || _target$parent90 === void 0 ? void 0 : (_target$parent90$getP = _target$parent90.getPropValue) === null || _target$parent90$getP === void 0 ? void 0 : _target$parent90$getP.call(_target$parent90, 'formItemProps')) || {});
|
|
1126
|
+
if (value === undefined || value === null || value === '') delete fp.max;else fp.max = value;
|
|
1127
|
+
(_target$parent91 = target.parent) === null || _target$parent91 === void 0 ? void 0 : (_target$parent91$setP = _target$parent91.setPropValue) === null || _target$parent91$setP === void 0 ? void 0 : _target$parent91$setP.call(_target$parent91, 'formItemProps', fp);
|
|
1128
|
+
}
|
|
1129
|
+
},
|
|
1130
|
+
setter: {
|
|
1131
|
+
componentName: 'NumberSetter'
|
|
1132
|
+
}
|
|
1133
|
+
},
|
|
1134
|
+
// 正则校验(Input / TextArea)—— 提供预置规则 + 自定义
|
|
1135
|
+
{
|
|
1136
|
+
title: {
|
|
1137
|
+
label: '正则校验',
|
|
1138
|
+
tip: '选择常用的格式校验规则,或选"自定义"后填写自己的正则表达式(无需前后加斜杠)。\n常用示例:\n· 手机号:^1[3-9]\\d{9}$\n· 邮箱:^[\\w.]+@[\\w.]+\\.[a-z]{2,}$\n· 正整数:^\\d+$\n· 身份证号:^\\d{17}[\\dXx]$'
|
|
1139
|
+
},
|
|
1140
|
+
name: '!patternPreset',
|
|
1141
|
+
condition: function condition(target) {
|
|
1142
|
+
var _target$parent92, _target$parent92$getP;
|
|
1143
|
+
var t = ((_target$parent92 = target.parent) === null || _target$parent92 === void 0 ? void 0 : (_target$parent92$getP = _target$parent92.getPropValue) === null || _target$parent92$getP === void 0 ? void 0 : _target$parent92$getP.call(_target$parent92, 'componentType')) || 'Input';
|
|
1144
|
+
return ['Input', 'TextArea'].includes(t);
|
|
1145
|
+
},
|
|
1146
|
+
extraProps: {
|
|
1147
|
+
getValue: function getValue(target) {
|
|
1148
|
+
var _target$parent93, _target$parent93$getP, _target$parent93$getP2;
|
|
1149
|
+
var pattern = (_target$parent93 = target.parent) === null || _target$parent93 === void 0 ? void 0 : (_target$parent93$getP = _target$parent93.getPropValue) === null || _target$parent93$getP === void 0 ? void 0 : (_target$parent93$getP2 = _target$parent93$getP.call(_target$parent93, 'formItemProps')) === null || _target$parent93$getP2 === void 0 ? void 0 : _target$parent93$getP2.pattern;
|
|
1150
|
+
var presets = {
|
|
1151
|
+
'^1[3-9]\\d{9}$': 'phone',
|
|
1152
|
+
'^[\\w.+-]+@[\\w-]+\\.[a-z]{2,}$': 'email',
|
|
1153
|
+
'^\\d+$': 'integer',
|
|
1154
|
+
'^\\d+(\\.\\d+)?$': 'number',
|
|
1155
|
+
'^\\d{17}[\\dXx]$': 'idcard',
|
|
1156
|
+
"^[\\u4e00-\\u9fa5]+$": 'chinese'
|
|
1157
|
+
};
|
|
1158
|
+
return pattern ? presets[pattern] || '__custom__' : '';
|
|
1159
|
+
},
|
|
1160
|
+
setValue: function setValue(target, value) {
|
|
1161
|
+
var _target$parent94, _target$parent94$getP, _target$parent95, _target$parent95$setP;
|
|
1162
|
+
var patternMap = {
|
|
1163
|
+
phone: '^1[3-9]\\d{9}$',
|
|
1164
|
+
email: '^[\\w.+-]+@[\\w-]+\\.[a-z]{2,}$',
|
|
1165
|
+
integer: '^\\d+$',
|
|
1166
|
+
number: '^\\d+(\\.\\d+)?$',
|
|
1167
|
+
idcard: '^\\d{17}[\\dXx]$',
|
|
1168
|
+
chinese: "^[\\u4e00-\\u9fa5]+$"
|
|
1169
|
+
};
|
|
1170
|
+
var fp = _extends({}, ((_target$parent94 = target.parent) === null || _target$parent94 === void 0 ? void 0 : (_target$parent94$getP = _target$parent94.getPropValue) === null || _target$parent94$getP === void 0 ? void 0 : _target$parent94$getP.call(_target$parent94, 'formItemProps')) || {});
|
|
1171
|
+
if (!value || value === '__none__') {
|
|
1172
|
+
delete fp.pattern;
|
|
1173
|
+
} else if (value === '__custom__') {
|
|
1174
|
+
// 自定义时不修改 pattern,等用户在下方输入框填写
|
|
1175
|
+
} else {
|
|
1176
|
+
fp.pattern = patternMap[value];
|
|
1177
|
+
}
|
|
1178
|
+
(_target$parent95 = target.parent) === null || _target$parent95 === void 0 ? void 0 : (_target$parent95$setP = _target$parent95.setPropValue) === null || _target$parent95$setP === void 0 ? void 0 : _target$parent95$setP.call(_target$parent95, 'formItemProps', fp);
|
|
1179
|
+
}
|
|
1180
|
+
},
|
|
1181
|
+
setter: {
|
|
1182
|
+
componentName: 'SelectSetter',
|
|
1183
|
+
props: {
|
|
1184
|
+
options: [{
|
|
1185
|
+
label: '不校验',
|
|
1186
|
+
value: '__none__'
|
|
1187
|
+
}, {
|
|
1188
|
+
label: '手机号(11位)',
|
|
1189
|
+
value: 'phone'
|
|
1190
|
+
}, {
|
|
1191
|
+
label: '邮箱地址',
|
|
1192
|
+
value: 'email'
|
|
1193
|
+
}, {
|
|
1194
|
+
label: '整数',
|
|
1195
|
+
value: 'integer'
|
|
1196
|
+
}, {
|
|
1197
|
+
label: '数字(含小数)',
|
|
1198
|
+
value: 'number'
|
|
1199
|
+
}, {
|
|
1200
|
+
label: '身份证号(15/18位)',
|
|
1201
|
+
value: 'idcard'
|
|
1202
|
+
}, {
|
|
1203
|
+
label: '纯中文',
|
|
1204
|
+
value: 'chinese'
|
|
1205
|
+
}, {
|
|
1206
|
+
label: '自定义正则…',
|
|
1207
|
+
value: '__custom__'
|
|
1208
|
+
}]
|
|
1209
|
+
},
|
|
1210
|
+
initialValue: '__none__'
|
|
1211
|
+
}
|
|
1212
|
+
}, {
|
|
1213
|
+
title: {
|
|
1214
|
+
label: '自定义正则',
|
|
1215
|
+
tip: '填写自定义正则表达式(无需前后加斜杠),例如:^1[3-9]\\d{9}$'
|
|
1216
|
+
},
|
|
1217
|
+
name: '!pattern',
|
|
1218
|
+
condition: function condition(target) {
|
|
1219
|
+
var _target$parent96, _target$parent96$getP, _target$parent97, _target$parent97$getP, _target$parent97$getP2, _target$parent98, _target$parent98$getP, _target$parent98$getP2;
|
|
1220
|
+
var t = ((_target$parent96 = target.parent) === null || _target$parent96 === void 0 ? void 0 : (_target$parent96$getP = _target$parent96.getPropValue) === null || _target$parent96$getP === void 0 ? void 0 : _target$parent96$getP.call(_target$parent96, 'componentType')) || 'Input';
|
|
1221
|
+
if (!['Input', 'TextArea'].includes(t)) return false;
|
|
1222
|
+
var preset = (_target$parent97 = target.parent) === null || _target$parent97 === void 0 ? void 0 : (_target$parent97$getP = _target$parent97.getPropValue) === null || _target$parent97$getP === void 0 ? void 0 : (_target$parent97$getP2 = _target$parent97$getP.call(_target$parent97, 'formItemProps')) === null || _target$parent97$getP2 === void 0 ? void 0 : _target$parent97$getP2.__patternPreset;
|
|
1223
|
+
// 当预置选择了"自定义"时显示,或者 pattern 已有值但不匹配任何预置时也显示
|
|
1224
|
+
var pattern = (_target$parent98 = target.parent) === null || _target$parent98 === void 0 ? void 0 : (_target$parent98$getP = _target$parent98.getPropValue) === null || _target$parent98$getP === void 0 ? void 0 : (_target$parent98$getP2 = _target$parent98$getP.call(_target$parent98, 'formItemProps')) === null || _target$parent98$getP2 === void 0 ? void 0 : _target$parent98$getP2.pattern;
|
|
1225
|
+
var builtinPatterns = ['^1[3-9]\\d{9}$', '^[\\w.+-]+@[\\w-]+\\.[a-z]{2,}$', '^\\d+$', '^\\d+(\\.\\d+)?$', '^\\d{17}[\\dXx]$', "^[\\u4e00-\\u9fa5]+$"];
|
|
1226
|
+
return preset === '__custom__' || !!pattern && !builtinPatterns.includes(pattern);
|
|
1227
|
+
},
|
|
1228
|
+
extraProps: {
|
|
1229
|
+
getValue: function getValue(target) {
|
|
1230
|
+
var _target$parent99, _target$parent99$getP, _target$parent99$getP2;
|
|
1231
|
+
return (_target$parent99 = target.parent) === null || _target$parent99 === void 0 ? void 0 : (_target$parent99$getP = _target$parent99.getPropValue) === null || _target$parent99$getP === void 0 ? void 0 : (_target$parent99$getP2 = _target$parent99$getP.call(_target$parent99, 'formItemProps')) === null || _target$parent99$getP2 === void 0 ? void 0 : _target$parent99$getP2.pattern;
|
|
1232
|
+
},
|
|
1233
|
+
setValue: function setValue(target, value) {
|
|
1234
|
+
var _target$parent100, _target$parent100$get, _target$parent101, _target$parent101$set;
|
|
1235
|
+
var fp = _extends({}, ((_target$parent100 = target.parent) === null || _target$parent100 === void 0 ? void 0 : (_target$parent100$get = _target$parent100.getPropValue) === null || _target$parent100$get === void 0 ? void 0 : _target$parent100$get.call(_target$parent100, 'formItemProps')) || {});
|
|
1236
|
+
if (!value) delete fp.pattern;else fp.pattern = value;
|
|
1237
|
+
(_target$parent101 = target.parent) === null || _target$parent101 === void 0 ? void 0 : (_target$parent101$set = _target$parent101.setPropValue) === null || _target$parent101$set === void 0 ? void 0 : _target$parent101$set.call(_target$parent101, 'formItemProps', fp);
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
setter: {
|
|
1241
|
+
componentName: 'StringSetter'
|
|
1242
|
+
}
|
|
1243
|
+
}, {
|
|
1244
|
+
title: {
|
|
1245
|
+
label: '正则校验失败提示',
|
|
1246
|
+
tip: '正则不匹配时显示的错误提示文字。'
|
|
1247
|
+
},
|
|
1248
|
+
name: '!patternMessage',
|
|
1249
|
+
condition: function condition(target) {
|
|
1250
|
+
var _target$parent102, _target$parent102$get, _target$parent103, _target$parent103$get, _target$parent103$get2;
|
|
1251
|
+
var t = ((_target$parent102 = target.parent) === null || _target$parent102 === void 0 ? void 0 : (_target$parent102$get = _target$parent102.getPropValue) === null || _target$parent102$get === void 0 ? void 0 : _target$parent102$get.call(_target$parent102, 'componentType')) || 'Input';
|
|
1252
|
+
return ['Input', 'TextArea'].includes(t) && !!((_target$parent103 = target.parent) !== null && _target$parent103 !== void 0 && (_target$parent103$get = _target$parent103.getPropValue) !== null && _target$parent103$get !== void 0 && (_target$parent103$get2 = _target$parent103$get.call(_target$parent103, 'formItemProps')) !== null && _target$parent103$get2 !== void 0 && _target$parent103$get2.pattern);
|
|
1253
|
+
},
|
|
1254
|
+
extraProps: {
|
|
1255
|
+
getValue: function getValue(target) {
|
|
1256
|
+
var _target$parent104, _target$parent104$get, _target$parent104$get2;
|
|
1257
|
+
return (_target$parent104 = target.parent) === null || _target$parent104 === void 0 ? void 0 : (_target$parent104$get = _target$parent104.getPropValue) === null || _target$parent104$get === void 0 ? void 0 : (_target$parent104$get2 = _target$parent104$get.call(_target$parent104, 'formItemProps')) === null || _target$parent104$get2 === void 0 ? void 0 : _target$parent104$get2.patternMessage;
|
|
1258
|
+
},
|
|
1259
|
+
setValue: function setValue(target, value) {
|
|
1260
|
+
var _target$parent105, _target$parent105$get, _target$parent106, _target$parent106$set;
|
|
1261
|
+
var fp = _extends({}, ((_target$parent105 = target.parent) === null || _target$parent105 === void 0 ? void 0 : (_target$parent105$get = _target$parent105.getPropValue) === null || _target$parent105$get === void 0 ? void 0 : _target$parent105$get.call(_target$parent105, 'formItemProps')) || {});
|
|
1262
|
+
if (!value) delete fp.patternMessage;else fp.patternMessage = value;
|
|
1263
|
+
(_target$parent106 = target.parent) === null || _target$parent106 === void 0 ? void 0 : (_target$parent106$set = _target$parent106.setPropValue) === null || _target$parent106$set === void 0 ? void 0 : _target$parent106$set.call(_target$parent106, 'formItemProps', fp);
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
setter: {
|
|
1267
|
+
componentName: 'StringSetter'
|
|
1268
|
+
}
|
|
1269
|
+
},
|
|
1270
|
+
// 格式校验(仅 Input)
|
|
1271
|
+
{
|
|
1272
|
+
title: {
|
|
1273
|
+
label: '格式校验',
|
|
1274
|
+
tip: '快速选择常用格式进行校验:\n· number:必须是数字\n· email:必须是邮箱格式\n· url:必须是网址格式\n· tel:必须是电话格式'
|
|
1275
|
+
},
|
|
1276
|
+
name: '!format',
|
|
1277
|
+
condition: function condition(target) {
|
|
1278
|
+
var _target$parent107, _target$parent107$get;
|
|
1279
|
+
return ((_target$parent107 = target.parent) === null || _target$parent107 === void 0 ? void 0 : (_target$parent107$get = _target$parent107.getPropValue) === null || _target$parent107$get === void 0 ? void 0 : _target$parent107$get.call(_target$parent107, 'componentType')) === 'Input';
|
|
1280
|
+
},
|
|
1281
|
+
extraProps: {
|
|
1282
|
+
getValue: function getValue(target) {
|
|
1283
|
+
var _target$parent108, _target$parent108$get, _target$parent108$get2;
|
|
1284
|
+
return (_target$parent108 = target.parent) === null || _target$parent108 === void 0 ? void 0 : (_target$parent108$get = _target$parent108.getPropValue) === null || _target$parent108$get === void 0 ? void 0 : (_target$parent108$get2 = _target$parent108$get.call(_target$parent108, 'formItemProps')) === null || _target$parent108$get2 === void 0 ? void 0 : _target$parent108$get2.format;
|
|
1285
|
+
},
|
|
1286
|
+
setValue: function setValue(target, value) {
|
|
1287
|
+
var _target$parent109, _target$parent109$get, _target$parent110, _target$parent110$set;
|
|
1288
|
+
var fp = _extends({}, ((_target$parent109 = target.parent) === null || _target$parent109 === void 0 ? void 0 : (_target$parent109$get = _target$parent109.getPropValue) === null || _target$parent109$get === void 0 ? void 0 : _target$parent109$get.call(_target$parent109, 'formItemProps')) || {});
|
|
1289
|
+
if (!value) delete fp.format;else fp.format = value;
|
|
1290
|
+
(_target$parent110 = target.parent) === null || _target$parent110 === void 0 ? void 0 : (_target$parent110$set = _target$parent110.setPropValue) === null || _target$parent110$set === void 0 ? void 0 : _target$parent110$set.call(_target$parent110, 'formItemProps', fp);
|
|
1291
|
+
}
|
|
1292
|
+
},
|
|
1293
|
+
setter: {
|
|
1294
|
+
componentName: 'SelectSetter',
|
|
1295
|
+
props: {
|
|
1296
|
+
options: [{
|
|
1297
|
+
label: '不限制',
|
|
1298
|
+
value: ''
|
|
1299
|
+
}, {
|
|
1300
|
+
label: '数字 (number)',
|
|
1301
|
+
value: 'number'
|
|
1302
|
+
}, {
|
|
1303
|
+
label: '邮箱 (email)',
|
|
1304
|
+
value: 'email'
|
|
1305
|
+
}, {
|
|
1306
|
+
label: '网址 (url)',
|
|
1307
|
+
value: 'url'
|
|
1308
|
+
}, {
|
|
1309
|
+
label: '电话 (tel)',
|
|
1310
|
+
value: 'tel'
|
|
1311
|
+
}]
|
|
1312
|
+
},
|
|
1313
|
+
initialValue: ''
|
|
1314
|
+
}
|
|
1315
|
+
}]
|
|
205
1316
|
}
|
|
206
1317
|
}
|
|
207
1318
|
}
|
|
208
1319
|
},
|
|
209
1320
|
initialValue: []
|
|
210
1321
|
}
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
name: '
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
1322
|
+
},
|
|
1323
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
1324
|
+
// 字段初始化
|
|
1325
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
1326
|
+
{
|
|
1327
|
+
title: {
|
|
1328
|
+
label: '字段初始化',
|
|
1329
|
+
tip: '批量配置表单字段的初始值。\n\n· 字段名:与「表单项」中的「字段名」保持一致,例如 guest_count、user_name\n· 值类型:\n 固定值 — 直接填写静态默认值(字符串/数字/布尔/JSON)\n 变量绑定 — 绑定页面 state 或接口返回的动态变量\n\n💡 设置单个字段默认值时,也可在「表单项」列表中直接配置「默认值」,更快捷。'
|
|
1330
|
+
},
|
|
1331
|
+
name: 'initialValues',
|
|
1332
|
+
extraProps: {
|
|
1333
|
+
getValue: function getValue(target) {
|
|
1334
|
+
var iv = target.getProps().getPropValue('initialValues');
|
|
1335
|
+
if (!iv) return [];
|
|
1336
|
+
if (Array.isArray(iv)) {
|
|
1337
|
+
return iv.map(function (row) {
|
|
1338
|
+
var field = typeof (row === null || row === void 0 ? void 0 : row.field) === 'string' ? row.field.trim() : '';
|
|
1339
|
+
if (!field) return null;
|
|
1340
|
+
var valueType = (row === null || row === void 0 ? void 0 : row.valueType) === 'variable' ? 'variable' : 'fixed';
|
|
1341
|
+
return {
|
|
1342
|
+
field: field,
|
|
1343
|
+
valueType: valueType,
|
|
1344
|
+
value: row === null || row === void 0 ? void 0 : row.value
|
|
1345
|
+
};
|
|
1346
|
+
}).filter(Boolean);
|
|
1347
|
+
}
|
|
1348
|
+
return Object.entries(iv).map(function (_ref) {
|
|
1349
|
+
var field = _ref[0],
|
|
1350
|
+
value = _ref[1];
|
|
1351
|
+
return {
|
|
1352
|
+
field: String(field).trim(),
|
|
1353
|
+
valueType: 'fixed',
|
|
1354
|
+
value: value
|
|
1355
|
+
};
|
|
1356
|
+
}).filter(function (row) {
|
|
1357
|
+
return row.field;
|
|
1358
|
+
});
|
|
1359
|
+
},
|
|
1360
|
+
setValue: function setValue(target, rows) {
|
|
1361
|
+
if (!Array.isArray(rows)) return;
|
|
1362
|
+
var cleanedRows = rows.map(function (row) {
|
|
1363
|
+
var field = typeof (row === null || row === void 0 ? void 0 : row.field) === 'string' ? row.field.trim() : '';
|
|
1364
|
+
if (!field) return null;
|
|
1365
|
+
var valueType = (row === null || row === void 0 ? void 0 : row.valueType) === 'variable' ? 'variable' : 'fixed';
|
|
1366
|
+
return {
|
|
1367
|
+
field: field,
|
|
1368
|
+
valueType: valueType,
|
|
1369
|
+
value: row === null || row === void 0 ? void 0 : row.value
|
|
1370
|
+
};
|
|
1371
|
+
}).filter(Boolean);
|
|
1372
|
+
target.getProps().setPropValue('initialValues', cleanedRows);
|
|
1373
|
+
}
|
|
1374
|
+
},
|
|
235
1375
|
setter: {
|
|
236
|
-
componentName: '
|
|
1376
|
+
componentName: 'ArraySetter',
|
|
237
1377
|
props: {
|
|
238
|
-
|
|
239
|
-
|
|
1378
|
+
itemSetter: {
|
|
1379
|
+
componentName: 'ObjectSetter',
|
|
1380
|
+
props: {
|
|
1381
|
+
config: {
|
|
1382
|
+
items: [{
|
|
1383
|
+
title: {
|
|
1384
|
+
label: '字段名',
|
|
1385
|
+
tip: '与「表单项」中的「字段名」保持一致,例如:guest_count、user_name'
|
|
1386
|
+
},
|
|
1387
|
+
name: 'field',
|
|
1388
|
+
important: true,
|
|
1389
|
+
display: 'inline',
|
|
1390
|
+
setter: {
|
|
1391
|
+
componentName: 'StringSetter',
|
|
1392
|
+
isRequired: true,
|
|
1393
|
+
initialValue: ''
|
|
1394
|
+
}
|
|
1395
|
+
}, {
|
|
1396
|
+
title: {
|
|
1397
|
+
label: '值类型',
|
|
1398
|
+
tip: '· 固定值:静态初始值,例如"待处理"、10、true\n· 变量绑定:绑定页面 state 或动态数据,表单打开时从变量取值'
|
|
1399
|
+
},
|
|
1400
|
+
name: 'valueType',
|
|
1401
|
+
setter: {
|
|
1402
|
+
componentName: 'RadioGroupSetter',
|
|
1403
|
+
props: {
|
|
1404
|
+
options: [{
|
|
1405
|
+
title: '固定值',
|
|
1406
|
+
value: 'fixed'
|
|
1407
|
+
}, {
|
|
1408
|
+
title: '变量绑定',
|
|
1409
|
+
value: 'variable'
|
|
1410
|
+
}]
|
|
1411
|
+
},
|
|
1412
|
+
initialValue: 'fixed'
|
|
1413
|
+
}
|
|
1414
|
+
}, {
|
|
1415
|
+
title: {
|
|
1416
|
+
label: '初始值',
|
|
1417
|
+
tip: '该字段的默认值。\n· 文本类填字符串,例如:待处理\n· 数字类填数字,例如:10\n· 下拉/单选填选项的 value 值,例如:male\n· 复选框填 JSON 数组,例如:["a","b"]'
|
|
1418
|
+
},
|
|
1419
|
+
name: 'value',
|
|
1420
|
+
condition: function condition(target) {
|
|
1421
|
+
var _target$parent111, _target$parent111$get;
|
|
1422
|
+
return (((_target$parent111 = target.parent) === null || _target$parent111 === void 0 ? void 0 : (_target$parent111$get = _target$parent111.getPropValue) === null || _target$parent111$get === void 0 ? void 0 : _target$parent111$get.call(_target$parent111, 'valueType')) || 'fixed') === 'fixed';
|
|
1423
|
+
},
|
|
1424
|
+
setter: {
|
|
1425
|
+
componentName: 'MixedSetter',
|
|
1426
|
+
props: {
|
|
1427
|
+
setters: [{
|
|
1428
|
+
componentName: 'StringSetter',
|
|
1429
|
+
title: '字符串'
|
|
1430
|
+
}, {
|
|
1431
|
+
componentName: 'NumberSetter',
|
|
1432
|
+
title: '数字'
|
|
1433
|
+
}, {
|
|
1434
|
+
componentName: 'BoolSetter',
|
|
1435
|
+
title: '布尔'
|
|
1436
|
+
}, {
|
|
1437
|
+
componentName: 'JsonSetter',
|
|
1438
|
+
title: 'JSON(数组/对象)'
|
|
1439
|
+
}]
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
}, {
|
|
1443
|
+
title: {
|
|
1444
|
+
label: '变量绑定',
|
|
1445
|
+
tip: '绑定页面 state 或外部传入的变量,表单打开时从该变量读取初始值。\n例如:绑定 state.selectedPackage 可将上一步选择的套餐自动填入。'
|
|
1446
|
+
},
|
|
1447
|
+
name: 'value',
|
|
1448
|
+
condition: function condition(target) {
|
|
1449
|
+
var _target$parent112, _target$parent112$get;
|
|
1450
|
+
return ((_target$parent112 = target.parent) === null || _target$parent112 === void 0 ? void 0 : (_target$parent112$get = _target$parent112.getPropValue) === null || _target$parent112$get === void 0 ? void 0 : _target$parent112$get.call(_target$parent112, 'valueType')) === 'variable';
|
|
1451
|
+
},
|
|
1452
|
+
setter: {
|
|
1453
|
+
componentName: 'VariableSetter'
|
|
1454
|
+
},
|
|
1455
|
+
extraProps: {
|
|
1456
|
+
supportVariable: true
|
|
1457
|
+
}
|
|
1458
|
+
}]
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
initialValue: function initialValue() {
|
|
1462
|
+
return {
|
|
1463
|
+
field: '',
|
|
1464
|
+
valueType: 'fixed',
|
|
1465
|
+
value: ''
|
|
1466
|
+
};
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
initialValue: []
|
|
240
1471
|
}
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
|
|
1472
|
+
},
|
|
1473
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
1474
|
+
// 计算字段
|
|
1475
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
1476
|
+
{
|
|
1477
|
+
title: {
|
|
1478
|
+
label: '计算字段',
|
|
1479
|
+
tip: '声明由多个表单字段自动拼接/计算出的衍生字段,每行一条规则。\n\n工作原理:每次任意字段值变化时自动重新计算,结果写入目标字段,提交时自动携带。\n\n表达式写法:用 {字段名} 引用表单中其他字段的当前值\n 例如:{package_name},{package_price}元,预约日期:{banquet_date}\n\n配置步骤:\n ① 目标字段名 = 要写入的字段名,例如:order_desc\n ② 表达式 = 输入模板文字,用 {字段名} 插入字段值\n ③ 保存后切换套餐/填值即可看到目标字段自动更新\n\n无需编写任何 JS 逻辑,配置即生效。'
|
|
1480
|
+
},
|
|
1481
|
+
name: 'computedFields',
|
|
1482
|
+
extraProps: {
|
|
1483
|
+
getValue: function getValue(target) {
|
|
1484
|
+
var cf = target.getProps().getPropValue('computedFields');
|
|
1485
|
+
if (!cf) return [];
|
|
1486
|
+
if (Array.isArray(cf)) return cf;
|
|
1487
|
+
return Object.entries(cf).map(function (_ref2) {
|
|
1488
|
+
var targetField = _ref2[0],
|
|
1489
|
+
template = _ref2[1];
|
|
1490
|
+
return {
|
|
1491
|
+
targetField: targetField,
|
|
1492
|
+
template: template
|
|
1493
|
+
};
|
|
1494
|
+
});
|
|
1495
|
+
},
|
|
1496
|
+
setValue: function setValue(target, value) {
|
|
1497
|
+
if (!Array.isArray(value)) return;
|
|
1498
|
+
target.getProps().setPropValue('computedFields', value.filter(Boolean));
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
244
1501
|
setter: {
|
|
245
|
-
componentName: '
|
|
246
|
-
|
|
1502
|
+
componentName: 'ArraySetter',
|
|
1503
|
+
props: {
|
|
1504
|
+
itemSetter: {
|
|
1505
|
+
componentName: 'ObjectSetter',
|
|
1506
|
+
props: {
|
|
1507
|
+
config: {
|
|
1508
|
+
items: [{
|
|
1509
|
+
title: {
|
|
1510
|
+
label: '目标字段名',
|
|
1511
|
+
tip: '计算结果写入的字段名,提交时携带此字段。\n建议取语义化名称,例如:order_desc、booking_summary\n该字段不需要出现在上方「表单项」中,提交时会自动追加到表单值里。'
|
|
1512
|
+
},
|
|
1513
|
+
name: 'targetField',
|
|
1514
|
+
important: true,
|
|
1515
|
+
display: 'inline',
|
|
1516
|
+
setter: {
|
|
1517
|
+
componentName: 'StringSetter',
|
|
1518
|
+
isRequired: true,
|
|
1519
|
+
initialValue: ''
|
|
1520
|
+
}
|
|
1521
|
+
}, {
|
|
1522
|
+
title: {
|
|
1523
|
+
label: '表达式',
|
|
1524
|
+
tip: '用 {字段名} 引用表单字段的当前值,支持任意文字拼接。\n\n示例:{package_name},{guest_count}人,预订日期:{banquet_date}\n\n操作:先查看「表单项」中的字段名,在此处输入拼接模板,用 {字段名} 插入对应字段值,固定文字直接输入。'
|
|
1525
|
+
},
|
|
1526
|
+
name: 'template',
|
|
1527
|
+
setter: {
|
|
1528
|
+
componentName: 'StringSetter',
|
|
1529
|
+
isRequired: true,
|
|
1530
|
+
initialValue: ''
|
|
1531
|
+
}
|
|
1532
|
+
}]
|
|
1533
|
+
}
|
|
1534
|
+
},
|
|
1535
|
+
initialValue: function initialValue() {
|
|
1536
|
+
return {
|
|
1537
|
+
targetField: '',
|
|
1538
|
+
template: ''
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
},
|
|
1543
|
+
initialValue: []
|
|
247
1544
|
}
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
|
|
1545
|
+
},
|
|
1546
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
1547
|
+
// 字段联动
|
|
1548
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
1549
|
+
{
|
|
1550
|
+
title: {
|
|
1551
|
+
label: '字段联动',
|
|
1552
|
+
tip: '配置"某字段变化 → 自动回填其他字段"的联动规则。\n\n【简单模式】适用于:选某个值 → 直接回填固定值或绑定变量\n 例如:选"豪华套餐" → 回填价格=9800\n · 监听字段:值发生变化时触发检查,填字段名,例如 package_name\n · 触发值:留空=任何变化都触发;填具体值=精确匹配才触发\n · 回填字段:要被自动填入值的目标字段名\n · 回填方式:固定值 或 变量(从 state 中选取)\n\n【数据源模式】适用于:根据所选值从一个列表中查找匹配项,自动回填该项的多个字段\n 典型场景:下拉框绑定了 state.packages(含 name/price/count),选择套餐名后自动回填价格和人数\n 监听字段 = package_name\n 数据源 = state.packages(与 package_name 下拉框的动态选项相同)\n 匹配字段 = value(Select 存储的是选项的 value 字段)\n 回填映射 = {"package_price":"price","guest_count":"count"}(JSON 格式)\n 注意:数据源中的每个对象需要有 matchKey 字段(用于匹配监听字段的值)以及各回填字段对应的属性。'
|
|
1553
|
+
},
|
|
1554
|
+
name: 'fieldLinkage',
|
|
251
1555
|
setter: {
|
|
252
|
-
componentName: '
|
|
253
|
-
|
|
1556
|
+
componentName: 'ArraySetter',
|
|
1557
|
+
props: {
|
|
1558
|
+
itemSetter: {
|
|
1559
|
+
componentName: 'ObjectSetter',
|
|
1560
|
+
props: {
|
|
1561
|
+
config: {
|
|
1562
|
+
items: [
|
|
1563
|
+
// ── 通用:监听字段 ──────────────────────────────────────
|
|
1564
|
+
{
|
|
1565
|
+
title: {
|
|
1566
|
+
label: '监听字段',
|
|
1567
|
+
tip: '当此字段值变化时触发联动检查,填表单项的字段名(field),例如:package_name\n可从上方「表单项」列表中查看各字段名。'
|
|
1568
|
+
},
|
|
1569
|
+
name: 'watchField',
|
|
1570
|
+
important: true,
|
|
1571
|
+
display: 'inline',
|
|
1572
|
+
setter: {
|
|
1573
|
+
componentName: 'StringSetter',
|
|
1574
|
+
isRequired: true,
|
|
1575
|
+
initialValue: ''
|
|
1576
|
+
}
|
|
1577
|
+
},
|
|
1578
|
+
// ── 模式切换 ────────────────────────────────────────────
|
|
1579
|
+
{
|
|
1580
|
+
title: {
|
|
1581
|
+
label: '联动模式',
|
|
1582
|
+
tip: '· 简单:监听字段变化 → 直接设置某个字段的值(固定值或变量)\n· 数据源:监听字段变化 → 在指定数据源中查找匹配项 → 批量回填多个字段\n (适合"选套餐 → 联动回填价格、人数"等场景)'
|
|
1583
|
+
},
|
|
1584
|
+
name: 'linkageMode',
|
|
1585
|
+
setter: {
|
|
1586
|
+
componentName: 'RadioGroupSetter',
|
|
1587
|
+
props: {
|
|
1588
|
+
options: [{
|
|
1589
|
+
title: '简单',
|
|
1590
|
+
value: 'simple'
|
|
1591
|
+
}, {
|
|
1592
|
+
title: '数据源',
|
|
1593
|
+
value: 'dataSource'
|
|
1594
|
+
}]
|
|
1595
|
+
},
|
|
1596
|
+
initialValue: 'simple'
|
|
1597
|
+
}
|
|
1598
|
+
},
|
|
1599
|
+
// ── 简单模式:触发值 ────────────────────────────────────
|
|
1600
|
+
{
|
|
1601
|
+
title: {
|
|
1602
|
+
label: '触发值',
|
|
1603
|
+
tip: '监听字段的值等于此值时才触发回填。\n· 留空 = 该字段任何变化都触发\n· 填具体值 = 精确匹配后触发,例如:豪华套餐、1、true\n\n多个触发值:添加多条相同监听字段的规则,每条配置不同触发值。'
|
|
1604
|
+
},
|
|
1605
|
+
name: 'matchValue',
|
|
1606
|
+
condition: function condition(target) {
|
|
1607
|
+
var _target$parent113, _target$parent113$get;
|
|
1608
|
+
return (((_target$parent113 = target.parent) === null || _target$parent113 === void 0 ? void 0 : (_target$parent113$get = _target$parent113.getPropValue) === null || _target$parent113$get === void 0 ? void 0 : _target$parent113$get.call(_target$parent113, 'linkageMode')) || 'simple') === 'simple';
|
|
1609
|
+
},
|
|
1610
|
+
setter: {
|
|
1611
|
+
componentName: 'StringSetter',
|
|
1612
|
+
initialValue: ''
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
// ── 简单模式:回填字段 ──────────────────────────────────
|
|
1616
|
+
{
|
|
1617
|
+
title: {
|
|
1618
|
+
label: '回填字段',
|
|
1619
|
+
tip: '触发条件满足后,自动填入值的目标字段名(field),例如:package_price\n可从上方「表单项」列表中查看各字段名。'
|
|
1620
|
+
},
|
|
1621
|
+
name: 'fillField',
|
|
1622
|
+
condition: function condition(target) {
|
|
1623
|
+
var _target$parent114, _target$parent114$get;
|
|
1624
|
+
return (((_target$parent114 = target.parent) === null || _target$parent114 === void 0 ? void 0 : (_target$parent114$get = _target$parent114.getPropValue) === null || _target$parent114$get === void 0 ? void 0 : _target$parent114$get.call(_target$parent114, 'linkageMode')) || 'simple') === 'simple';
|
|
1625
|
+
},
|
|
1626
|
+
setter: {
|
|
1627
|
+
componentName: 'StringSetter',
|
|
1628
|
+
initialValue: ''
|
|
1629
|
+
}
|
|
1630
|
+
},
|
|
1631
|
+
// ── 简单模式:回填方式 ──────────────────────────────────
|
|
1632
|
+
{
|
|
1633
|
+
title: {
|
|
1634
|
+
label: '回填方式',
|
|
1635
|
+
tip: '· 固定值:直接填写静态回填值,例如 9800、"待处理"\n· 变量:回填值来自页面 state(适合动态数据场景)'
|
|
1636
|
+
},
|
|
1637
|
+
name: 'fillValueType',
|
|
1638
|
+
condition: function condition(target) {
|
|
1639
|
+
var _target$parent115, _target$parent115$get;
|
|
1640
|
+
return (((_target$parent115 = target.parent) === null || _target$parent115 === void 0 ? void 0 : (_target$parent115$get = _target$parent115.getPropValue) === null || _target$parent115$get === void 0 ? void 0 : _target$parent115$get.call(_target$parent115, 'linkageMode')) || 'simple') === 'simple';
|
|
1641
|
+
},
|
|
1642
|
+
setter: {
|
|
1643
|
+
componentName: 'RadioGroupSetter',
|
|
1644
|
+
props: {
|
|
1645
|
+
options: [{
|
|
1646
|
+
title: '固定值',
|
|
1647
|
+
value: 'fixed'
|
|
1648
|
+
}, {
|
|
1649
|
+
title: '变量',
|
|
1650
|
+
value: 'variable'
|
|
1651
|
+
}]
|
|
1652
|
+
},
|
|
1653
|
+
initialValue: 'fixed'
|
|
1654
|
+
}
|
|
1655
|
+
},
|
|
1656
|
+
// ── 简单模式:回填值(固定)────────────────────────────
|
|
1657
|
+
{
|
|
1658
|
+
title: {
|
|
1659
|
+
label: '回填值',
|
|
1660
|
+
tip: '触发条件满足后填入「回填字段」的具体值。\n· 字符串示例:豪华套餐、待处理\n· 数字示例:9800、10\n如需动态值,请将「回填方式」切换为「变量」。'
|
|
1661
|
+
},
|
|
1662
|
+
name: 'fillValue',
|
|
1663
|
+
condition: function condition(target) {
|
|
1664
|
+
var _target$parent116, _target$parent116$get, _target$parent117, _target$parent117$get;
|
|
1665
|
+
return (((_target$parent116 = target.parent) === null || _target$parent116 === void 0 ? void 0 : (_target$parent116$get = _target$parent116.getPropValue) === null || _target$parent116$get === void 0 ? void 0 : _target$parent116$get.call(_target$parent116, 'linkageMode')) || 'simple') === 'simple' && (((_target$parent117 = target.parent) === null || _target$parent117 === void 0 ? void 0 : (_target$parent117$get = _target$parent117.getPropValue) === null || _target$parent117$get === void 0 ? void 0 : _target$parent117$get.call(_target$parent117, 'fillValueType')) || 'fixed') === 'fixed';
|
|
1666
|
+
},
|
|
1667
|
+
setter: {
|
|
1668
|
+
componentName: 'MixedSetter',
|
|
1669
|
+
props: {
|
|
1670
|
+
setters: [{
|
|
1671
|
+
componentName: 'StringSetter',
|
|
1672
|
+
title: '字符串'
|
|
1673
|
+
}, {
|
|
1674
|
+
componentName: 'NumberSetter',
|
|
1675
|
+
title: '数字'
|
|
1676
|
+
}, {
|
|
1677
|
+
componentName: 'BoolSetter',
|
|
1678
|
+
title: '布尔'
|
|
1679
|
+
}]
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
},
|
|
1683
|
+
// ── 简单模式:回填值(变量)────────────────────────────
|
|
1684
|
+
{
|
|
1685
|
+
title: {
|
|
1686
|
+
label: '回填变量',
|
|
1687
|
+
tip: '从页面 state 中选取变量作为回填值,表单联动时实时取该变量的当前值填入目标字段。\n\n如果 state 中没有现成变量,但回填值需要来自某个下拉框选项对象的字段(如选套餐后取价格),请改用「数据源」模式。'
|
|
1688
|
+
},
|
|
1689
|
+
name: 'fillValue',
|
|
1690
|
+
condition: function condition(target) {
|
|
1691
|
+
var _target$parent118, _target$parent118$get, _target$parent119, _target$parent119$get;
|
|
1692
|
+
return (((_target$parent118 = target.parent) === null || _target$parent118 === void 0 ? void 0 : (_target$parent118$get = _target$parent118.getPropValue) === null || _target$parent118$get === void 0 ? void 0 : _target$parent118$get.call(_target$parent118, 'linkageMode')) || 'simple') === 'simple' && ((_target$parent119 = target.parent) === null || _target$parent119 === void 0 ? void 0 : (_target$parent119$get = _target$parent119.getPropValue) === null || _target$parent119$get === void 0 ? void 0 : _target$parent119$get.call(_target$parent119, 'fillValueType')) === 'variable';
|
|
1693
|
+
},
|
|
1694
|
+
setter: {
|
|
1695
|
+
componentName: 'VariableSetter'
|
|
1696
|
+
},
|
|
1697
|
+
extraProps: {
|
|
1698
|
+
supportVariable: true
|
|
1699
|
+
}
|
|
1700
|
+
},
|
|
1701
|
+
// ── 数据源模式:数据源 ──────────────────────────────────
|
|
1702
|
+
{
|
|
1703
|
+
title: {
|
|
1704
|
+
label: '数据源',
|
|
1705
|
+
tip: '从 state 中选取一个数组变量作为查找来源。\n\n典型配置:将 package_name 字段的「动态选项绑定」绑定到 state.packages,然后此处同样选择 state.packages。\n\n这样当 package_name 变化时,会在 state.packages 中找到匹配的项,再按「回填映射」将各字段值填入表单。'
|
|
1706
|
+
},
|
|
1707
|
+
name: 'dataSource',
|
|
1708
|
+
condition: function condition(target) {
|
|
1709
|
+
var _target$parent120, _target$parent120$get;
|
|
1710
|
+
return ((_target$parent120 = target.parent) === null || _target$parent120 === void 0 ? void 0 : (_target$parent120$get = _target$parent120.getPropValue) === null || _target$parent120$get === void 0 ? void 0 : _target$parent120$get.call(_target$parent120, 'linkageMode')) === 'dataSource';
|
|
1711
|
+
},
|
|
1712
|
+
setter: {
|
|
1713
|
+
componentName: 'VariableSetter'
|
|
1714
|
+
},
|
|
1715
|
+
extraProps: {
|
|
1716
|
+
supportVariable: true
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
// ── 数据源模式:匹配字段 ────────────────────────────────
|
|
1720
|
+
{
|
|
1721
|
+
title: {
|
|
1722
|
+
label: '匹配字段',
|
|
1723
|
+
tip: '在数据源的每个对象中,用哪个字段的值与监听字段的当前值进行比对。\n\n下拉框(Select)默认存储选项的 value 字段,此处填 value 即可。\n如果下拉框存储的是 label(名称),则填 label。\n\n示例:state.packages = [{value:"A", label:"豪华套餐", price:9800, count:10}, ...]\n则此处填 value(与 package_name 字段存储的选项 value 对应)。'
|
|
1724
|
+
},
|
|
1725
|
+
name: 'matchKey',
|
|
1726
|
+
condition: function condition(target) {
|
|
1727
|
+
var _target$parent121, _target$parent121$get;
|
|
1728
|
+
return ((_target$parent121 = target.parent) === null || _target$parent121 === void 0 ? void 0 : (_target$parent121$get = _target$parent121.getPropValue) === null || _target$parent121$get === void 0 ? void 0 : _target$parent121$get.call(_target$parent121, 'linkageMode')) === 'dataSource';
|
|
1729
|
+
},
|
|
1730
|
+
setter: {
|
|
1731
|
+
componentName: 'StringSetter',
|
|
1732
|
+
initialValue: 'value'
|
|
1733
|
+
}
|
|
1734
|
+
},
|
|
1735
|
+
// ── 数据源模式:回填映射 ────────────────────────────────
|
|
1736
|
+
{
|
|
1737
|
+
title: {
|
|
1738
|
+
label: '回填映射',
|
|
1739
|
+
tip: '找到匹配项后,将数据源对象中的哪些字段值填入表单的哪些字段。\n\nJSON 格式:{ "表单字段名": "数据源字段名", ... }\n\n示例(state.packages 中每项有 price 和 count 属性):\n {"package_price":"price","guest_count":"count"}\n\n效果:匹配到套餐后,自动将 price 回填到 package_price 字段,count 回填到 guest_count 字段。'
|
|
1740
|
+
},
|
|
1741
|
+
name: 'fillFields',
|
|
1742
|
+
condition: function condition(target) {
|
|
1743
|
+
var _target$parent122, _target$parent122$get;
|
|
1744
|
+
return ((_target$parent122 = target.parent) === null || _target$parent122 === void 0 ? void 0 : (_target$parent122$get = _target$parent122.getPropValue) === null || _target$parent122$get === void 0 ? void 0 : _target$parent122$get.call(_target$parent122, 'linkageMode')) === 'dataSource';
|
|
1745
|
+
},
|
|
1746
|
+
setter: {
|
|
1747
|
+
componentName: 'JsonSetter',
|
|
1748
|
+
initialValue: {}
|
|
1749
|
+
}
|
|
1750
|
+
}]
|
|
1751
|
+
}
|
|
1752
|
+
},
|
|
1753
|
+
initialValue: function initialValue() {
|
|
1754
|
+
return {
|
|
1755
|
+
watchField: '',
|
|
1756
|
+
linkageMode: 'simple',
|
|
1757
|
+
matchValue: '',
|
|
1758
|
+
fillField: '',
|
|
1759
|
+
fillValueType: 'fixed',
|
|
1760
|
+
fillValue: ''
|
|
1761
|
+
};
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1765
|
+
initialValue: []
|
|
254
1766
|
}
|
|
1767
|
+
},
|
|
1768
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
1769
|
+
// 分组六:操作按钮
|
|
1770
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
1771
|
+
{
|
|
1772
|
+
type: 'group',
|
|
1773
|
+
title: '操作按钮',
|
|
1774
|
+
name: 'actionGroup',
|
|
1775
|
+
display: 'accordion',
|
|
1776
|
+
items: [
|
|
1777
|
+
// ── 对齐方式 ──────────────────────────────────────────────────────
|
|
1778
|
+
{
|
|
1779
|
+
title: {
|
|
1780
|
+
label: '对齐方式',
|
|
1781
|
+
tip: '表单底部操作按钮区域的水平对齐方式。\n· 居左:按钮靠左排列\n· 居中:按钮居中排列(默认)\n· 居右:按钮靠右排列'
|
|
1782
|
+
},
|
|
1783
|
+
name: 'operationAlign',
|
|
1784
|
+
setter: {
|
|
1785
|
+
componentName: 'RadioGroupSetter',
|
|
1786
|
+
props: {
|
|
1787
|
+
options: [{
|
|
1788
|
+
title: '居左',
|
|
1789
|
+
value: 'left'
|
|
1790
|
+
}, {
|
|
1791
|
+
title: '居中',
|
|
1792
|
+
value: 'center'
|
|
1793
|
+
}, {
|
|
1794
|
+
title: '居右',
|
|
1795
|
+
value: 'right'
|
|
1796
|
+
}]
|
|
1797
|
+
},
|
|
1798
|
+
initialValue: 'center'
|
|
1799
|
+
}
|
|
1800
|
+
},
|
|
1801
|
+
// ── 按钮列表 ──────────────────────────────────────────────────────
|
|
1802
|
+
{
|
|
1803
|
+
title: {
|
|
1804
|
+
label: '按钮列表',
|
|
1805
|
+
tip: '配置表单底部的操作按钮。\n\n默认包含「立即预订」(提交,primary 样式)和「重置」(重置,normal 样式)两个按钮,可按需增删改。\n\n字段说明:\n· 按钮文字:按钮显示的文字,例如:立即预订、保存草稿、取消\n· 操作类型:\n 提交表单 → 校验通过后收集字段值 → 调用「提交数据源(Fetch)」接口 → 触发 onSubmit 事件\n 重置表单 → 清空所有字段值,触发 onReset 事件\n 自定义 → 直接触发「点击事件」,不操作表单\n· 按钮样式:主要(primary 蓝色)/ 次要(secondary)/ 普通(normal 灰色)\n· 提交数据源(Fetch):仅「提交表单」类型生效。点击后弹出 Fetch 数据源配置面板,选择接口地址和请求参数,请求参数支持绑定到表单字段值,提交时自动携带表单数据发起请求。\n· 提交时校验:关闭后跳过必填校验直接提交(适合草稿保存)\n· 点击事件:仅「自定义」类型生效\n\n不配置任何按钮时表单不显示按钮区域。'
|
|
1806
|
+
},
|
|
1807
|
+
name: 'operations',
|
|
1808
|
+
setter: {
|
|
1809
|
+
componentName: 'ArraySetter',
|
|
1810
|
+
props: {
|
|
1811
|
+
itemSetter: {
|
|
1812
|
+
componentName: 'ObjectSetter',
|
|
1813
|
+
props: {
|
|
1814
|
+
config: {
|
|
1815
|
+
items: [
|
|
1816
|
+
// ── 按钮文字
|
|
1817
|
+
{
|
|
1818
|
+
title: {
|
|
1819
|
+
label: '按钮文字',
|
|
1820
|
+
tip: '按钮上显示的文字,例如:立即预订、保存草稿、取消'
|
|
1821
|
+
},
|
|
1822
|
+
name: 'text',
|
|
1823
|
+
important: true,
|
|
1824
|
+
display: 'inline',
|
|
1825
|
+
setter: {
|
|
1826
|
+
componentName: 'StringSetter',
|
|
1827
|
+
isRequired: true,
|
|
1828
|
+
initialValue: '立即预订'
|
|
1829
|
+
}
|
|
1830
|
+
},
|
|
1831
|
+
// ── 操作类型
|
|
1832
|
+
{
|
|
1833
|
+
title: {
|
|
1834
|
+
label: '操作类型',
|
|
1835
|
+
tip: '· 提交表单:校验 → 收集字段值 → 调用「提交数据源(Fetch)」 → 触发 onSubmit 事件\n· 重置表单:清空所有字段,触发 onReset 事件\n· 自定义:直接调用「点击事件」函数,不涉及表单操作'
|
|
1836
|
+
},
|
|
1837
|
+
name: 'action',
|
|
1838
|
+
important: true,
|
|
1839
|
+
display: 'inline',
|
|
1840
|
+
setter: {
|
|
1841
|
+
componentName: 'SelectSetter',
|
|
1842
|
+
props: {
|
|
1843
|
+
options: [{
|
|
1844
|
+
label: '提交表单',
|
|
1845
|
+
value: 'submit'
|
|
1846
|
+
}, {
|
|
1847
|
+
label: '重置表单',
|
|
1848
|
+
value: 'reset'
|
|
1849
|
+
}, {
|
|
1850
|
+
label: '自定义',
|
|
1851
|
+
value: 'custom'
|
|
1852
|
+
}]
|
|
1853
|
+
},
|
|
1854
|
+
initialValue: 'submit'
|
|
1855
|
+
},
|
|
1856
|
+
extraProps: {
|
|
1857
|
+
setValue: function setValue(target, value) {
|
|
1858
|
+
var _target$parent123, _target$parent123$get, _target$parent125, _target$parent125$get, _target$parent127, _target$parent127$set;
|
|
1859
|
+
// 根据操作类型自动填充默认文字(仅当文字为空时)
|
|
1860
|
+
var textMap = {
|
|
1861
|
+
submit: '立即预订',
|
|
1862
|
+
reset: '重置',
|
|
1863
|
+
custom: '按钮'
|
|
1864
|
+
};
|
|
1865
|
+
if (!((_target$parent123 = target.parent) !== null && _target$parent123 !== void 0 && (_target$parent123$get = _target$parent123.getPropValue) !== null && _target$parent123$get !== void 0 && _target$parent123$get.call(_target$parent123, 'text'))) {
|
|
1866
|
+
var _target$parent124, _target$parent124$set;
|
|
1867
|
+
(_target$parent124 = target.parent) === null || _target$parent124 === void 0 ? void 0 : (_target$parent124$set = _target$parent124.setPropValue) === null || _target$parent124$set === void 0 ? void 0 : _target$parent124$set.call(_target$parent124, 'text', textMap[value] || '按钮');
|
|
1868
|
+
}
|
|
1869
|
+
// 根据操作类型自动设置默认样式
|
|
1870
|
+
if (!((_target$parent125 = target.parent) !== null && _target$parent125 !== void 0 && (_target$parent125$get = _target$parent125.getPropValue) !== null && _target$parent125$get !== void 0 && _target$parent125$get.call(_target$parent125, 'type'))) {
|
|
1871
|
+
var _target$parent126, _target$parent126$set;
|
|
1872
|
+
var typeMap = {
|
|
1873
|
+
submit: 'primary',
|
|
1874
|
+
reset: 'normal',
|
|
1875
|
+
custom: 'normal'
|
|
1876
|
+
};
|
|
1877
|
+
(_target$parent126 = target.parent) === null || _target$parent126 === void 0 ? void 0 : (_target$parent126$set = _target$parent126.setPropValue) === null || _target$parent126$set === void 0 ? void 0 : _target$parent126$set.call(_target$parent126, 'type', typeMap[value] || 'normal');
|
|
1878
|
+
}
|
|
1879
|
+
(_target$parent127 = target.parent) === null || _target$parent127 === void 0 ? void 0 : (_target$parent127$set = _target$parent127.setPropValue) === null || _target$parent127$set === void 0 ? void 0 : _target$parent127$set.call(_target$parent127, 'action', value);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
},
|
|
1883
|
+
// ── 按钮样式
|
|
1884
|
+
{
|
|
1885
|
+
title: {
|
|
1886
|
+
label: '按钮样式',
|
|
1887
|
+
tip: '· 主要(primary):蓝色高亮,适合提交等主操作\n· 次要(secondary):灰白色,适合次要操作\n· 普通(normal):普通灰色样式,适合重置等辅助操作'
|
|
1888
|
+
},
|
|
1889
|
+
name: 'type',
|
|
1890
|
+
setter: {
|
|
1891
|
+
componentName: 'SelectSetter',
|
|
1892
|
+
props: {
|
|
1893
|
+
options: [{
|
|
1894
|
+
label: '主要 (primary)',
|
|
1895
|
+
value: 'primary'
|
|
1896
|
+
}, {
|
|
1897
|
+
label: '次要 (secondary)',
|
|
1898
|
+
value: 'secondary'
|
|
1899
|
+
}, {
|
|
1900
|
+
label: '普通 (normal)',
|
|
1901
|
+
value: 'normal'
|
|
1902
|
+
}]
|
|
1903
|
+
},
|
|
1904
|
+
initialValue: 'normal'
|
|
1905
|
+
}
|
|
1906
|
+
},
|
|
1907
|
+
// ── 提交时校验(仅 submit)
|
|
1908
|
+
{
|
|
1909
|
+
title: {
|
|
1910
|
+
label: '提交时校验',
|
|
1911
|
+
tip: '开启后点击此按钮时先执行必填校验,校验不通过则不触发提交。\n关闭后跳过校验,直接提交(适合"草稿保存"等场景)。\n仅对「提交表单」类型按钮生效。'
|
|
1912
|
+
},
|
|
1913
|
+
name: 'submitValidate',
|
|
1914
|
+
condition: function condition(target) {
|
|
1915
|
+
var _target$parent128, _target$parent128$get;
|
|
1916
|
+
return ((_target$parent128 = target.parent) === null || _target$parent128 === void 0 ? void 0 : (_target$parent128$get = _target$parent128.getPropValue) === null || _target$parent128$get === void 0 ? void 0 : _target$parent128$get.call(_target$parent128, 'action')) === 'submit';
|
|
1917
|
+
},
|
|
1918
|
+
setter: {
|
|
1919
|
+
componentName: 'BoolSetter',
|
|
1920
|
+
initialValue: true
|
|
1921
|
+
}
|
|
1922
|
+
},
|
|
1923
|
+
// ── 提交数据源(Fetch,仅 submit)
|
|
1924
|
+
{
|
|
1925
|
+
title: {
|
|
1926
|
+
label: '提交数据源(Fetch)',
|
|
1927
|
+
tip: '点击后弹出 Fetch 数据源配置面板,配置表单提交的接口信息:\n\n· 请求地址(URL):后端接口地址,例如 /api/booking/create\n· 请求方式:POST / PUT / PATCH 等\n· 请求参数:支持绑定到表单字段值,提交时自动携带当前填写的数据\n 例如:将 body.user_name 绑定到表单字段 user_name 的值\n\n配置完成后,点击此按钮(立即预订)校验通过时,会自动发起该接口请求,无需在 onSubmit 事件中手写调用逻辑。\n\n多按钮场景:每个提交按钮可配置独立的接口(如"保存草稿"和"正式提交"对应不同接口)。\n\n仅对「提交表单」类型按钮生效。'
|
|
1928
|
+
},
|
|
1929
|
+
name: 'fetchConfig',
|
|
1930
|
+
condition: function condition(target) {
|
|
1931
|
+
var _target$parent129, _target$parent129$get;
|
|
1932
|
+
return ((_target$parent129 = target.parent) === null || _target$parent129 === void 0 ? void 0 : (_target$parent129$get = _target$parent129.getPropValue) === null || _target$parent129$get === void 0 ? void 0 : _target$parent129$get.call(_target$parent129, 'action')) === 'submit';
|
|
1933
|
+
},
|
|
1934
|
+
setter: {
|
|
1935
|
+
componentName: 'DataSourceSetter',
|
|
1936
|
+
props: {
|
|
1937
|
+
buttonText: '配置提交接口'
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
},
|
|
1941
|
+
// ── 点击事件(仅 custom)
|
|
1942
|
+
{
|
|
1943
|
+
title: {
|
|
1944
|
+
label: '点击事件',
|
|
1945
|
+
tip: '自定义按钮被点击时调用的函数,例如:跳转页面、打开弹窗。\n仅对「自定义」类型按钮生效。'
|
|
1946
|
+
},
|
|
1947
|
+
name: 'onClick',
|
|
1948
|
+
condition: function condition(target) {
|
|
1949
|
+
var _target$parent130, _target$parent130$get;
|
|
1950
|
+
return ((_target$parent130 = target.parent) === null || _target$parent130 === void 0 ? void 0 : (_target$parent130$get = _target$parent130.getPropValue) === null || _target$parent130$get === void 0 ? void 0 : _target$parent130$get.call(_target$parent130, 'action')) === 'custom';
|
|
1951
|
+
},
|
|
1952
|
+
setter: {
|
|
1953
|
+
componentName: 'FunctionSetter'
|
|
1954
|
+
},
|
|
1955
|
+
extraProps: {
|
|
1956
|
+
supportVariable: true
|
|
1957
|
+
}
|
|
1958
|
+
}]
|
|
1959
|
+
}
|
|
1960
|
+
},
|
|
1961
|
+
initialValue: function initialValue() {
|
|
1962
|
+
return {
|
|
1963
|
+
text: '立即预订',
|
|
1964
|
+
action: 'submit',
|
|
1965
|
+
type: 'primary',
|
|
1966
|
+
submitValidate: true
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
},
|
|
1971
|
+
initialValue: [{
|
|
1972
|
+
text: '立即预订',
|
|
1973
|
+
action: 'submit',
|
|
1974
|
+
type: 'primary',
|
|
1975
|
+
submitValidate: true
|
|
1976
|
+
}, {
|
|
1977
|
+
text: '重置',
|
|
1978
|
+
action: 'reset',
|
|
1979
|
+
type: 'normal'
|
|
1980
|
+
}]
|
|
1981
|
+
}
|
|
1982
|
+
}]
|
|
255
1983
|
}],
|
|
256
1984
|
supports: {
|
|
257
1985
|
style: true,
|
|
258
1986
|
events: [{
|
|
1987
|
+
name: 'onReset',
|
|
1988
|
+
template: "onReset(${extParams}){\n// \u70B9\u51FB\u91CD\u7F6E\u6309\u94AE\u540E\u89E6\u53D1\n// \u53EF\u5728\u6B64\u5904\u540C\u6B65\u9875\u9762 state \u6216\u6267\u884C\u5176\u4ED6\u6E05\u7A7A\u903B\u8F91\nconsole.log('[CustomForm] onReset');\n}"
|
|
1989
|
+
}, {
|
|
1990
|
+
name: 'onChange',
|
|
1991
|
+
template: "onChange(field, value, allValues,\${extParams}){\n// 任意字段值变化时触发\n// field = 变化的字段名(字符串)\n// value = 该字段的最新值\n// allValues = 当前所有字段值(含 computedFields 计算字段)\n// 常见用法:将字段值同步到页面 state\n// this.setState({ [field]: value })\nconsole.log('[CustomForm] onChange', field, value, allValues);\n}"
|
|
1992
|
+
}, {
|
|
259
1993
|
name: 'onSubmit',
|
|
260
|
-
template: "onSubmit(values, errors, field
|
|
1994
|
+
template: "onSubmit(values, errors, field,\${extParams}){\n// 提交成功(校验通过)时触发\n// values = 所有字段的当前值(含 computedFields 计算字段)\n// 无需再手动组装字段,直接使用 values 对象即可\nconsole.log('[CustomForm] onSubmit', values);\n}"
|
|
261
1995
|
}, {
|
|
262
1996
|
name: 'onSubmitFailed',
|
|
263
|
-
template: "onSubmitFailed(values, errors, field
|
|
1997
|
+
template: "onSubmitFailed(values, errors, field,\${extParams}){\n// 提交失败(校验未通过)时触发\n// errors = 校验错误信息对象,key 为字段名\nconsole.log('[CustomForm] onSubmitFailed', errors);\n}"
|
|
264
1998
|
}]
|
|
265
1999
|
}
|
|
266
2000
|
}
|
|
267
2001
|
};
|
|
268
2002
|
var snippets = [{
|
|
269
|
-
title: '
|
|
2003
|
+
title: '自定义表单(完整示例)',
|
|
270
2004
|
screenshot: '',
|
|
271
2005
|
schema: {
|
|
272
2006
|
componentName: 'CustomForm',
|
|
273
2007
|
props: {
|
|
274
|
-
columns:
|
|
2008
|
+
columns: 2,
|
|
2009
|
+
initialValues: [{
|
|
2010
|
+
field: 'guest_count',
|
|
2011
|
+
valueType: 'fixed',
|
|
2012
|
+
value: 10
|
|
2013
|
+
}],
|
|
2014
|
+
computedFields: [{
|
|
2015
|
+
targetField: 'order_desc',
|
|
2016
|
+
template: '{package_name},{package_price}元,预订日期:{banquet_date},人数:{guest_count}人'
|
|
2017
|
+
}],
|
|
275
2018
|
formItems: [{
|
|
276
|
-
field: '
|
|
277
|
-
label: '
|
|
2019
|
+
field: 'banquet_date',
|
|
2020
|
+
label: '宴请日期',
|
|
278
2021
|
required: true,
|
|
279
|
-
|
|
2022
|
+
placeholder: '请选择日期时间',
|
|
2023
|
+
componentType: 'DateTimePicker',
|
|
280
2024
|
componentProps: {
|
|
281
|
-
|
|
2025
|
+
format: 'YYYY-MM-DD HH:mm'
|
|
282
2026
|
}
|
|
283
2027
|
}, {
|
|
284
|
-
field: '
|
|
285
|
-
label: '
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
2028
|
+
field: 'guest_count',
|
|
2029
|
+
label: '宴请人数',
|
|
2030
|
+
required: true,
|
|
2031
|
+
placeholder: '请输入人数',
|
|
2032
|
+
componentType: 'NumberPicker'
|
|
2033
|
+
}, {
|
|
2034
|
+
field: 'package_name',
|
|
2035
|
+
label: '套餐名称',
|
|
2036
|
+
required: true,
|
|
2037
|
+
componentType: 'Select',
|
|
2038
|
+
placeholder: '请选择套餐',
|
|
2039
|
+
options: []
|
|
2040
|
+
}, {
|
|
2041
|
+
field: 'package_price',
|
|
2042
|
+
label: '套餐价格',
|
|
2043
|
+
componentType: 'Input',
|
|
2044
|
+
componentProps: {
|
|
2045
|
+
readOnly: true
|
|
2046
|
+
},
|
|
2047
|
+
extra: '选择套餐后自动填入'
|
|
2048
|
+
}, {
|
|
2049
|
+
field: 'user_name',
|
|
2050
|
+
label: '预订人姓名',
|
|
2051
|
+
required: true,
|
|
2052
|
+
placeholder: '请输入姓名',
|
|
2053
|
+
componentType: 'Input'
|
|
2054
|
+
}, {
|
|
2055
|
+
field: 'user_mobile',
|
|
2056
|
+
label: '联系方式',
|
|
2057
|
+
required: true,
|
|
2058
|
+
placeholder: '请输入手机号',
|
|
2059
|
+
componentType: 'Input'
|
|
2060
|
+
}, {
|
|
2061
|
+
field: 'memo',
|
|
2062
|
+
label: '备注',
|
|
2063
|
+
placeholder: '请输入备注(选填)',
|
|
2064
|
+
componentType: 'TextArea',
|
|
2065
|
+
columnSpan: 2
|
|
294
2066
|
}],
|
|
295
|
-
|
|
296
|
-
|
|
2067
|
+
fieldLinkage: [{
|
|
2068
|
+
watchField: 'package_name',
|
|
2069
|
+
linkageMode: 'simple',
|
|
2070
|
+
matchValue: '豪华套餐',
|
|
2071
|
+
fillField: 'package_price',
|
|
2072
|
+
fillValueType: 'fixed',
|
|
2073
|
+
fillValue: 9800
|
|
2074
|
+
}],
|
|
2075
|
+
operations: [{
|
|
2076
|
+
text: '立即预订',
|
|
2077
|
+
action: 'submit',
|
|
2078
|
+
type: 'primary',
|
|
2079
|
+
submitValidate: true
|
|
2080
|
+
}, {
|
|
2081
|
+
text: '重置',
|
|
2082
|
+
action: 'reset',
|
|
2083
|
+
type: 'normal'
|
|
2084
|
+
}]
|
|
297
2085
|
}
|
|
298
2086
|
}
|
|
299
2087
|
}];
|