提交 | 用户 | 时间
|
314507
|
1 |
import type { CSSProperties } from 'vue' |
H |
2 |
import { ColProps, ComponentProps, ComponentName } from '@/types/components' |
|
3 |
import type { AxiosPromise } from 'axios' |
|
4 |
|
|
5 |
export type FormSetPropsType = { |
|
6 |
field: string |
|
7 |
path: string |
|
8 |
value: any |
|
9 |
} |
|
10 |
|
|
11 |
export type FormValueType = string | number | string[] | number[] | boolean | undefined | null |
|
12 |
|
|
13 |
export type FormItemProps = { |
|
14 |
labelWidth?: string | number |
|
15 |
required?: boolean |
|
16 |
rules?: Recordable |
|
17 |
error?: string |
|
18 |
showMessage?: boolean |
|
19 |
inlineMessage?: boolean |
|
20 |
style?: CSSProperties |
|
21 |
} |
|
22 |
|
|
23 |
export type FormSchema = { |
|
24 |
// 唯一值 |
|
25 |
field: string |
|
26 |
// 标题 |
|
27 |
label?: string |
|
28 |
// 提示 |
|
29 |
labelMessage?: string |
|
30 |
// col组件属性 |
|
31 |
colProps?: ColProps |
|
32 |
// 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档 |
|
33 |
componentProps?: { slots?: Recordable } & ComponentProps |
|
34 |
// formItem组件属性 |
|
35 |
formItemProps?: FormItemProps |
|
36 |
// 渲染的组件 |
|
37 |
component?: ComponentName |
|
38 |
// 初始值 |
|
39 |
value?: FormValueType |
|
40 |
// 是否隐藏 |
|
41 |
hidden?: boolean |
|
42 |
// 远程加载下拉项 |
|
43 |
api?: <T = any>() => AxiosPromise<T> |
|
44 |
} |