import { ControlData2SingleRow } from "../../clientData"; import { ServiceType, RbColType } from "../parameters"; import { IEvent, FromItemEvents } from "../events"; import { TextBoxControlType } from "../small/textbox"; import { LinkControlType } from "../small/link"; import { LabelControlType } from "../small/label"; import { TextAreaControlType } from "../small/textArea"; import { PasswordControlType } from "../small/password"; import { NumberControlType } from "../small/number"; import { DateTimeControlType } from "../small/datetime"; import { RangeDateTimeControlType } from "../small/rangeDate"; import { SwitchControlType } from "../small/switch"; import { RadioListControlType } from "../small/radioList"; import { SelectControlType } from "../small/select"; import { CascaderControlType } from "../small/cascader"; import { TreeSelectControlType } from "../small/treeSelect"; import { AutoCompleteControlType } from "../small/autoComplete"; import { GridAutoCompleteControlType } from "../small/gridAutoComplete"; /** * 表单控件 */ export interface FormControlType { data?: ControlData2SingleRow; /** * 控件配置 */ layout?: FormLayout; layoutService?: ServiceType; } export interface FormLayout { /** * 表单区块集合 */ sections: Array>; /** * 事件集合 */ events?: FormEvents; } /** * 表单事件集合 */ export interface FormEvents { /** * 数据第一次加载完成后事件 */ ready?: IEvent[]; /** * 控件进行校验时事件 */ valid?: IEvent[]; /** * 表单内的任意值发生改变事件 */ valueChange?: IEvent[]; } /** * 表单区块集合 */ export interface FormSections { /** * 表单区块id */ id: string; /** * 区块标题 */ title: string; /** * 是否显示标题,默认为false */ showTitle?: boolean; /** * 当前区块在哪些模式下显示,默认为7 * (0.不显示,1.新增模式,2.修改模式,4.查看模式) */ displayMode?: 0 | 1 | 2 | 3 | 4 | 7; /** * 是否只读模式,默认为false */ readonly?: boolean; /** * 区块内布局列数,默认为2 */ cols?: number; /** * 区块内子项的标题区域宽度,默认为80 * * 已弃用 */ /** * label 标签布局 */ labelCol?: RbColType; /** * 表单子控件 布局 */ wrapperCol?: RbColType; /** * 子项集合 */ items: Array>; } /** * 表单子项集合 */ export interface FormItems { /** * 子项id */ id: string; /** * 子项标题 */ title: string; /** * 是否隐藏标题,默认为false,即显示标题 */ hideTitle?: boolean; /** * 必填类别,默认为0 * (0.不必填,1.必填,2.建议填) */ requiredType?: 0 | 1 | 2; /** * 帮助提示信息 */ helpTip?: string; /** * 帮助图标,当指定了helpTip后有效,默认为(?)图标 */ helpIcon?: string; /** * 子项提示信息 */ tip?: string; /** * 当前子项在哪些模式下显示,默认为7 * (0.不显示,1.新增模式,2.修改模式,4.查看模式) */ displayMode?: 0 | 1 | 2 | 3 | 4 | 7; /** * 当前子项在哪些模式下可编辑,默认为3 * (0.不显示,1.新增模式,2.修改模式,4.查看模式) */ modifyMode?: 0 | 1 | 2 | 3 | 4 | 7; /** * 子项跨列数,默认为1 */ colspan?: number; /** * 使用的控件配置,如果没有配置,则引用外部大控件配置 */ control?: C; } /** * Form可用控件列表 */ export interface FormControls { textbox?: TextBoxControlType; link?: LinkControlType; label?: LabelControlType; textArea?: TextAreaControlType; password?: PasswordControlType; number?: NumberControlType; datetime?: DateTimeControlType; rangeDate?: RangeDateTimeControlType; switch?: SwitchControlType; radioList?: RadioListControlType; select?: SelectControlType; cascader?: CascaderControlType; treeSelect?: TreeSelectControlType; autoComplete?: AutoCompleteControlType; gridAutoComplete?: GridAutoCompleteControlType; } export interface FromControlType { /** * 事件集合 */ events?: E; }