import React, { CSSProperties } from 'react'; export type OptType = 'modifiedRow' | 'newRow' | 'deletedRow'; type rule = Record & { message?: string; }; export type COMP_TYPE = 'FormPanel' | 'container' | 'CheckBoxGroup' | 'Input' | 'InputNumber' | 'Select' | 'DatePicker' | 'DateTimePicker' | 'TimePicker' | 'SingleHelp' | 'MultipleHelp' | 'Password' | 'Button' | 'TextArea' | 'Radio' | 'RadioGroup' | String | React.ComponentType; /** * @description 表单属性 */ export type FormInfo = { /** * @description 表单属性 */ value?: object; /** * @description label标签未知 * @default left */ labelPosition?: 'top' | 'left'; /** * @description 表单判断是新增、修改用来格式化数据 */ opt?: OptType; /** * @description 表单主键(判断是新增、修改用来格式化数据) */ dataId?: string; /** * @description 表单禁用 * @default false */ disabled?: boolean; /** * @description 表单列数配置 */ colspan?: number | Array | { [propsKey: number]: number; }; /** * @description 表单校验规则 */ rules?: { [propsKey: string]: Array; }; /** * @description 表单值改变事件 */ onValuesChange?: (changeval: Object, allvalues: Object) => void; getPopupContainer?: () => Document; outRef?: any; }; export type FieldPropsType = { id?: string; name?: string; label?: string; /** * @description 组件类型 * @default Input */ xtype?: COMP_TYPE; /** * @description 跨列 * @default 1 */ colspan?: number; /** * @description 提示 */ placeholder?: string; /** * @description 是否必填 */ required?: boolean; /** * @description 是否禁用 */ disabled?: boolean; /** * @description 表填条目组件私有属性 */ antProps?: object; /** * @description 多语言的key值 */ langKey?: string; /** * @description 子元素 */ children?: FieldPropsType[]; /** * @description 子元素,元数据配置中原ext配置 */ items?: FieldPropsType[]; /** * @description 额外的提示信息 */ extra?: React.ReactNode; layout?: 'vertical' | 'horizontal'; /** * @description 其他属性,根据xtype进行配置 */ [propskey: string]: any; }; export type InnerCompPropsInfo = { formConf?: any; } & T; export type CompDefaultPropsInfo = { /** * @description 组件id */ id?: string; config?: R; /** * @description 重写config配置信息 */ setConfig?: (config: R) => R; confKey?: Array; style?: CSSProperties; className?: any; onLoad?: () => void; initSc?: any; formConf?: any; disabledNotify?: boolean; } & InnerCompPropsInfo; export type FORM_ENTRY = { /** * @description 绑定的数据库表名 */ bindtable?: string; /** * @description 表单条目配置 */ children: Array; /** * @description 标签位置 * @default right */ labelPosition?: 'top' | 'left'; /** * @description 表格列数 */ colspan?: number | Array | { [propsKey: number]: number; }; [propskey: string]: any; }; export type IFormConfig = Array | FORM_ENTRY; export type CompHocProps = CompDefaultPropsInfo & CompProps; export {};