element-easy-form
Version:
vue3.0 的自定义表单,基于element-Plus
153 lines (151 loc) • 4.23 kB
TypeScript
import { DragFormType } from './componentAttrsType';
import { AttrType, ComponentType, SelectFuntion } from './enum';
export declare const SPANDEFAULT = 12;
export declare const defaultOption: (val?: any) => {
value: string;
label: string;
};
export declare const defaultLabel: (val?: any) => {
label: string;
};
/**
*
* @param val 长度
* @returns 随机返回英文字符串
*/
export declare const getName: (val?: number) => string;
/**
*
* @param val 长度
* @returns 随机返回中文字符串
*/
export declare const getCName: (val?: number) => string;
export declare const initPropLabel: (data: DragFormType) => void;
export declare const formAndAttrsUpdata: (currentData: DragFormType, data: DragFormType) => void;
/**
*
* @param data 组件属性列表数据
*/
export declare const upDateFormItem: (data: DragFormType) => void;
/**
*
* @param data 组件属性列表数据
* @returns moduel 数据
*/
export declare const getModel: (data: DragFormType[]) => any;
/**
* 获取组件列表
*/
export declare const getComponents: (data: DragFormType[]) => any;
export declare const getRowAttrs: (data: DragFormType[]) => any;
export declare const hiddenAttrs: () => {
label: string;
prop: string;
type: AttrType;
defaultValue: {
matchPattern: SelectFuntion;
type: SelectFuntion;
dataSelect: never[];
value: boolean;
dataJs: string;
};
componentName: ComponentType;
attrs: {
placeholder: string;
lang: string;
title: string;
};
rules: never[];
};
export interface FormItem {
label: string;
prop: string;
}
export declare const getCommonEvents: (filters?: any) => {
type: AttrType;
label: string;
prop: string;
defaultValue: string;
componentName: ComponentType;
attrs: {
title: string;
};
}[];
export declare const elFormItem: (data?: FormItem) => DragFormType[];
export declare const elFormClearable: () => DragFormType;
export declare const elFormplaceholder: (msg: String) => DragFormType;
export declare const ElSelectOptionDragFormData: (label?: any, value?: any, parentId?: string) => {
title: string;
componentName: ComponentType;
attrs: {};
type: AttrType;
attrsJson: {
label: string;
prop: string;
type: AttrType;
defaultValue: any;
componentName: ComponentType;
attrs: {
placeholder: string;
};
rules: {
required: boolean;
message: string;
trigger: string;
}[];
}[];
};
export declare const ElCheckboxDragFormData: (label?: any, value?: any, parentId?: string) => {
title: string;
componentName: ComponentType;
attrs: {};
type: AttrType;
parentId: string;
attrsJson: {
label: string;
prop: string;
type: AttrType;
defaultValue: any;
componentName: ComponentType;
attrs: {
placeholder: string;
};
rules: {
required: boolean;
message: string;
trigger: string;
}[];
}[];
};
export declare const ElRadioAndCheckboxDragFormData: (label?: any, value?: any, parentId?: string) => {
title: string;
componentName: ComponentType;
attrs: {};
parentId: string;
type: AttrType;
attrsJson: {
label: string;
prop: string;
type: AttrType;
defaultValue: any;
componentName: ComponentType;
attrs: {
placeholder: string;
};
rules: {
required: boolean;
message: string;
trigger: string;
}[];
}[];
};
/**
* 截取{}里面的内容 并且拼装成函数返回
*/
export declare const getFunctionTemplate: (str: string) => string;
export declare const formatSelectFunction: (element: any) => string;
/**
* 控制显示隐藏逻辑
*/
export declare const hidden: (element: any, model: any) => any;
export declare const formatFunction: (element: any, model: any) => any;