Skip to content

types

ColumnItem

columnItem 是表格字段定义接口类型

参数说明类型
title列名string
dataIndex字段名string
notShowInSearch是否展示在查询表单boolean
notShowInAddOrEdit不在添加或编辑的时候展示boolean
notShowInTable不在表格显示boolean
required不是必须boolean
type字段类型ColumnsTypes
onChangeValue值改变时的回调(fromData: any, ...value: any) => void
ValidateType表单验证类型ValidateType
editNoRequired编辑不用强制要求boolean
rules表单验证规则RuleObject
span占据的列数number
condition满足条件才显示(formModel: any) => boolean
options下拉选择框DefaultOptionType[]
rangeDateKeyArray时间范围的key[string, string]
cascaderKeyArray级联选择后的对应字段string[]
slot插槽名称string
tips提示信息string
isArray是否是数组boolean
disabled是否禁用boolean
disabledFunc是否禁用的函数(formModel: any) => boolean
showField显示在表格的字段名称string
width表格列宽`number
[str: string]any
ts
export interface columnItem extends ColumnType {
  title: string; // 列名
  dataIndex: string; // 字段名
  notShowInSearch?: boolean; //是否展示在查询表单
  notShowInAddOrEdit?: boolean; //不在添加或编辑的时候展示
  notShowInTable?: boolean; //不在表格显示
  required?: boolean; //不是必须
  type?: ColumnsTypes; //字段类型
  onChangeValue?: (fromData: any, ...value: any) => void; // 值改变时的回调
  ValidateType?: ValidateType; //表单验证类型
  editNoRequired?: boolean; //编辑不用强制要求
  rules?: RuleObject; //表单验证规则
  span?: number; //占据的列数
  condition?: (formModel: any) => boolean; //满足条件才显示
  options?: DefaultOptionType[]; //下拉选择框
  rangeDateKeyArray?: [string, string]; //时间范围的key
  cascaderKeyArray?: string[]; //级联选择后的对应字段
  slot?: string; //插槽名称
  tips?: string; //提示信息
  isArray?: boolean; //是否是数组
  disabled?: boolean; //是否禁用
  disabledFunc?: (formModel: any) => boolean; //是否禁用的函数
  [str: string]: any;
}

ColumnsTypes

字段类型

ts
export type ColumnsTypes =
  | "text"
  | "password"
  | "number"
  | "textarea"
  | "select"
  | "radio"
  | "checkbox"
  | "date"
  | "daterange"
  | "cascader"
  | "upload"
  | "custom";

ValidateType

表单验证类型

ts
export declare type RuleType = "string" | "number" | "boolean" | "method" | "regexp" | "integer" | "float" | "object" | "enum" | "date" | "url" | "hex" | "email";

export type ValidateType  = RuleType | "any";

杨利伟的博客