| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- interface ValidRule {
- validType?: import('@/utils').ValidKey; // 表达验证类型
- ruleFn?: import('@/utils').RuleFn.ruleFn;
- errMsgFn?: (...args: any) => string;
- errMsg?: string;
- }
- interface Valid {
- validFormatType?: import('@/utils').InputTypeValue; // 用于验证格式化表单输入类型
- validRules?: Array<ValidRule> | ValidRule;
- }
- declare interface ValidProps {
- id: string;
- required: boolean;
- message: string;
- trigger: string;
- }
- declare interface ValidConfig extends Valid {
- validProps?: Partial<ValidProps>;
- }
- declare interface anyObj {
- [key: string]: any;
- }
- declare interface OtherConfig {
- tip: boolean;
- tipMsg: string | ((param: any) => string);
- }
- declare type FunctionVoid = () => void;
- // 获取组件中 props 属性类型
- declare type PickComponentsProps<T> = {
- -readonly [K in keyof Omit<
- T,
- keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps
- >]: T[K];
- };
- interface ColumnProps extends Partial<import('element-plus').FormItemProps> {
- label: string | ((form: any) => string);
- width: string | number;
- }
- interface SelectOption extends Options {
- optionLabelKey?: string;
- optionValueKey?: string;
- }
- interface Options {
- options: any[];
- }
- interface Supplement {
- maxlength: string;
- rows: number;
- }
- declare interface ItemConfig extends ValidConfig {
- itemType?:
- | 'number'
- | 'date'
- | 'select'
- | 'timeSelect'
- | 'text'
- | 'time'
- | 'radio'
- | 'checkbox'
- | 'other'
- | 'table'
- | 'dateTime';
- modelKey?: string; // 表单输入项双向绑定 v-model 后端数据字段名
- slotName?: string;
- dateRange?: boolean;
- default?: any; // 默认填充值
- columnProps?: Partial<ColumnProps>;
- // input | datePicker | timePicker | inputNumber | select 选择器
- elInputProps?: Partial<import('element-plus').InputProps & Supplement>;
- elDatePickerProps?: Partial<import('element-plus').DatePickerProps>;
- elTimePickerProps?: Partial<import('element-plus').TimePickerDefaultProps>;
- elInputNumberProps?: Partial<import('element-plus').InputNumberProps>;
- elSelectProps?: Partial<import('element-plus').ISelectProps & SelectOption>;
- elRadioProps?: Partial<import('element-plus').RadioProps & Options>;
- elCheckboxProps?: Partial<import('element-plus').CheckboxProps & Options>;
- // el-form-item 的配置
- elFormItemProps?: Partial<FormItemProps>;
- otherConfig?: OtherConfig;
- }
- declare interface PageConfig {
- id?: string;
- labelWidth?: string | number;
- items: ItemConfig[];
- // form表单的配置同 element plus form
- formProps?: Partial<import('element-plus').FormProps>;
- isDialogSearch?: boolean;
- }
- declare interface BtnLoading {
- btnLoading?: boolean;
- }
- declare interface StandardOptions {
- value: string | number;
- label: string;
- }
- declare interface TransformedItem extends StandardOptions {
- level?: number;
- disabled?: boolean;
- children?: TransformedItem[];
- }
|