forked from p96170835/amis
507 lines
35 KiB
JSON
507 lines
35 KiB
JSON
{
|
||
"$id": "https://houtai.baidu.com/v2/schemas/page.json#",
|
||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||
"additionalProperties": false,
|
||
"definitions": {
|
||
"$ref": {
|
||
"description": "引用page下已经定义好的类型",
|
||
"type": "string"
|
||
},
|
||
"api": {
|
||
"description": "服务端 API 地址, 可以配置 `$varName` 做变量替换",
|
||
"oneOf": [
|
||
{
|
||
"descriptions": "例如: `get:http://www.baidu.com/` 可以使用 $var 或者 ${var} 从容器 data 中获取变量。\n 注意:为了不暴露 API 地址,默认会被替换成 AMis 中转,如果不想被转义请这样配置 `raw:http://www.baidu.com` \n 另外,如果代理的话,默认只能请求内网服务,如需访问外网服务,请这样配置 `external:http://www.com/api/doXX`",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"data": {
|
||
"default": {
|
||
"&": "$$"
|
||
},
|
||
"description": "用来控制携带数据. 当key 为 `&` 值为 `$$` 时, 将所有原始数据打平设置到 data 中. 当值为 $$ 将所有原始数据赋值到对应的 key 中. 当值为 $ 打头时, 将变量值设置到 key 中.",
|
||
"type": "object"
|
||
},
|
||
"dataType": {
|
||
"default": "json",
|
||
"description": "发送体的格式",
|
||
"enum": [
|
||
"form-data",
|
||
"json"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"responseType": {
|
||
"default": "",
|
||
"description": "接口返回数据类型,当做文件下载时请配置为 blob。",
|
||
"enum": [
|
||
"blob"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"headers": {
|
||
"description": "携带 headers,用法和 data 一样,可以用变量。",
|
||
"type": "object"
|
||
},
|
||
"method": {
|
||
"default": "get",
|
||
"enum": [
|
||
"get",
|
||
"post",
|
||
"put",
|
||
"delete"
|
||
]
|
||
},
|
||
"url": {
|
||
"$ref": "#/definitions/url",
|
||
"description": "当 url 中存在 $$ 会被替换成所有的值 json 序列化. 当 $key 时替换成对应的值."
|
||
},
|
||
"sendOn": {
|
||
"type": "string",
|
||
"description": "设置发送条件"
|
||
}
|
||
},
|
||
"required": [
|
||
"url"
|
||
],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"className": {
|
||
"description": "用来配置 dom class 名字",
|
||
"pattern": "^([a-zA-Z][a-zA-Z0-9\\-_]*(?:\\s+|$))*$",
|
||
"type": "string"
|
||
},
|
||
"container": {
|
||
"oneOf": [
|
||
{
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/string",
|
||
"description": "当值为字符串时会被当做模板来处理,要指定其他渲染类型请使用对象定义如:\n{\n\n\t \"type\": \"form\" \n } \n 可通过 $xxx 或者 ${xxx} 取值,或者直接用 lodash.template 模板引擎。\n\n详情: https://baidu.github.io/amis/docs/renderers#tpl"
|
||
},
|
||
{
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/subRenderer"
|
||
},
|
||
{
|
||
"items": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/container"
|
||
},
|
||
"type": "array"
|
||
}
|
||
]
|
||
},
|
||
"expression": {
|
||
"description": "Js 表达式。如 data.type == 1",
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"description": "变量名称",
|
||
"pattern": "^[a-zA-Z_][a-zA-Z0-9_\\-]*$",
|
||
"type": "string"
|
||
},
|
||
"string": {
|
||
"description": "支持模板, 可通过 $xxx 或者 ${xxx} 取值,或者直接用 lodash.template 模板引擎。详情: https://baidu.github.io/amis/docs/renderers#tpl",
|
||
"type": "string"
|
||
},
|
||
"stringOrNull": {
|
||
"description": "字符或者 null",
|
||
"oneOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"customRenderer": {
|
||
"description": "自定组件,非系统组件,请确保你已在自定义组件中添加了对应的组件。",
|
||
"properties": {
|
||
"type": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"type"
|
||
],
|
||
"title": "自定义渲染器",
|
||
"type": "object"
|
||
},
|
||
"subRenderer": {
|
||
"if": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/action.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/action.json#/definitions/common"
|
||
},
|
||
"else": {
|
||
"if": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/button-group.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/button-group.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/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/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/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/dropdown-button.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/dropdown-button.json#/definitions/common"
|
||
},
|
||
"else": {
|
||
"if": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/form.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/form.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/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/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/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/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/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/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/operation.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/operation.json#/definitions/common"
|
||
},
|
||
"else": {
|
||
"if": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/panel.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/panel.json#/definitions/common"
|
||
},
|
||
"else": {
|
||
"if": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/plain.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/plain.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/service.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/service.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/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/table.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/table.json#/definitions/common"
|
||
},
|
||
"else": {
|
||
"if": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/tabs.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/tabs.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/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/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/wizard.json#/definitions/test"
|
||
},
|
||
"then": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/wizard.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/page.json#/definitions/customRenderer"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"tpl": {
|
||
"description": "支持模板, 可通过 $xxx 或者 ${xxx} 取值,或者直接用 lodash.template 模板引擎。详情: https://baidu.github.io/amis/docs/renderers#tpl",
|
||
"title": "模板",
|
||
"type": "string"
|
||
},
|
||
"url": {
|
||
"_pattern": "^(?:raw)?(?:https?:\\/\\/[^\\/]+|[A-Z][A-Z_0-9]*)?(?:\\/(?:\\w)*)+(?:\\?.*)?$",
|
||
"type": "string"
|
||
},
|
||
"varName": {
|
||
"description": "变量名称",
|
||
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"description": "AMis Page 渲染器。详情请见:https://baidu.github.io/amis/docs/renderers#page",
|
||
"properties": {
|
||
"$schema": {
|
||
"description": "绑定 JSON 格式说明,可忽略!",
|
||
"format": "uri",
|
||
"type": "string"
|
||
},
|
||
"aside": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/container",
|
||
"title": "左边栏容器"
|
||
},
|
||
"asideClassName": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
|
||
"description": "配置 aside 容器 className"
|
||
},
|
||
"body": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/container",
|
||
"title": "页面内容区域"
|
||
},
|
||
"bodyClassName": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
|
||
"description": "配置 body 容器 className"
|
||
},
|
||
"className": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
|
||
"description": "配置容器 className"
|
||
},
|
||
"data": {
|
||
"description": "初始数据,设置得值可用于组件内部模板使用。",
|
||
"type": "object"
|
||
},
|
||
"headerClassName": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
|
||
"description": "配置 header 容器 className"
|
||
},
|
||
"initApi": {
|
||
"$ref": "#/definitions/api",
|
||
"description": "页面初始化的时候,可以设置一个 API 让其取拉取,发送数据会携带当前 data 数据(包含地址栏参数),获取得数据会合并到 data 中,供组件内使用。"
|
||
},
|
||
"initFetch": {
|
||
"default": true,
|
||
"description": "是否默认就拉取?",
|
||
"type": "boolean"
|
||
},
|
||
"initFetchOn": {
|
||
"description": "是否默认就拉取?通过表达式来决定",
|
||
"type": "string"
|
||
},
|
||
"messages": {
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"fetchFailed": {
|
||
"description": "用来配置当 initApi 拉取失败时提示的信息",
|
||
"type": "string"
|
||
},
|
||
"fetchSuccess": {
|
||
"description": "用来配置当 initApi 拉取成功时提示的信息,当然不设置的话就不会提示。",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"type": "object"
|
||
},
|
||
"name": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/name",
|
||
"description": "给当前组件设定一个名,方便其他组件引用。"
|
||
},
|
||
"remark": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/stringOrNull",
|
||
"description": "页面描述"
|
||
},
|
||
"subTitle": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/stringOrNull",
|
||
"description": "页面副标题"
|
||
},
|
||
"title": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/stringOrNull",
|
||
"description": "页面标题"
|
||
},
|
||
"toolbar": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/container",
|
||
"description": "页面顶部区域,当存在 title 时在右上角显示。"
|
||
},
|
||
"toolbarClassName": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
|
||
"description": "配置 toolbar 容器 className"
|
||
},
|
||
"type": {
|
||
"const": "page",
|
||
"description": "指定为 page 渲染器。",
|
||
"type": "string"
|
||
},
|
||
"definitions": {
|
||
"type": "object",
|
||
"description": "定义可复用类型,方便子节点引用"
|
||
}
|
||
},
|
||
"required": [
|
||
"$schema",
|
||
"type"
|
||
],
|
||
"type": "object"
|
||
} |