dackou-element-components
Version:
754 lines (689 loc) • 15.9 kB
text/typescript
import { CSSProperties, Component } from "vue";
import { RuleItem } from "./rule";
import { FormInstance, UploadUserFile } from "element-plus";
export interface HeadersItem{
Authorization?: string,
token?: string,
"Content-Type"?: string
}
export interface UserItem{
id?: number,
uid: number | string,
nickname: string,
username?: string,
realname?: string,
face?: string,
mobile?: string,
is_valid_mobile?: number | boolean,
email?: string,
is_valid_email?: number | boolean,
idcard?: string,
birth?: string,
gender?: number | string,
is_auth?: number | boolean,
auth_type?: number | string,
auth_name?: string,
invite_code?: string,
score?: number,
balance?: number,
role_name?: string,
create_time?: number | string,
ctime?: string,
regip?: string,
login_count?: number,
last_login_time?: string,
token?: string
}
export interface UploadItem{
url?: string | [],
options?: UploadOptions
}
export interface UploadOptions{
type?: '' | 'img' | 'file' | 'video' | 'voice' | 'doc' | 'cert',
url?: string | [],
headers?: HeadersItem,
method?: string,
size?: 'small' | 'default' | 'large',
multiple?: boolean,
action?: string,
data?: any,
name?: string,
withCredentials?:boolean,
showFileList?:boolean,
drag?: boolean,
accept?: string,
fileList?: any,
listType?: 'text' | 'picture' | 'picture-card',
autoUpload?: boolean,
disabled?: boolean,
limit?: number
}
export interface CascaderItem{
label?: string
value?: string | number,
children?: CascaderItem[]
}
export interface SeleceItem{
id?: number,
title?: string,
label?: string,
value?: any,
disabled?: boolean
}
export interface BreadcrumbItem{
id?: number,
title: string,
router?: string,
}
export interface CarouselItem{
id?: number,
title?: string,
src?: string,
alt?: string,
url?: string,
content?: string
}
export interface CityItem{
id?: number,
title: string,
level?: number,
pid?: number,
children?: CityItem[]
}
export interface CollapseItem{
id?: number,
title?: string,
name?: string,
content?: any
}
export interface DropdownItem{
id?: number,
title: string,
router?: string,
callback?: () => void,
children?: DropdownItem[]
}
export interface EditorOptionsItem{
type?: string,
prefix?: string,
value?: string,
loadingText?: string,
image?: EditorUploadItem,
video?: EditorUploadItem,
}
export interface EditorUploadItem{
service?: string,
fieldName?: string,
maxFileSize?: number,
chunkSize?: number,
maxNumberOfFiles?: number,
allowedFileTypes?: [],
meta?: any,
metaWithUrl?: boolean,
headers?: any,
withCredentials?: boolean,
timeout?: number
}
export interface FormOptions{
type: string,
label?: string,
prop?: string,
value?: any,
placeholder?: string,
rules?: any,
children?: any[],
attrs?: any,
uploadAttrs?: any,
editorOptions?: any,
slot?: any,
options?: any,
color?: string,
width?: number,
prefix?: string,
suffix?: string,
prepend?: string,
append?: string,
delimiter?: string,
required?: boolean,
message?: string,
desc?: string,
desc_color?: string,
desc_size?: number
}
export interface FormProps{
value?: any,
children?: any[],
slot?: any,
options?: any,
delimiter?: string,
size?: '' | 'large' | 'default' | 'small'
}
export interface FormUploadProps{
type?: string,
value?: any,
options?: any,
limit?: number,
size?: 'small' | 'default' | 'large' | '',
prefix?: string,
action?: string,
desc?: string,
method?: string,
multiple?: boolean,
data?: any,
name?: string,
withCredentials?: boolean,
showFileList?: boolean,
drag?: boolean,
accept?: string,
crossorigin?: any,
listType?: any,
autoUpload?: boolean,
disabled?: boolean,
headers?: HeadersItem,
style?: any
}
export interface FormTableOptions{
data: any[],
thead: any[],
options?: any
}
export interface FormSpecData{
id?: number,
title?: string,
label?: string,
prop?: string,
value?: any[]
}
export interface CalculateOptions{
formula?: 'sum' | 'mul',
prop: string,
param?: string[],
decimal?: 0
}
export interface CaptchaOptions{
src: string,
fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down',
width?: number,
height?: number
}
export interface FormSlotItem{
prefix?: FormSlotOption,
suffix?: FormSlotOption,
prepend?: FormSlotOption,
append?: FormSlotOption,
}
export interface FormSlotOption{
type?: 'string' | 'select' | 'dropdown',
value?: any,
size?: number,
color?: string,
time?: number,
action?: string,
url?: string,
text?: string,
fit?: string,
callback?: string
}
export interface FormAttrItem{
id?: number,
label?: string,
prop?: string,
value?: any
}
export interface FormAttrOptions{
tipWidth?: number | string,
desc?: string,
attrData?: FormGoodsOptions[]
}
export interface FormGoodsItem{
tipWidth?: number | string,
desc?: string,
optionsData?: FormGoodsOptions[],
specOptions?: FormOptions[],
specValue?: any[]
}
export interface FormSpecItem{
id?: number,
title?: string,
prop?: string,
value?: any
}
export interface FormSpecOptions{
tipWidth?: number | string,
desc?: string,
specData?: FormGoodsOptions[]
}
export interface FormGoodsOptions{
id?: number,
title?: string,
label?: string,
selected?: number | boolean,
field_name?: string,
field_type?: string,
field_length?: number,
default_value?: string | string[]
is_required?: boolean | number,
level?: number,
pid?: number,
number?: number,
sort?: number,
value?: any,
disabled?: boolean | string,
children?: FormGoodsOptions[]
}
export interface FormAttrsItem{
type?: string,
placeholder?: string,
format?: string,
multiple?: boolean,
size?: 'default' | 'small' | 'large',
maxlength?: string | number,
minlength?: string | number,
clearable?: boolean,
showPassword?: boolean,
disabled?: boolean,
prefixIcon?: string | Component,
suffixIcon?: string | Component,
rows?: number,
autocomplete?: string,
name?: string,
readonly?: boolean,
max?: any,
min?: any,
autofocus?: boolean,
label?: string,
style?: CSSProperties,
gutter?: number,
span?: number,
options?: CascaderItem[]
}
export interface UploadAttrsItem{
type?: 'default' | 'drag' | 'avatar' | 'pic' | 'card' | 'file',
size?: 'default' | 'small' | 'large',
prefix?: string,
action?: string,
headers?: Headers | Record<string,any>,
method?: string,
multiple?: boolean,
data?: Record<string,any>,
name?: string,
withCredentials?: boolean,
showFileList?: boolean,
drag?: boolean,
accept?: string,
fileList?: UploadUserFile[],
listType?: 'text' | 'picture' | 'picture-card',
autoUpload?: boolean,
disabled?: boolean,
limit?: number
}
export interface SpecOptionsItem{
data?: any[],
options?: TableOptions[]
}
export interface MenuItem{
id?: number,
title: string,
router?: string,
icon?: string,
level?: number,
pid?: number,
number?: number,
children?: MenuItem[]
}
export interface MenuOptions{
id?: number,
title?: string,
aside_width?: number,
aside_heigth?: number,
is_nav?: number,
is_nav_icon?: number,
nav_font_size?: number,
nav_text_color?: string,
nav_hover_color?: string,
nav_bg_color?: string,
nav_hover_bg_color?: string,
aside_bg_color?: string,
aside_text_color?: string,
menu_is_icon?: number[],
menu_font_size?: number,
menu_font_bold?: 0,
menu_text_color?: string,
menu_hover_text_color?: string,
menu_bg_color?: string,
menu_hover_bg_color?: string,
sub_font_size?: number,
sub_font_blod?: number,
sub_text_color?: string,
sub_hover_text_color?: string,
sub_bg_color?: string,
sub_hover_bg_color?: string,
main_bg_color?: string
}
export interface SkinItem{
id?: number,
title?: string,
mode?: 'hm' | 'hmf' | 'am' | 'ham' | 'hamf' | 'ahm' | 'ahmf',
is_full_screen?: number | boolean,
aside_width?: number,
aside_bg_color?: string,
header_bg_color?: string,
header_height?: number,
header_text_color?: string,
main_padding?: number,
main_bg_color?: string,
menu_font_size?: number,
menu_text_color?: string,
menu_active_color?: string,
menu_bg_color?: string,
sub_font_size?: number,
sub_text_color?: string,
sub_active_color?: string,
sub_bg_color?: string
}
export interface TableOptions{
type: string,
label: string,
prop?: string,
fixed?: string,
width?: string | number,
order?: boolean,
prefix?: string,
suffix?: string,
align?: 'left' | 'center' | 'right' | 'start' | 'end',
size?: number,
length?: number,
color?: string,
default?: any,
value?: any,
router?: string,
url?: string,
alias?: string,
editable?: boolean,
slot?: any,
sortable?: boolean,
action?: boolean,
desc?: string,
callback?: string,
is_switch?: boolean,
disabled?: boolean,
readonly?: boolean,
data?: mapItem[],
fields?: string[],
format?: FormatOptions,
delimiter?: string,
toggle?: boolean | number,
}
export interface TableDataProps{
data: any,
scope: any,
options?: any,
value?: any,
}
export interface ColorItem{
primary: string,
success: string,
warning: string,
danger: string,
info: string
}
export interface FormatOptions{
type?: string,
calc?: '+' | '-' | '*' | '/' | '',
decimal?: number,
value?: number,
format?: string,
}
export interface mapItem{
type?: string,
id?: any,
title?: string,
label?: string,
value?: any,
color?: string,
callback?: string
}
export interface MenuOptions{
logoSize?: string,
logoColor?: string,
textSize?: string,
backgroundColor?: string,
textColor?: string,
activeTextColor?: string,
borderBottom?: boolean,
borderBottomColor?: string,
hoverBgColor?: string,
hoverAfterColor?: string,
hoverTextColor?: string
}
export interface AboutItem{
title?: string,
enTitle?: string,
pic?: string,
fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down',
width?: string,
height?: string,
content?: string
}
export interface GridItem{
id?: number,
title?: string,
icon?: string,
pic?: string,
title_color?: string,
desc_color?: string,
bg_color?: string,
font_size?: number,
desc_size?: number,
keyword?: string,
desc?: string,
router?: string,
name?: string,
gutter?: number,
span?: number,
width?: number | string,
height?: number | string,
margin?: number,
padding?: number,
border?: number,
border_color?: string,
hover_color?: string,
hover_border_width?: number,
hover_border_color?: string,
img_fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset',
img_bg_color?: string,
img_text_color?: string,
img_font_size?: number,
img_keyword_size?: number,
img_keyword_color?: string,
img_desc_size?: number,
img_desc_color?: string,
children?: GridData[]
}
export interface GridData{
id?: number,
title?: string,
pic?: string,
keyword?: string,
desc?: string,
router?: string,
}
export interface TableItem{
title?: string,
table?: string,
primaryKey?: string,
layer?: number,
thead?: TableOptions[],
rows?: number,
data?: any[],
query?: FormOptions[],
action?: string,
callback?: boolean,
grant?: any,
prefix?: string,
api?: string,
importFile?: string,
is_total?: number,
is_size?: number,
is_jumper?: number,
tabs?: TabsItem[],
page?: number,
pagesize?: number,
options?: TableItemOptions
}
export interface TableItemOptions{
is_size?: boolean,
is_total?: boolean,
is_jumper?: boolean,
import?: string,
import_file?: string,
callback?: boolean,
}
export interface TableDataOptions{
table?: string,
title?: string,
width?: number,
bg_color?: string,
is_add?: boolean,
btn_add?: string,
prefix?: string,
api?: string,
is_tooltip?: boolean
}
export interface TabsItem{
id?: number,
title?: string,
value?: number | string,
label?: string,
name?: string,
color?: string
}
export interface PermissionOptions{
type?: '' | 'primary' | 'success' | 'info' | 'warning' | 'danger'
label?: string,
prop?: string,
key?: string
}
export interface ScopeItem{
form: FormInstance,
model: any
}
export interface MainUserItem{
uid: number,
nickname: string,
face: string,
token: string,
mobile?: string,
email?: string,
tips?: string,
value?: UserValueItem[],
office?: UserValueItem[],
echart1?: MainEchartItem,
echart2?: MainEchartItem,
echart3?: MainEchartItem,
echart4?: MainEchartItem
}
export interface UserValueItem{
title?: string,
desc?: string,
icon?: string,
pic?: string,
value?: number,
val?: number
}
export interface MainEchartItem{
title?: string,
type?: string,
options?: any,
data?: any
}
export interface GrantOptions{
role_id?: string | number,
role?: RoleItem[],
menu?: GrantValue[],
handle?: HandleItem[]
}
export interface RoleItem{
id?: number,
title?: string,
value?: number,
label?: string,
level?: number,
pid?: number,
number?: number,
sort?: number,
children?: RoleItem[]
}
export interface GrantValue{
menu_id: number,
title?: string,
level?: number,
pid?: number,
number?: number,
handle_list?: number[],
IsShow: number,
IsRefresh?: number,
IsAdd?: number,
IsModify?: number,
IsSave?: number,
IsDel?: number,
IsImport?: number,
IsExport?: number,
IsChecked?: number,
IsApproved?: number,
IsReject?: number,
IsPrint?: number,
IsTruncate?: number,
IsBack?: number
}
export interface HandleItem{
id?: number,
title?: string,
handle_name?: string
}
export interface LoginOptions{
header_height?: number,
footer_height?: number,
bg_color?: string,
bg_img?: string | string[],
width?: number,
login_width?: number,
login_height?: number,
bg_login_color?: string,
bg_login_img?: string
}
export interface ResultItem{
code: number,
msg?: string,
data?: any
}
export interface PropItem{
prop: string,
label?: string,
width?: number
}
export interface ContainerOptions{
mode?: 'hm' | 'hmf' | 'am' | 'ham' | 'hamf' | 'ahm' | 'ahmf' | '',
asideWidth?: string,
asideBorderColor?: string,
asideTextColor?: string,
headerHeight?: number,
footerHeight?: string,
asideBgColor?: string,
headerBgColor?: string,
mainBgColor?: string,
footerBgColor?: string,
headerPadding?: number,
mainPadding?: number
}
export interface QrDataOption{
path: string,
qrcode: string,
error?: string
}
export interface QrDataItem{
id: number,
title: string,
h5: QrDataOption,
mini: QrDataOption
}