mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
330 lines
16 KiB
JSON
330 lines
16 KiB
JSON
{
|
||
"$id": "https://houtai.baidu.com/v2/schemas/table.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|footable|footable|showFooter|columns|tableClassName|data|affixHeader|columnsTogglable|className|footerClassName|headerClassName|placeholder|source|tableClassName|title|toolbarClassName|)$": {}
|
||
},
|
||
"properties": {
|
||
"$schema": {
|
||
"description": "绑定 JSON 格式说明,可忽略!",
|
||
"format": "uri",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "table",
|
||
"description": "指定为 tabel 类型",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"type"
|
||
]
|
||
}
|
||
],
|
||
"definitions": {
|
||
"columns": {
|
||
"description": "列配置",
|
||
"items": {
|
||
"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": {
|
||
"fixed": {
|
||
"description": "配置是否固定当前列",
|
||
"enum": [
|
||
"left",
|
||
"right",
|
||
"none"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"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"
|
||
}
|
||
]
|
||
},
|
||
"sortable": {
|
||
"description": "配置是否可以排序",
|
||
"type": "boolean"
|
||
},
|
||
"toggled": {
|
||
"description": "配置是否默认展示",
|
||
"type": "boolean"
|
||
},
|
||
"width": {
|
||
"description": "列宽度",
|
||
"oneOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "number"
|
||
}
|
||
]
|
||
},
|
||
"breakpoint": {
|
||
"type": "string",
|
||
"description": "填写 *、xs、sm、md、lg指定 footable 的触发条件,可以填写多个用空格隔开"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"type": "array"
|
||
},
|
||
"common": {
|
||
"description": "AMis table 渲染器格式说明。",
|
||
"properties": {
|
||
"$ref": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref",
|
||
"description": "引用页面中的定义"
|
||
},
|
||
"affixHeader": {
|
||
"description": "是否固定表头",
|
||
"type": "boolean"
|
||
},
|
||
"className": {
|
||
"default": "panel-default",
|
||
"description": "外层 CSS 类名",
|
||
"type": "string"
|
||
},
|
||
"columns": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/table.json#/definitions/columns"
|
||
},
|
||
"columnsTogglable": {
|
||
"description": "展示列显示开关,自动即:列数量大于或等于5个时自动开启",
|
||
"oneOf": [
|
||
{
|
||
"type": "boolean"
|
||
},
|
||
{
|
||
"const": "auto"
|
||
}
|
||
]
|
||
},
|
||
"data": {
|
||
"description": "默认的数据"
|
||
},
|
||
"footable": {
|
||
"oneOf": [
|
||
{
|
||
"description": "是否开启底部展示功能,适合移动端展示",
|
||
"type": "boolean"
|
||
},
|
||
{
|
||
"properties": {
|
||
"expand": {
|
||
"description": "设置默认展开情况",
|
||
"enum": [
|
||
"first",
|
||
"all",
|
||
"none"
|
||
],
|
||
"type": "string"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"footerClassName": {
|
||
"default": "crud-table-footer",
|
||
"description": "底部外层 CSS 类名",
|
||
"type": "string"
|
||
},
|
||
"headerClassName": {
|
||
"default": "crud-table-header",
|
||
"description": "顶部外层 CSS 类名",
|
||
"type": "string"
|
||
},
|
||
"placeholder": {
|
||
"description": "占位符"
|
||
},
|
||
"showFooter": {
|
||
"default": true,
|
||
"description": "是否显示底部",
|
||
"type": "boolean"
|
||
},
|
||
"showHeader": {
|
||
"default": true,
|
||
"description": "是否显示头部",
|
||
"type": "boolean"
|
||
},
|
||
"source": {
|
||
"description": "数据源:绑定当前环境变量"
|
||
},
|
||
"tableClassName": {
|
||
"default": "table-db table-striped",
|
||
"description": "表格 CSS 类名",
|
||
"type": "string"
|
||
},
|
||
"title": {
|
||
"description": "标题",
|
||
"type": "string"
|
||
},
|
||
"toolbarClassName": {
|
||
"default": "crud-table-toolbar",
|
||
"description": "工具栏 CSS 类名",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"type"
|
||
]
|
||
},
|
||
"test": {
|
||
"properties": {
|
||
"type": {
|
||
"const": "table"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"description": "AMis table 渲染器格式说明。",
|
||
"type": "object"
|
||
} |