提交 | 用户 | 时间
|
fd2207
|
1 |
export const formConf = { |
懒 |
2 |
formRef: 'elForm', |
|
3 |
formModel: 'formData', |
|
4 |
size: 'medium', |
|
5 |
labelPosition: 'right', |
|
6 |
labelWidth: 100, |
|
7 |
formRules: 'rules', |
|
8 |
gutter: 15, |
|
9 |
disabled: false, |
|
10 |
span: 24, |
|
11 |
formBtns: true |
|
12 |
} |
|
13 |
|
|
14 |
export const inputComponents = [ |
|
15 |
{ |
|
16 |
label: '单行文本', |
|
17 |
tag: 'el-input', |
|
18 |
tagIcon: 'input', |
|
19 |
placeholder: '请输入', |
|
20 |
defaultValue: undefined, |
|
21 |
span: 24, |
|
22 |
labelWidth: null, |
|
23 |
style: { width: '100%' }, |
|
24 |
clearable: true, |
|
25 |
prepend: '', |
|
26 |
append: '', |
|
27 |
'prefix-icon': '', |
|
28 |
'suffix-icon': '', |
|
29 |
maxlength: null, |
|
30 |
'show-word-limit': false, |
|
31 |
readonly: false, |
|
32 |
disabled: false, |
|
33 |
required: true, |
|
34 |
regList: [], |
|
35 |
changeTag: true, |
|
36 |
document: 'https://element.eleme.cn/#/zh-CN/component/input' |
|
37 |
}, |
|
38 |
{ |
|
39 |
label: '多行文本', |
|
40 |
tag: 'el-input', |
|
41 |
tagIcon: 'textarea', |
|
42 |
type: 'textarea', |
|
43 |
placeholder: '请输入', |
|
44 |
defaultValue: undefined, |
|
45 |
span: 24, |
|
46 |
labelWidth: null, |
|
47 |
autosize: { |
|
48 |
minRows: 4, |
|
49 |
maxRows: 4 |
|
50 |
}, |
|
51 |
style: { width: '100%' }, |
|
52 |
maxlength: null, |
|
53 |
'show-word-limit': false, |
|
54 |
readonly: false, |
|
55 |
disabled: false, |
|
56 |
required: true, |
|
57 |
regList: [], |
|
58 |
changeTag: true, |
|
59 |
document: 'https://element.eleme.cn/#/zh-CN/component/input' |
|
60 |
}, |
|
61 |
{ |
|
62 |
label: '密码', |
|
63 |
tag: 'el-input', |
|
64 |
tagIcon: 'password', |
|
65 |
placeholder: '请输入', |
|
66 |
defaultValue: undefined, |
|
67 |
span: 24, |
|
68 |
'show-password': true, |
|
69 |
labelWidth: null, |
|
70 |
style: { width: '100%' }, |
|
71 |
clearable: true, |
|
72 |
prepend: '', |
|
73 |
append: '', |
|
74 |
'prefix-icon': '', |
|
75 |
'suffix-icon': '', |
|
76 |
maxlength: null, |
|
77 |
'show-word-limit': false, |
|
78 |
readonly: false, |
|
79 |
disabled: false, |
|
80 |
required: true, |
|
81 |
regList: [], |
|
82 |
changeTag: true, |
|
83 |
document: 'https://element.eleme.cn/#/zh-CN/component/input' |
|
84 |
}, |
|
85 |
{ |
|
86 |
label: '计数器', |
|
87 |
tag: 'el-input-number', |
|
88 |
tagIcon: 'number', |
|
89 |
placeholder: '', |
|
90 |
defaultValue: undefined, |
|
91 |
span: 24, |
|
92 |
labelWidth: null, |
|
93 |
min: undefined, |
|
94 |
max: undefined, |
|
95 |
step: undefined, |
|
96 |
'step-strictly': false, |
|
97 |
precision: undefined, |
|
98 |
'controls-position': '', |
|
99 |
disabled: false, |
|
100 |
required: true, |
|
101 |
regList: [], |
|
102 |
changeTag: true, |
|
103 |
document: 'https://element.eleme.cn/#/zh-CN/component/input-number' |
|
104 |
} |
|
105 |
] |
|
106 |
|
|
107 |
export const selectComponents = [ |
|
108 |
{ |
|
109 |
label: '下拉选择', |
|
110 |
tag: 'el-select', |
|
111 |
tagIcon: 'select', |
|
112 |
placeholder: '请选择', |
|
113 |
defaultValue: undefined, |
|
114 |
span: 24, |
|
115 |
labelWidth: null, |
|
116 |
style: { width: '100%' }, |
|
117 |
clearable: true, |
|
118 |
disabled: false, |
|
119 |
required: true, |
|
120 |
filterable: false, |
|
121 |
multiple: false, |
|
122 |
options: [{ |
|
123 |
label: '选项一', |
|
124 |
value: 1 |
|
125 |
}, { |
|
126 |
label: '选项二', |
|
127 |
value: 2 |
|
128 |
}], |
|
129 |
regList: [], |
|
130 |
changeTag: true, |
|
131 |
document: 'https://element.eleme.cn/#/zh-CN/component/select' |
|
132 |
}, |
|
133 |
{ |
|
134 |
label: '级联选择', |
|
135 |
tag: 'el-cascader', |
|
136 |
tagIcon: 'cascader', |
|
137 |
placeholder: '请选择', |
|
138 |
defaultValue: [], |
|
139 |
span: 24, |
|
140 |
labelWidth: null, |
|
141 |
style: { width: '100%' }, |
|
142 |
props: { |
|
143 |
props: { |
|
144 |
multiple: false |
|
145 |
} |
|
146 |
}, |
|
147 |
'show-all-levels': true, |
|
148 |
disabled: false, |
|
149 |
clearable: true, |
|
150 |
filterable: false, |
|
151 |
required: true, |
|
152 |
options: [{ |
|
153 |
id: 1, |
|
154 |
value: 1, |
|
155 |
label: '选项1', |
|
156 |
children: [{ |
|
157 |
id: 2, |
|
158 |
value: 2, |
|
159 |
label: '选项1-1' |
|
160 |
}] |
|
161 |
}], |
|
162 |
dataType: 'dynamic', |
|
163 |
labelKey: 'label', |
|
164 |
valueKey: 'value', |
|
165 |
childrenKey: 'children', |
|
166 |
separator: '/', |
|
167 |
regList: [], |
|
168 |
changeTag: true, |
|
169 |
document: 'https://element.eleme.cn/#/zh-CN/component/cascader' |
|
170 |
}, |
|
171 |
{ |
|
172 |
label: '单选框组', |
|
173 |
tag: 'el-radio-group', |
|
174 |
tagIcon: 'radio', |
|
175 |
defaultValue: undefined, |
|
176 |
span: 24, |
|
177 |
labelWidth: null, |
|
178 |
style: {}, |
|
179 |
optionType: 'default', |
|
180 |
border: false, |
|
181 |
size: 'medium', |
|
182 |
disabled: false, |
|
183 |
required: true, |
|
184 |
options: [{ |
|
185 |
label: '选项一', |
|
186 |
value: 1 |
|
187 |
}, { |
|
188 |
label: '选项二', |
|
189 |
value: 2 |
|
190 |
}], |
|
191 |
regList: [], |
|
192 |
changeTag: true, |
|
193 |
document: 'https://element.eleme.cn/#/zh-CN/component/radio' |
|
194 |
}, |
|
195 |
{ |
|
196 |
label: '多选框组', |
|
197 |
tag: 'el-checkbox-group', |
|
198 |
tagIcon: 'checkbox', |
|
199 |
defaultValue: [], |
|
200 |
span: 24, |
|
201 |
labelWidth: null, |
|
202 |
style: {}, |
|
203 |
optionType: 'default', |
|
204 |
border: false, |
|
205 |
size: 'medium', |
|
206 |
disabled: false, |
|
207 |
required: true, |
|
208 |
options: [{ |
|
209 |
label: '选项一', |
|
210 |
value: 1 |
|
211 |
}, { |
|
212 |
label: '选项二', |
|
213 |
value: 2 |
|
214 |
}], |
|
215 |
regList: [], |
|
216 |
changeTag: true, |
|
217 |
document: 'https://element.eleme.cn/#/zh-CN/component/checkbox' |
|
218 |
}, |
|
219 |
{ |
|
220 |
label: '开关', |
|
221 |
tag: 'el-switch', |
|
222 |
tagIcon: 'switch', |
|
223 |
defaultValue: false, |
|
224 |
span: 24, |
|
225 |
labelWidth: null, |
|
226 |
style: {}, |
|
227 |
disabled: false, |
|
228 |
required: true, |
|
229 |
'active-text': '', |
|
230 |
'inactive-text': '', |
|
231 |
'active-color': null, |
|
232 |
'inactive-color': null, |
|
233 |
'active-value': true, |
|
234 |
'inactive-value': false, |
|
235 |
regList: [], |
|
236 |
changeTag: true, |
|
237 |
document: 'https://element.eleme.cn/#/zh-CN/component/switch' |
|
238 |
}, |
|
239 |
{ |
|
240 |
label: '滑块', |
|
241 |
tag: 'el-slider', |
|
242 |
tagIcon: 'slider', |
|
243 |
defaultValue: null, |
|
244 |
span: 24, |
|
245 |
labelWidth: null, |
|
246 |
disabled: false, |
|
247 |
required: true, |
|
248 |
min: 0, |
|
249 |
max: 100, |
|
250 |
step: 1, |
|
251 |
'show-stops': false, |
|
252 |
range: false, |
|
253 |
regList: [], |
|
254 |
changeTag: true, |
|
255 |
document: 'https://element.eleme.cn/#/zh-CN/component/slider' |
|
256 |
}, |
|
257 |
{ |
|
258 |
label: '时间选择', |
|
259 |
tag: 'el-time-picker', |
|
260 |
tagIcon: 'time', |
|
261 |
placeholder: '请选择', |
|
262 |
defaultValue: null, |
|
263 |
span: 24, |
|
264 |
labelWidth: null, |
|
265 |
style: { width: '100%' }, |
|
266 |
disabled: false, |
|
267 |
clearable: true, |
|
268 |
required: true, |
|
269 |
'picker-options': { |
|
270 |
selectableRange: '00:00:00-23:59:59' |
|
271 |
}, |
|
272 |
format: 'HH:mm:ss', |
|
273 |
'value-format': 'HH:mm:ss', |
|
274 |
regList: [], |
|
275 |
changeTag: true, |
|
276 |
document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' |
|
277 |
}, |
|
278 |
{ |
|
279 |
label: '时间范围', |
|
280 |
tag: 'el-time-picker', |
|
281 |
tagIcon: 'time-range', |
|
282 |
defaultValue: null, |
|
283 |
span: 24, |
|
284 |
labelWidth: null, |
|
285 |
style: { width: '100%' }, |
|
286 |
disabled: false, |
|
287 |
clearable: true, |
|
288 |
required: true, |
|
289 |
'is-range': true, |
|
290 |
'range-separator': '至', |
|
291 |
'start-placeholder': '开始时间', |
|
292 |
'end-placeholder': '结束时间', |
|
293 |
format: 'HH:mm:ss', |
|
294 |
'value-format': 'HH:mm:ss', |
|
295 |
regList: [], |
|
296 |
changeTag: true, |
|
297 |
document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' |
|
298 |
}, |
|
299 |
{ |
|
300 |
label: '日期选择', |
|
301 |
tag: 'el-date-picker', |
|
302 |
tagIcon: 'date', |
|
303 |
placeholder: '请选择', |
|
304 |
defaultValue: null, |
|
305 |
type: 'date', |
|
306 |
span: 24, |
|
307 |
labelWidth: null, |
|
308 |
style: { width: '100%' }, |
|
309 |
disabled: false, |
|
310 |
clearable: true, |
|
311 |
required: true, |
|
312 |
format: 'yyyy-MM-dd', |
|
313 |
'value-format': 'yyyy-MM-dd', |
|
314 |
readonly: false, |
|
315 |
regList: [], |
|
316 |
changeTag: true, |
|
317 |
document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' |
|
318 |
}, |
|
319 |
{ |
|
320 |
label: '日期范围', |
|
321 |
tag: 'el-date-picker', |
|
322 |
tagIcon: 'date-range', |
|
323 |
defaultValue: null, |
|
324 |
span: 24, |
|
325 |
labelWidth: null, |
|
326 |
style: { width: '100%' }, |
|
327 |
type: 'daterange', |
|
328 |
'range-separator': '至', |
|
329 |
'start-placeholder': '开始日期', |
|
330 |
'end-placeholder': '结束日期', |
|
331 |
disabled: false, |
|
332 |
clearable: true, |
|
333 |
required: true, |
|
334 |
format: 'yyyy-MM-dd', |
|
335 |
'value-format': 'yyyy-MM-dd', |
|
336 |
readonly: false, |
|
337 |
regList: [], |
|
338 |
changeTag: true, |
|
339 |
document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' |
|
340 |
}, |
|
341 |
{ |
|
342 |
label: '评分', |
|
343 |
tag: 'el-rate', |
|
344 |
tagIcon: 'rate', |
|
345 |
defaultValue: 0, |
|
346 |
span: 24, |
|
347 |
labelWidth: null, |
|
348 |
style: {}, |
|
349 |
max: 5, |
|
350 |
'allow-half': false, |
|
351 |
'show-text': false, |
|
352 |
'show-score': false, |
|
353 |
disabled: false, |
|
354 |
required: true, |
|
355 |
regList: [], |
|
356 |
changeTag: true, |
|
357 |
document: 'https://element.eleme.cn/#/zh-CN/component/rate' |
|
358 |
}, |
|
359 |
{ |
|
360 |
label: '颜色选择', |
|
361 |
tag: 'el-color-picker', |
|
362 |
tagIcon: 'color', |
|
363 |
defaultValue: null, |
|
364 |
labelWidth: null, |
|
365 |
'show-alpha': false, |
|
366 |
'color-format': '', |
|
367 |
disabled: false, |
|
368 |
required: true, |
|
369 |
size: 'medium', |
|
370 |
regList: [], |
|
371 |
changeTag: true, |
|
372 |
document: 'https://element.eleme.cn/#/zh-CN/component/color-picker' |
|
373 |
}, |
|
374 |
{ |
|
375 |
label: '上传', |
|
376 |
tag: 'el-upload', |
|
377 |
tagIcon: 'upload', |
|
378 |
action: 'https://jsonplaceholder.typicode.com/posts/', |
|
379 |
defaultValue: null, |
|
380 |
labelWidth: null, |
|
381 |
disabled: false, |
|
382 |
required: true, |
|
383 |
accept: '', |
|
384 |
name: 'file', |
|
385 |
'auto-upload': true, |
|
386 |
showTip: false, |
|
387 |
buttonText: '点击上传', |
|
388 |
fileSize: 2, |
|
389 |
sizeUnit: 'MB', |
|
390 |
'list-type': 'text', |
|
391 |
multiple: false, |
|
392 |
regList: [], |
|
393 |
changeTag: true, |
|
394 |
document: 'https://element.eleme.cn/#/zh-CN/component/upload' |
|
395 |
} |
|
396 |
] |
|
397 |
|
|
398 |
export const layoutComponents = [ |
|
399 |
{ |
|
400 |
layout: 'rowFormItem', |
|
401 |
tagIcon: 'row', |
|
402 |
type: 'default', |
|
403 |
justify: 'start', |
|
404 |
align: 'top', |
|
405 |
label: '行容器', |
|
406 |
layoutTree: true, |
|
407 |
children: [], |
|
408 |
document: 'https://element.eleme.cn/#/zh-CN/component/layout' |
|
409 |
}, |
|
410 |
{ |
|
411 |
layout: 'colFormItem', |
|
412 |
label: '按钮', |
|
413 |
changeTag: true, |
|
414 |
labelWidth: null, |
|
415 |
tag: 'el-button', |
|
416 |
tagIcon: 'button', |
|
417 |
span: 24, |
|
418 |
default: '主要按钮', |
|
419 |
type: 'primary', |
|
420 |
icon: 'el-icon-search', |
|
421 |
size: 'medium', |
|
422 |
disabled: false, |
|
423 |
document: 'https://element.eleme.cn/#/zh-CN/component/button' |
|
424 |
} |
|
425 |
] |
|
426 |
|
|
427 |
// 组件rule的触发方式,无触发方式的组件不生成rule |
|
428 |
export const trigger = { |
|
429 |
'el-input': 'blur', |
|
430 |
'el-input-number': 'blur', |
|
431 |
'el-select': 'change', |
|
432 |
'el-radio-group': 'change', |
|
433 |
'el-checkbox-group': 'change', |
|
434 |
'el-cascader': 'change', |
|
435 |
'el-time-picker': 'change', |
|
436 |
'el-date-picker': 'change', |
|
437 |
'el-rate': 'change' |
|
438 |
} |