2020-05-27 14:57:40 +08:00
{
"$id" : "https://houtai.baidu.com/v2/schemas/form.json#" ,
"$schema" : "http://json-schema.org/draft-07/schema#" ,
"allOf" : [
{
"$ref" : "https://houtai.baidu.com/v2/schemas/form.json#/definitions/common"
} ,
{
"additionalProperties" : false ,
"patternProperties" : {
"^(?:type|\\$ref|debug|api|redirect|reload|debug|name|initApi|initAsyncApi|initFetch|initSchemaFetch|initFinishedField|initCheckInterval|schemaApi|asyncApi|checkInterval|finishedField|primaryField|className|panelClassName|title|mode|horizontal|columnClassName|horizontalDeeper|controls|submitText|submitOnChange|collapsable|data|persistData|clearPersistDataAfterSubmit|resetAfterSubmit|submitOnInit|wrapWithPanel|actions|fieldSet|target|tabs|footer|footerClassName|autoFocus|attachChanged|changedKey|changedTrueValue|changedFalseValue|messages|disabled|disabledOn|visible|visibleOn|hidden|hiddenOn|required)$" : { }
} ,
"properties" : {
"$schema" : {
"format" : "uri" ,
"type" : "string" ,
"description" : "绑定 JSON 格式说明,可忽略!"
} ,
"type" : {
"const" : "form" ,
"description" : "指定为 Form 表单类型"
}
} ,
"required" : [ "type" ] ,
"type" : "object"
}
] ,
"definitions" : {
"test" : {
"properties" : {
"type" : {
"const" : "form"
}
}
} ,
"common" : {
2020-08-21 15:28:22 +08:00
"description" : "amis Form 渲染器, 格式说明。https://baidu.github.io/amis/docs/renderers#form" ,
2020-05-27 14:57:40 +08:00
"dependencies" : {
"checkInterval" : [ "asyncApi" ] ,
"finishedField" : [ "asyncApi" ]
} ,
"properties" : {
"$ref" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref" ,
"description" : "引用页面中的定义"
} ,
"actions" : {
"items" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/action.json#"
} ,
"type" : "array"
} ,
"size" : {
"type" : "string" ,
"description" : "表单项大小设置" ,
"enum" : [ "xs" , "sm" , "md" , "lg" , "full" , "" ]
} ,
"remark" : {
"oneOf" : [
{
"type" : "string" ,
"description" : "显示一个小图标, 鼠标放上去的时候显示提示内容"
} ,
{
"type" : "object" ,
"properties" : {
"title" : {
"type" : "string" ,
"description" : "标题"
} ,
"content" : {
"type" : "string" ,
"description" : "内容"
} ,
"position" : {
"type" : "string" ,
"description" : "弹出位置" ,
"enum" : [ "left" , "right" , "top" , "bottom" ]
} ,
"icon" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "图标的 CSS 类名" ,
"default" : "fa fa-question-circle"
} ,
"className" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "配置容器 className"
} ,
"trigger" : {
"type" : "array" ,
"description" : "触发方式" ,
"items" : {
"type" : "string" ,
"enum" : [ "hover" , "focus" , "click" ]
}
} ,
"rootClose" : {
"type" : "boolean" ,
"description" : "是否点击其他位置关闭提示,触发方式使用 click 时有用。"
}
}
}
]
} ,
"labelRemark" : {
"oneOf" : [
{
"type" : "string" ,
"description" : "label 旁显示一个小图标, 鼠标放上去的时候显示提示内容"
} ,
{
"type" : "object" ,
"properties" : {
"title" : {
"type" : "string" ,
"description" : "标题"
} ,
"content" : {
"type" : "string" ,
"description" : "内容"
} ,
"position" : {
"type" : "string" ,
"description" : "弹出位置" ,
"enum" : [ "left" , "right" , "top" , "bottom" ]
} ,
"icon" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "图标的 CSS 类名" ,
"default" : "fa fa-question-circle"
} ,
"className" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "配置容器 className"
} ,
"trigger" : {
"type" : "array" ,
"description" : "触发方式" ,
"items" : {
"type" : "string" ,
"enum" : [ "hover" , "focus" , "click" ]
}
} ,
"rootClose" : {
"type" : "boolean" ,
"description" : "是否点击其他位置关闭提示,触发方式使用 click 时有用。"
}
}
}
]
} ,
"hint" : {
"type" : "string" ,
"description" : "输入提示,聚焦的时候显示"
} ,
"api" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api" ,
"description" : "Form 用来保存数据的 api。[详情](https://baidu.github.io/amis/docs/api#form)"
} ,
"asyncApi" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api" ,
"description" : "设置此属性后,表单提交发送保存接口后,还会继续轮训请求该接口,直到返回 finished 属性为 true 才 结束。[详情](https://baidu.github.io/amis/docs/api#form)"
} ,
"autoFocus" : {
"default" : true ,
"description" : "是否自动将第一个表单元素聚焦。" ,
"type" : "boolean"
} ,
"checkInterval" : {
"default" : 3000 ,
"description" : "轮训请求的时间间隔,默认为 3秒。设置 asyncApi 才有效" ,
"minimum" : 1000 ,
"type" : "number"
} ,
"className" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "配置容器 className"
} ,
"collapsable" : {
"default" : false ,
"description" : "当通过 fieldSet 方式设置 [FormItem](https://baidu.github.io/amis/docs/renderers#formitem) 时有效。开启可收起与展开功能。" ,
"type" : "boolean"
} ,
"controls" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form.json#/definitions/controls" ,
"description" : "FormItem 集合"
} ,
"data" : {
"description" : "初始数据,设置得值可用于组件内部模板使用。" ,
"type" : "object"
} ,
"debug" : {
"default" : false ,
"description" : "开启后可查看 form 数据" ,
"type" : "boolean"
} ,
"fieldSet" : {
"description" : "deprecated, 请在 controls 中使用 type: 'fieldSet' 代替"
} ,
"finishedField" : {
"default" : "finished" ,
"description" : "如果决定结束的字段名不是 `finished` 请设置此属性,比如 `is_success`" ,
"type" : "string"
} ,
"footer" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/container" ,
"description" : "Footer 区域"
} ,
"footerClassName" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "Footer 区域 className"
} ,
"horizontal" : {
"additionalProperties" : false ,
"default" : {
"left" : 2
} ,
"description" : "当 mode 为 horizontal 时有用,用来控制 label 和 input 的宽度占比。" ,
"properties" : {
"left" : {
"type" : [ "string" , "number" ]
} ,
"leftFixed" : {
"oneOf" : [
{
"type" : "string" ,
"enum" : [ "" , "xs" , "sm" , "md" , "lg" ]
} ,
{
"type" : "boolean"
}
]
} ,
"right" : {
"type" : [ "string" , "number" ]
} ,
"offset" : {
"type" : [ "string" , "number" ]
}
} ,
"type" : "object"
} ,
"initApi" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api" ,
"description" : "Form 用来获取初始数据的 api。[详情](https://baidu.github.io/amis/docs/api#form)"
} ,
"initAsyncApi" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api" ,
"description" : "Form 用来获取初始数据的 api,与initApi不同的是, 会一直轮训请求该接口, 直到返回 finished 属性为 true 才 结束。[详情](https://baidu.github.io/amis/docs/api#form)"
} ,
"initCheckInterval" : {
"default" : 3000 ,
"description" : "设置了initAsyncApi以后, 默认拉取的时间间隔" ,
"type" : "number"
} ,
"initFetch" : {
"default" : true ,
"description" : "设置了initApi或者initAsyncApi后, 默认会开始就发请求, 设置为false后就不会起始就请求接口" ,
"type" : "boolean"
} ,
"initFinishedField" : {
"default" : "finished" ,
"description" : "设置了initAsyncApi后, 默认会从返回数据的data.finished来判断是否完成, 也可以设置成其他的xxx, 就会从data.xxx中获取" ,
"type" : "string"
} ,
"persistData" : {
"default" : false ,
"description" : "是否开启本地缓存" ,
"type" : "boolean"
} ,
"clearPersistDataAfterSubmit" : {
"default" : false ,
"description" : "提交成功后清空本地缓存" ,
"type" : "boolean"
} ,
"resetAfterSubmit" : {
"default" : false ,
"description" : "提交完后重置表单" ,
"type" : "boolean"
} ,
"messages" : {
"description" : "接口返回消息提示" ,
"additionalProperties" : false ,
"properties" : {
"fetchFailed" : {
"description" : "获取失败时提示" ,
"type" : "string"
} ,
"fetchSuccess" : {
"description" : "获取成功时提示" ,
"type" : "string"
} ,
"saveFailed" : {
"description" : "保存成功时提示" ,
"type" : "string"
} ,
"saveSuccess" : {
"description" : "保存失败时提示" ,
"type" : "string"
}
} ,
"type" : "object"
} ,
"mode" : {
"default" : "normal" ,
"description" : "表单展示方式, 可以是: normal、horizontal 或者 inline。示例: https://baidu.github.io/amis/docs/demo/forms/mode" ,
"enum" : [ "normal" , "horizontal" , "inline" ] ,
"type" : "string"
} ,
"name" : {
"description" : "可以取个名字,方便其他组件引用" ,
"type" : "string"
} ,
"panelClassName" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "配置容器 panel className"
} ,
"primaryField" : {
"default" : "id" ,
"description" : "设置主键 id, 当设置后, 检测表单是否完成时( asyncApi) , 只会携带此数据。" ,
"type" : "string"
} ,
"redirect" : {
"description" : "保存完后,可以指定跳转地址,支持相对路径和组内绝对路径,同时可以通过 $xxx 使用变量" ,
"type" : "string"
} ,
"reload" : {
"description" : "保存完后,可以指定目标组件刷新" ,
"type" : "string"
} ,
"submitOnChange" : {
"default" : false ,
"description" : "表单修改即提交" ,
"type" : "boolean"
} ,
"submitOnInit" : {
"default" : false ,
"description" : "表单初始先提交一次,联动的时候有用" ,
"type" : "boolean"
} ,
"submitText" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/stringOrNull" ,
"default" : "提交" ,
"description" : "默认的提交按钮名称,如果设置成空,则可以把默认按钮去掉。"
} ,
"tabs" : {
"description" : "deprecated, 请再 controls 里面添加 type:tabs 节点代替"
} ,
"target" : {
"description" : "默认表单提交自己会通过发送 api 保存数据,但是也可以设定另外一个 form 的 name 值,或者另外一个 `CRUD` 模型的 name 值。 如果 target 目标是一个 `Form` ,则目标 `Form` 会重新触发 `initApi` 和 `schemaApi`, api 可以拿到当前 form 数据。如果目标是一个 `CRUD` 模型,则目标模型会重新触发搜索,参数为当前 Form 数据。" ,
"type" : "string"
} ,
"title" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/stringOrNull" ,
"default" : "表单" ,
"description" : "表单标题"
} ,
"type" : {
"const" : "form" ,
"description" : "指定为表单类型" ,
"type" : "string"
} ,
"wrapWithPanel" : {
"default" : false ,
"description" : "是否用 panel 包裹起来" ,
"type" : "boolean"
}
} ,
"type" : "object"
} ,
"customControlItem" : {
"description" : "自定组件,非系统组件,请确保你已在自定义组件中添加了对应的组件。" ,
"properties" : {
"type" : {
"pattern" : "^(?!^(?:text|control|form|color|formula|plain|number|url|email|hidden|password|textarea|select|multi-select|chained-select|nested-select|checkbox|checkboxes|radios|switch|date|datetime|time|date-range|image|file|picker|rich-text|editor|diff-editor|.*-editor|repeat|tree|city|rating|form|range|list|matrix|combo|divider|static|table|button|button-group|dropdown-button|button-toolbar|panel|hbox|grid|tpl|plain|html|submit|reset|fieldSet|tabs|group|static|static-.*)$)" ,
"type" : "string"
}
} ,
"required" : [ "type" ] ,
"type" : "object"
} ,
"controlItem" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/array.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/array.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/button-group.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/button-group.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/button-toolbar.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/button-toolbar.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/button.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/button.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/chained-select.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/chained-select.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/checkbox.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/checkbox.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/checkboxes.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/checkboxes.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/color.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/color.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/combo.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/combo.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/control.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/control.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/date-range.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/date-range.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/date.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/date.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/datetime.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/datetime.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/editor.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/editor.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/email.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/email.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/fieldSet.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/fieldSet.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/file.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/file.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/formula.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/formula.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/grid.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/grid.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/group.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/group.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/hbox.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/hbox.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/hidden.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/hidden.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/image.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/image.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/list.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/list.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/matrix.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/matrix.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/number.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/number.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/panel.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/panel.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/password.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/password.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/picker.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/picker.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/radios.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/radios.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/range.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/range.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/repeat.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/repeat.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/reset.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/reset.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/rich-text.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/rich-text.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/select.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/select.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/service.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/service.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/static.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/static.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/sub-form.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/sub-form.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/submit.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/submit.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/switch.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/switch.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/table.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/table.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/tabs.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/tabs.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/text.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/text.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/textarea.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/textarea.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/time.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/time.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/tree-select.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/tree-select.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/tree.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/tree.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/url.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form/url.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/divider.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/divider.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/cards.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/cards.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/chart.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/chart.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/collapse.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/collapse.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/crud.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/crud.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/iframe.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/iframe.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/nav.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/nav.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/tasks.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/tasks.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/video.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/video.json#/definitions/common"
} ,
"else" : {
"if" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/wrapper.json#/definitions/test"
} ,
"then" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/wrapper.json#/definitions/common"
} ,
"else" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form.json#/definitions/customControlItem"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
} ,
"controls" : {
"items" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form.json#/definitions/controlItem"
} ,
"type" : "array"
} ,
"item" : {
"properties" : {
"className" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "配置容器 className"
} ,
"desc" : {
"description" : "请改用 description" ,
"type" : "string"
} ,
"validateOnChange" : {
"type" : "boolean" ,
"description" : "不设置时,当表单提交过后表单项每次修改都会触发重新验证,如果设置了,则由此配置项来决定要不要每次修改都触发验证。"
} ,
"description" : {
"description" : "描述内容,支持 Html 片段。" ,
"type" : "string"
} ,
"descriptionClassName" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "配置描述上的 className"
} ,
"disabled" : {
"description" : "是否禁用" ,
"type" : "boolean"
} ,
"disabledOn" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/expression" ,
"description" : "通过 JS 表达式来配置当前表单项是否禁用。"
} ,
"hidden" : {
"description" : "是否隐藏" ,
"type" : "boolean"
} ,
"hiddenOn" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/expression" ,
"description" : "通过 JS 表达式来配置当前表单项是否隐藏。"
} ,
"horizontal" : {
"additionalProperties" : false ,
"default" : {
"left" : 2
} ,
"description" : "当表单的展示方式为水平方式时,用来控制 label 和 input 的宽度占比。" ,
"properties" : {
"right" : {
"type" : "number"
} ,
"left" : {
"type" : "number"
} ,
"leftFixed" : {
"oneOf" : [
{
"type" : [ "string" , "number" ]
} ,
{
"type" : "boolean"
}
]
}
} ,
"type" : "object"
} ,
"mode" : {
"description" : "配置当前表单项展示模式" ,
"type" : "string" ,
"enum" : [ "normal" , "inline" , "horizontal" ]
} ,
"inline" : {
"description" : "是否为 inline 模式。" ,
"type" : "boolean"
} ,
"inputClassName" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "配置 input className"
} ,
"label" : {
"description" : "描述标题" ,
"onOf" : [
{
"type" : "string"
} ,
{
"enum" : [ false ]
}
]
} ,
"labelClassName" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className" ,
"description" : "配置 label className"
} ,
"name" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form.json#/definitions/name" ,
"description" : "字段名,表单提交时的 key"
} ,
"placeholder" : {
"description" : "占位符" ,
"type" : "string"
} ,
"required" : {
"description" : "是否为必填" ,
"type" : "boolean"
} ,
"submitOnChange" : {
"description" : "是否一修改就提交。" ,
"type" : "boolean"
} ,
"validationErrors" : {
"description" : "验证失败的提示信息" ,
"properties" : {
"isAlpha" : {
"default" : "请输入字母" ,
"type" : "string"
} ,
"isAlphanumeric" : {
"default" : "请输入字母或者数字" ,
"type" : "string"
} ,
"isEmail" : {
"default" : "Email 格式不正确" ,
"type" : "string"
} ,
"isFloat" : {
"default" : "请输入浮点型数值" ,
"type" : "string"
} ,
"isInt" : {
"default" : "请输入整形数字" ,
"type" : "string"
} ,
"isJson" : {
"default" : "请检查 Json 格式。" ,
"type" : "string"
} ,
"isLength" : {
"default" : "请输入长度为 $1 的内容" ,
"type" : "string"
} ,
"isNumeric" : {
"default" : "请输入数字" ,
"type" : "string"
} ,
"isRequired" : {
"default" : "这是必填项" ,
"type" : "string"
} ,
"isUrl" : {
"default" : "Url 格式不正确" ,
"type" : "string"
} ,
"matchRegexp" : {
"type" : "string"
} ,
"matchRegexp2" : {
"type" : "string"
} ,
"matchRegexp3" : {
"type" : "string"
} ,
"matchRegexp4" : {
"type" : "string"
} ,
"matchRegexp5" : {
"type" : "string"
} ,
"maxLength" : {
"default" : "请控制内容长度, 请不要输入 $1 个字符以上" ,
"type" : "string"
} ,
"maximum" : {
"default" : "当前输入值超出最大值 $1, 请检查" ,
"type" : "string"
} ,
"minLength" : {
"default" : "请输入更多的内容,至少输入 $1 个字符。" ,
"type" : "string"
} ,
"minimum" : {
"default" : "当前输入值低于最小值 $1, 请检查" ,
"type" : "string"
}
} ,
"type" : "object"
} ,
"validations" : {
"description" : "验证器" ,
"oneOf" : [
{
"type" : "string"
} ,
{
"properties" : {
"isAlpha" : {
"description" : "是否是字母" ,
"type" : "boolean"
} ,
"isAlphanumeric" : {
"description" : "是否为字母数字" ,
"type" : "boolean"
} ,
"isEmail" : {
"description" : "是否为邮箱地址" ,
"type" : "boolean"
} ,
"isFloat" : {
"description" : "是否为浮点型" ,
"type" : "boolean"
} ,
"isInt" : {
"description" : "是否为整型" ,
"type" : "boolean"
} ,
"isJson" : {
"description" : "是否为 json" ,
"type" : "number"
} ,
"isLength" : {
"description" : "长度等于指定值" ,
"type" : "number"
} ,
"isNumeric" : {
"description" : "是否为数字" ,
"type" : "boolean"
} ,
"isRequired" : {
"description" : "是否为必填" ,
"type" : "boolean"
} ,
"isUrl" : {
"description" : "是否为 URL 地址" ,
"type" : "boolean"
} ,
"matchRegexp" : {
"description" : "内容命中指定正则" ,
"type" : "string"
} ,
"matchRegexp2" : {
"description" : "内容命中指定正则" ,
"type" : "string"
} ,
"matchRegexp3" : {
"description" : "内容命中指定正则" ,
"type" : "string"
} ,
"matchRegexp4" : {
"description" : "内容命中指定正则" ,
"type" : "string"
} ,
"matchRegexp5" : {
"description" : "内容命中指定正则" ,
"type" : "string"
} ,
"maxLength" : {
"description" : "最大长度为指定值" ,
"type" : "number"
} ,
"maximum" : {
"description" : "最大值为指定值" ,
"type" : "number"
} ,
"minLength" : {
"description" : "最小长度为指定值" ,
"type" : "number"
} ,
"minimum" : {
"description" : "最小值为指定值" ,
"type" : "number"
}
} ,
"type" : "object"
}
]
} ,
"value" : {
"description" : "默认值,不支持变量。"
} ,
"visible" : {
"description" : "是否显示" ,
"type" : "boolean"
} ,
"visibleOn" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/page.json#/definitions/expression" ,
"description" : "通过 JS 表达式来配置当前表单项是否显示"
}
} ,
"type" : "object"
} ,
"name" : {
"description" : "变量名称" ,
"pattern" : "^\\S+$" ,
"type" : "string"
} ,
"nestedOptionsType" : {
"items" : {
"description" : "选项" ,
"properties" : {
"children" : {
"$ref" : "https://houtai.baidu.com/v2/schemas/form.json#/definitions/nestedOptionsType"
} ,
"disabled" : {
"default" : false ,
"description" : "配置当前值是否可选" ,
"type" : "boolean"
} ,
"label" : {
"description" : "用来显示的值" ,
"type" : "string"
} ,
"value" : {
"description" : "用来存储的值" ,
"oneOf" : [
{
"type" : "string"
} ,
{
"type" : "number"
} ,
{
"type" : "boolean"
} ,
{
"type" : "object"
}
]
}
} ,
"required" : [ "label" , "value" ] ,
"type" : "object"
} ,
"type" : "array"
} ,
"optionsType" : {
"oneOf" : [
{
"description" : "多个选项,请用 `,` 英文逗号隔开。" ,
"type" : "string"
} ,
{
"description" : "key 是值, value 是展示信息。" ,
"type" : "object"
} ,
{
"items" : {
"oneOf" : [
{
"description" : "选项值" ,
"type" : "string"
} ,
{
"description" : "选项" ,
"properties" : {
"disabled" : {
"default" : false ,
"description" : "配置当前值是否可选" ,
"type" : "boolean"
} ,
"disabledOn" : {
"description" : "可通过表达是配置是否禁用" ,
"type" : "string"
} ,
"hiddenOn" : {
"description" : "可通过表达是配置是否隐藏" ,
"type" : "string"
} ,
"icon" : {
"description" : "图标" ,
"type" : "string"
} ,
"label" : {
"description" : "用来显示的值" ,
"type" : "string"
} ,
"value" : {
"description" : "用来存储的值" ,
"oneOf" : [
{
"type" : "string"
} ,
{
"type" : "number"
} ,
{
"type" : "boolean"
} ,
{
"type" : "object"
}
]
} ,
"visibleOn" : {
"description" : "可通过表达是配置是否可见" ,
"type" : "string"
}
} ,
"required" : [ "value" ] ,
"type" : "object"
}
]
} ,
"type" : "array"
} ,
{
"description" : "key 为保存的值, value 为展示的值。" ,
"type" : "object"
}
]
}
} ,
2020-08-21 15:28:22 +08:00
"description" : "amis Form 渲染器, 格式说明。https://baidu.github.io/amis/docs/renderers#form" ,
2020-05-27 14:57:40 +08:00
"type" : "object"
}