amis/schemas/list.json

305 lines
10 KiB
JSON
Raw Permalink Normal View History

2020-05-27 14:57:40 +08:00
{
2020-08-21 15:28:22 +08:00
"$id": "https://houtai.baidu.com/v2/schemas/list.json#",
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "https://houtai.baidu.com/v2/schemas/table.json#/definitions/common"
},
{
"additionalProperties": false,
"dependencies": {},
"patternProperties": {
"^(\\$ref|showHeader|showFooter|listItem|data|className|footerClassName|headerClassName|placeholder|source|title|toolbarClassName|header|footer)$": {}
},
"properties": {
"$schema": {
"description": "绑定 JSON 格式说明,可忽略!",
"format": "uri",
"type": "string"
},
"type": {
"const": "list",
"description": "指定为 list 类型",
"type": "string"
}
},
"required": ["type"]
}
],
"definitions": {
"body": {
"description": "内容容器",
"oneOf": [
2020-05-27 14:57:40 +08:00
{
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/list.json#/definitions/field"
2020-05-27 14:57:40 +08:00
},
{
2020-08-21 15:28:22 +08:00
"items": {
2020-05-27 14:57:40 +08:00
"oneOf": [
2020-08-21 15:28:22 +08:00
{
"$ref": "https://houtai.baidu.com/v2/schemas/list.json#/definitions/field"
},
{
"description": "**不推荐使用数组,请用 hbox 包裹**",
"items": {
"$ref": "https://houtai.baidu.com/v2/schemas/list.json#/definitions/field"
2020-05-27 14:57:40 +08:00
},
2020-08-21 15:28:22 +08:00
"type": "array"
}
2020-05-27 14:57:40 +08:00
]
2020-08-21 15:28:22 +08:00
},
"type": "array"
}
]
},
"common": {
"description": "amis list 渲染器格式说明。",
"properties": {
"$ref": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref",
"description": "引用页面中的定义"
2020-05-27 14:57:40 +08:00
},
2020-08-21 15:28:22 +08:00
"className": {
"default": "panel-default",
"description": "外层 CSS 类名",
"type": "string"
},
"data": {
"description": "默认的数据"
},
"footer": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/container",
"description": "底部容器"
},
"footerClassName": {
"default": "crud-list-footer",
"description": "底部外层 CSS 类名",
"type": "string"
},
"header": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/container",
"description": "顶部容器"
},
"headerClassName": {
"default": "amis-list-header",
"description": "顶部外层 CSS 类名",
"type": "string"
},
"listItem": {
"description": "成员内容配置",
"properties": {
"actions": {
"items": {
"$ref": "https://houtai.baidu.com/v2/schemas/action.json#"
},
"type": "array"
},
"avatar": {
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
"description": "头像,支持tpl"
},
"body": {
"$ref": "https://houtai.baidu.com/v2/schemas/list.json#/definitions/body"
2020-05-27 14:57:40 +08:00
},
2020-08-21 15:28:22 +08:00
"desc": {
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
"description": "描述,支持tpl"
},
"remark": {
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
"description": "tooltip 说明"
},
"subTitle": {
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
"description": "副标题, 支持tpl"
},
"title": {
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
"description": "标题, 支持tpl"
}
},
"type": "object"
2020-05-27 14:57:40 +08:00
},
2020-08-21 15:28:22 +08:00
"placeholder": {
"description": "占位符"
},
"showFooter": {
"default": true,
"description": "是否显示底部",
"type": "boolean"
},
"showHeader": {
"default": true,
"description": "是否显示头部",
"type": "boolean"
},
"source": {
"description": "数据源:绑定当前环境变量"
}
},
"type": "object"
},
"field": {
"allOf": [
{
"if": {
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/test"
},
"then": {
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/common"
},
"else": {
"if": {
"$ref": "https://houtai.baidu.com/v2/schemas/image.json#/definitions/test"
},
"then": {
"$ref": "https://houtai.baidu.com/v2/schemas/image.json#/definitions/common"
},
"else": {
"if": {
"$ref": "https://houtai.baidu.com/v2/schemas/date.json#/definitions/test"
},
"then": {
"$ref": "https://houtai.baidu.com/v2/schemas/date.json#/definitions/common"
},
"else": {
"if": {
"$ref": "https://houtai.baidu.com/v2/schemas/status.json#/definitions/test"
},
"then": {
"$ref": "https://houtai.baidu.com/v2/schemas/status.json#/definitions/common"
},
"else": {
"if": {
"$ref": "https://houtai.baidu.com/v2/schemas/mapping.json#/definitions/test"
},
"then": {
"$ref": "https://houtai.baidu.com/v2/schemas/mapping.json#/definitions/common"
},
"else": {
2020-05-27 14:57:40 +08:00
"if": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/progress.json#/definitions/test"
2020-05-27 14:57:40 +08:00
},
"then": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/progress.json#/definitions/common"
2020-05-27 14:57:40 +08:00
},
"else": {
2020-08-21 15:28:22 +08:00
"if": {
"$ref": "https://houtai.baidu.com/v2/schemas/switch.json#/definitions/test"
},
"then": {
"$ref": "https://houtai.baidu.com/v2/schemas/switch.json#/definitions/common"
},
"else": {
2020-05-27 14:57:40 +08:00
"if": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/hbox.json#/definitions/test"
2020-05-27 14:57:40 +08:00
},
"then": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/hbox.json#/definitions/common"
2020-05-27 14:57:40 +08:00
},
"else": {
2020-08-21 15:28:22 +08:00
"if": {
"$ref": "https://houtai.baidu.com/v2/schemas/grid.json#/definitions/test"
},
"then": {
"$ref": "https://houtai.baidu.com/v2/schemas/grid.json#/definitions/common"
},
"else": {
2020-05-27 14:57:40 +08:00
"if": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/json.json#/definitions/test"
2020-05-27 14:57:40 +08:00
},
"then": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/json.json#/definitions/common"
2020-05-27 14:57:40 +08:00
},
"else": {
2020-08-21 15:28:22 +08:00
"if": {
"$ref": "https://houtai.baidu.com/v2/schemas/list.json#/definitions/test"
},
"then": {
"$ref": "https://houtai.baidu.com/v2/schemas/list.json#/definitions/common"
},
"else": {
2020-05-27 14:57:40 +08:00
"if": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/operation.json#/definitions/test"
2020-05-27 14:57:40 +08:00
},
"then": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/operation.json#/definitions/common"
2020-05-27 14:57:40 +08:00
},
"else": {
2020-08-21 15:28:22 +08:00
"$ref": "https://houtai.baidu.com/v2/schemas/plain.json#/definitions/common"
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
}
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
}
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
}
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
}
}
}
}
}
},
{
"properties": {
"label": {
"description": "字段名称",
"type": "string"
},
"name": {
"description": "绑定字段名",
"type": "string"
},
"popOver": {
"description": "配置查看详情功能",
"oneOf": [
{
"type": "boolean"
2020-05-27 14:57:40 +08:00
},
{
2020-08-21 15:28:22 +08:00
"properties": {},
"type": "object"
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
]
},
"quickEdit": {
"description": "配置快速编辑功能",
"oneOf": [
{
"type": "boolean"
},
{
"properties": {},
"type": "object"
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
]
},
"copyable": {
"description": "配置点击复制功能",
"oneOf": [
{
"type": "boolean"
},
{
"properties": {},
"type": "object"
}
]
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
},
"type": "object"
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
]
2020-05-27 14:57:40 +08:00
},
2020-08-21 15:28:22 +08:00
"test": {
"properties": {
"type": {
"const": "list"
}
}
}
},
"description": "amis list 渲染器格式说明。",
"type": "object"
}