mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 19:38:16 +08:00
384 lines
18 KiB
JSON
384 lines
18 KiB
JSON
{
|
|
"$id": "https://houtai.baidu.com/v2/schemas/cards.json#",
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"allOf": [
|
|
{
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/cards.json#/definitions/common"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"dependencies": {},
|
|
"patternProperties": {
|
|
"^(\\$ref|showHeader|showFooter|card|title|source|placeholder|className|headerClassName|footerClassName|itemClassName|)$": {}
|
|
},
|
|
"properties": {
|
|
"$schema": {
|
|
"description": "绑定 JSON 格式说明,可忽略!",
|
|
"format": "uri",
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"const": "cards",
|
|
"description": "指定为 cards 类型",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"body": {
|
|
"description": "内容容器",
|
|
"oneOf": [
|
|
{
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/cards.json#/definitions/field"
|
|
},
|
|
{
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/cards.json#/definitions/field"
|
|
},
|
|
{
|
|
"description": "**不推荐使用数组,请用 hbox 包裹**",
|
|
"items": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/cards.json#/definitions/field"
|
|
},
|
|
"type": "array"
|
|
}
|
|
]
|
|
},
|
|
"type": "array"
|
|
}
|
|
]
|
|
},
|
|
"card": {
|
|
"type": "object",
|
|
"properties": {
|
|
"$ref": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref",
|
|
"description": "引用页面中的定义"
|
|
},
|
|
"type": {
|
|
"const": "card",
|
|
"description": "指定为 card 渲染器"
|
|
},
|
|
"actions": {
|
|
"items": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/action.json#"
|
|
},
|
|
"type": "array"
|
|
},
|
|
"actionsCount": {
|
|
"description": "卡片一行最多能放按钮个数",
|
|
"type": "number"
|
|
},
|
|
"avatarClassName": {
|
|
"description": "图片 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"body": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/cards.json#/definitions/body"
|
|
},
|
|
"bodyClassName": {
|
|
"description": "内容区 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"className": {
|
|
"description": "外层 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"descClassName": {
|
|
"description": "描述 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"header": {
|
|
"description": "头部内容",
|
|
"properties": {
|
|
"avatar": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
|
|
"description": "头像,支持tpl"
|
|
},
|
|
"desc": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
|
|
"description": "描述,支持tpl"
|
|
},
|
|
"descClassName": {
|
|
"description": "描述 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"header": {
|
|
"description": "头部内容",
|
|
"properties": {
|
|
"avatar": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
|
|
"description": "头像,支持tpl"
|
|
},
|
|
"desc": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/tpl.json#/definitions/tpl",
|
|
"description": "描述,支持tpl"
|
|
},
|
|
"highlight": {
|
|
"description": "是否高亮表达式",
|
|
"type": "string"
|
|
},
|
|
"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"
|
|
},
|
|
"higlight": {
|
|
"description": "是否高亮表达式",
|
|
"type": "string"
|
|
},
|
|
"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"
|
|
},
|
|
"highlightClassName": {
|
|
"description": "高亮 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"subTitleClassName": {
|
|
"description": "副标题 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"titleClassName": {
|
|
"description": "标题 CSS 类名",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"common": {
|
|
"description": "AMis cards 渲染器格式说明。",
|
|
"properties": {
|
|
"$ref": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref",
|
|
"description": "引用页面中的定义"
|
|
},
|
|
"card": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/cards.json#/definitions/card",
|
|
"type": "object"
|
|
},
|
|
"className": {
|
|
"description": "外层 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"footerClassName": {
|
|
"description": "底部 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"headerClassName": {
|
|
"description": "头部 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"itemClassName": {
|
|
"default": "col-sm-4 col-md-3",
|
|
"description": "卡片 CSS 类名",
|
|
"type": "string"
|
|
},
|
|
"placeholder": {
|
|
"default": "暂无数据",
|
|
"description": "无数据提示",
|
|
"type": "string"
|
|
},
|
|
"showFooter": {
|
|
"default": true,
|
|
"description": "是否显示底部",
|
|
"type": "boolean"
|
|
},
|
|
"showHeader": {
|
|
"default": true,
|
|
"description": "是否显示头部",
|
|
"type": "boolean"
|
|
},
|
|
"source": {
|
|
"default": "${items}",
|
|
"description": "数据源: 绑定当前环境变量",
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"description": "标题",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"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": {
|
|
"if": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/progress.json#/definitions/test"
|
|
},
|
|
"then": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/progress.json#/definitions/common"
|
|
},
|
|
"else": {
|
|
"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": {
|
|
"if": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/hbox.json#/definitions/test"
|
|
},
|
|
"then": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/hbox.json#/definitions/common"
|
|
},
|
|
"else": {
|
|
"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": {
|
|
"if": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/json.json#/definitions/test"
|
|
},
|
|
"then": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/json.json#/definitions/common"
|
|
},
|
|
"else": {
|
|
"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": {
|
|
"if": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/operation.json#/definitions/test"
|
|
},
|
|
"then": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/operation.json#/definitions/common"
|
|
},
|
|
"else": {
|
|
"$ref": "https://houtai.baidu.com/v2/schemas/plain.json#/definitions/common"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"properties": {
|
|
"label": {
|
|
"description": "字段名称",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "绑定字段名",
|
|
"type": "string"
|
|
},
|
|
"popOver": {
|
|
"description": "配置查看详情功能",
|
|
"oneOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"properties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"quickEdit": {
|
|
"description": "配置快速编辑功能",
|
|
"oneOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"properties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"copyable": {
|
|
"description": "配置点击复制功能",
|
|
"oneOf": [
|
|
{
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"properties": {},
|
|
"type": "object"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"test": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "cards"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"description": "AMis cards 渲染器格式说明。",
|
|
"type": "object"
|
|
} |