Files
SaaS-lib/lib/component/form/form/form.d.ts
xuziqiang d0155dbe3c push
2024-05-15 17:29:42 +08:00

38 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { RuleObject } from 'ant-design-vue/es/form/interface';
declare global {
type Rule = RuleObject & {
trigger?: 'blur' | 'change' | ['change', 'blur'];
};
interface FormSchema {
field: string;
label?: string;
changeEvent?: string; //表单更新事件名称
valueField?: string;
component?: string; // 不定义,则为隐藏发送参数
rules?: Recordable[];
defaultValue?: any;
componentProps?: any;
formItemProps?: any;
viewOnly?: Boolean; // 是否只展示,不发送参数
ifShow?: Boolean | Function; //dom隐藏
show?: Boolean | Function; //css隐藏
// disabled?: Boolean; //是否禁用 (已废弃、和动态有重复部分)
dynamicDisabled?: Boolean | Function; //是否禁用
fieldMap?: Array<string> | Boolean | Props; //把一个值分割成多个值
keepField?: Boolean; //映射时是否保留原值
defaultParams?: Object; // 默认接口参数
dynamicParams?: String | Array<string> | Recordable | Function; //动态接口参数合并defaultParams赋值给params
requiredParams?: Boolean | String | Array<string> | Recordable;
addModel?: Array<string> | Props; // 额外发送参数例如select中
autoAddLink?: Boolean; //把需要联动的值映射到 formModel.fieldLink.field
displayFormItem?: Boolean; //是否显示formItem (label)
autoLink?: true; //是否使用规则自动绑定
class?: String; //添加额外样式
autoSubmit: Boolean; //是否操作后提交表单
format: Function;
}
}