mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
129 lines
5.7 KiB
JSON
129 lines
5.7 KiB
JSON
|
{
|
|||
|
"$id": "https://houtai.baidu.com/v2/schemas/form/tree.json#",
|
|||
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|||
|
"allOf": [
|
|||
|
{
|
|||
|
"$ref": "https://houtai.baidu.com/v2/schemas/form/tree.json#/definitions/common"
|
|||
|
},
|
|||
|
{
|
|||
|
"additionalProperties": false,
|
|||
|
"patternProperties": {
|
|||
|
"^(\\$ref|hideRoot|rootLabel|showIcon|showRadio|cascade|withChildren|rootValue|options|source|multiple|joinValues|delimiter|extractValue|clearable|resetValue|name|value|placeholder|label|remark|labelRemark|desc|description|inline|mode|horizontal|className|labelClassName|inputClassName|descriptionClassName|validations|validationErrors|validateOnChange|submitOnChange|disabled|disabledOn|visible|visibleOn|hidden|hiddenOn|required)$": {}
|
|||
|
},
|
|||
|
"properties": {
|
|||
|
"$schema": {
|
|||
|
"format": "uri",
|
|||
|
"type": "string",
|
|||
|
"description": "绑定 JSON 格式说明,可忽略!"
|
|||
|
},
|
|||
|
"type": {
|
|||
|
"const": "tree",
|
|||
|
"description": "指定为树形输入框类型"
|
|||
|
}
|
|||
|
},
|
|||
|
"required": [
|
|||
|
"type"
|
|||
|
],
|
|||
|
"type": "object"
|
|||
|
}
|
|||
|
],
|
|||
|
"definitions": {
|
|||
|
"common": {
|
|||
|
"description": "Tree 格式说明",
|
|||
|
"allOf": [
|
|||
|
{
|
|||
|
"$ref": "https://houtai.baidu.com/v2/schemas/form.json#/definitions/item"
|
|||
|
},
|
|||
|
{
|
|||
|
"properties": {
|
|||
|
"$ref": {
|
|||
|
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref",
|
|||
|
"description": "引用页面中的定义"
|
|||
|
},
|
|||
|
"hideRoot": {
|
|||
|
"default": false,
|
|||
|
"description": "是否显示顶级节点",
|
|||
|
"type": "boolean"
|
|||
|
},
|
|||
|
"rootLabel": {
|
|||
|
"description": "顶级节点显示名称",
|
|||
|
"type": "string"
|
|||
|
},
|
|||
|
"rootValue": {
|
|||
|
"description": "顶级节点值",
|
|||
|
"type": "string"
|
|||
|
},
|
|||
|
"showIcon": {
|
|||
|
"default": "false",
|
|||
|
"description": "是否只有选项前的图标",
|
|||
|
"type": "boolean"
|
|||
|
},
|
|||
|
"showRadio": {
|
|||
|
"default": "false",
|
|||
|
"description": "是否单选框",
|
|||
|
"type": "boolean"
|
|||
|
},
|
|||
|
"label": {
|
|||
|
"description": "文本",
|
|||
|
"type": "string"
|
|||
|
},
|
|||
|
"source": {
|
|||
|
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api",
|
|||
|
"description": "可用来通过 API 拉取 options。详情:https://baidu.github.io/amis/docs/api#formitem"
|
|||
|
},
|
|||
|
"options": {
|
|||
|
"$ref": "https://houtai.baidu.com/v2/schemas/form.json#/definitions/nestedOptionsType",
|
|||
|
"description": "选项集合"
|
|||
|
},
|
|||
|
"cascade": {
|
|||
|
"type": "boolean",
|
|||
|
"description": "不自动选中子节点?"
|
|||
|
},
|
|||
|
"withChildren": {
|
|||
|
"type": "boolean",
|
|||
|
"description": "数值是否携带子节点"
|
|||
|
},
|
|||
|
"multiple": {
|
|||
|
"default": false,
|
|||
|
"description": "是否为多选",
|
|||
|
"type": "boolean"
|
|||
|
},
|
|||
|
"joinValues": {
|
|||
|
"default": true,
|
|||
|
"description": "* 单选模式:当用户选中某个选项时,选项中的 value 将被作为该表单项的值提交,否则,整个选项对象都会作为该表单项的值提交。\n* 多选模式:选中的多个选项的 `value` 会通过 `delimiter` 连接起来,否则直接将以数组的形式提交值。",
|
|||
|
"type": "boolean"
|
|||
|
},
|
|||
|
"delimiter": {
|
|||
|
"default": ",",
|
|||
|
"description": "分割符",
|
|||
|
"type": "string"
|
|||
|
},
|
|||
|
"extractValue": {
|
|||
|
"default": true,
|
|||
|
"description": "开启后将选中的选项 value 的值封装为数组,作为当前表单项的值。",
|
|||
|
"type": "boolean"
|
|||
|
},
|
|||
|
"resetValue": {
|
|||
|
"default": "",
|
|||
|
"description": "清除时设置的值"
|
|||
|
},
|
|||
|
"clearValue": {
|
|||
|
"description": "是否显示清除按钮",
|
|||
|
"type": "boolean"
|
|||
|
}
|
|||
|
},
|
|||
|
"type": "object"
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
"test": {
|
|||
|
"properties": {
|
|||
|
"type": {
|
|||
|
"const": "tree"
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
},
|
|||
|
"description": "Tree 格式说明",
|
|||
|
"type": "object"
|
|||
|
}
|