feat(mock): Add mock

This commit is contained in:
kailong321200875
2022-01-08 18:38:20 +08:00
parent 357fc44e51
commit 3fc7d4d39a
20 changed files with 354 additions and 67 deletions

3
types/componentType/configGlobal.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
declare interface ConfigGlobalTypes {
size?: ElememtPlusSzie
}

97
types/componentType/form.d.ts vendored Normal file
View File

@@ -0,0 +1,97 @@
import type { CSSProperties } from 'vue'
declare global {
declare type ComponentName =
| 'Radio'
| 'RadioButton'
| 'Checkbox'
| 'CheckboxButton'
| 'Input'
| 'Autocomplete'
| 'InputNumber'
| 'Select'
| 'Cascader'
| 'Switch'
| 'Slider'
| 'TimePicker'
| 'DatePicker'
| 'Rate'
| 'ColorPicker'
| 'Transfer'
| 'Divider'
| 'TimeSelect'
| 'SelectV2'
| 'InputPassword'
declare type ColProps = {
span?: number
xs?: number
sm?: number
md?: number
lg?: number
xl?: number
tag?: string
}
declare type FormValueType = string | number | string[] | number[] | boolean | undefined | null
declare type FormItemProps = {
labelWidth?: string | number
required?: boolean
rules?: Recordable
error?: string
showMessage?: boolean
inlineMessage?: boolean
style?: CSSProperties
}
declare type ComponentOptions = {
label?: string
value?: FormValueType
disabled?: boolean
key?: string | number
children?: ComponentOptions[]
options?: ComponentOptions[]
} & Recordable
declare type ComponentOptionsAlias = {
labelField?: string
valueField?: string
}
declare type ComponentProps = {
optionsAlias?: ComponentOptionsAlias
options?: ComponentOptions[]
optionsSlot?: boolean
} & Recordable
declare type FormSchema = {
// 唯一值
field: string
// 标题
label?: string
// col组件属性
colProps?: ColProps
// 表单组件属性slots对应的是表单组件的插槽规则${field}-xxx具体可以查看element-plus文档
componentProps?: { slots?: Recordable } & ComponentProps
// formItem组件属性
formItemProps?: FormItemProps
// 渲染的组件
component?: ComponentName
// 初始值
value?: FormValueType
// 是否隐藏
hidden?: boolean
}
declare type FormSetValuesType = {
field: string
value: FormValueType
}
declare type FormSetPropsType = {
field: string
path: string
value: any
}
}

5
types/componentType/icon.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
declare interface IconTypes {
size?: number
color?: string
icon: string
}

10
types/componentType/localeDropdown.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
declare interface Language {
el: Recordable
name: string
}
declare interface LocaleDropdownType {
lang: LocaleType
name?: string
elLocale?: Language
}