mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
193 lines
7.5 KiB
JSON
193 lines
7.5 KiB
JSON
{
|
||
"$id": "https://houtai.baidu.com/v2/schemas/wizard.json#",
|
||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||
"allOf": [
|
||
{
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/wizard.json#/definitions/common"
|
||
},
|
||
{
|
||
"additionalProperties": false,
|
||
"dependencies": {},
|
||
"patternProperties": {
|
||
"^(\\$ref|mode|disabled|disabledOn|visible|visibleOn|readOnly|redirect|steps|name|className|actionClassName|actionPrevLabel|target|reload|actionNextlabel|actionNextSaveLabel|actionFinishLabel|bulkSubmit|initApi|api|messages)$": {}
|
||
},
|
||
"properties": {
|
||
"$schema": {
|
||
"format": "uri",
|
||
"type": "string",
|
||
"description": "绑定 JSON 格式说明,可忽略!"
|
||
},
|
||
"type": {
|
||
"const": "wizard",
|
||
"description": "指定为 service 类型",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["type", "steps"],
|
||
"type": "object"
|
||
}
|
||
],
|
||
"definitions": {
|
||
"common": {
|
||
"description": "amis Wizard 渲染器,格式说明。https://baidu.github.io/amis/docs/renderers#wizard",
|
||
"properties": {
|
||
"$ref": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref",
|
||
"description": "引用页面中的定义"
|
||
},
|
||
"actionClassName": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
|
||
"description": "配置按钮 className"
|
||
},
|
||
"actionFinishLabel": {
|
||
"description": "完成按钮的文字描述",
|
||
"type": "string"
|
||
},
|
||
"actionNextLabel": {
|
||
"description": "下一步按钮的文字描述",
|
||
"type": "string"
|
||
},
|
||
"actionNextSaveLabel": {
|
||
"description": "下一步并且保存按钮的文字描述",
|
||
"type": "string"
|
||
},
|
||
"actionPrevLabel": {
|
||
"description": "上一步按钮的文字描述",
|
||
"type": "string"
|
||
},
|
||
"api": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api",
|
||
"description": "Wizard 用来保存数据的 api。[详情](https://baidu.github.io/amis/docs/api#wizard)"
|
||
},
|
||
"bulkSubmit": {
|
||
"default": false,
|
||
"description": "是否合并后再提交",
|
||
"type": "boolean"
|
||
},
|
||
"className": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
|
||
"description": "配置容器 className"
|
||
},
|
||
"disabled": {
|
||
"description": "是否为禁用状态。",
|
||
"type": "boolean"
|
||
},
|
||
"disabledOn": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/expression",
|
||
"description": "通过 JS 表达式来配置当前表单项的禁用状态。"
|
||
},
|
||
"hiddenOn": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/expression",
|
||
"description": "通过 JS 表达式来配置当前表单项是否隐藏。"
|
||
},
|
||
"initApi": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api",
|
||
"description": "Wizard 用来获取初始数据的 api。[详情](https://baidu.github.io/amis/docs/api#wizard)"
|
||
},
|
||
"messages": {
|
||
"additionalProperties": false,
|
||
"properties": {
|
||
"fetchFailed": {
|
||
"description": "获取失败时提示",
|
||
"type": "string"
|
||
},
|
||
"fetchSuccess": {
|
||
"description": "获取成功时提示",
|
||
"type": "string"
|
||
},
|
||
"saveFailed": {
|
||
"description": "保存成功时提示",
|
||
"type": "string"
|
||
},
|
||
"saveSuccess": {
|
||
"description": "保存失败时提示",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"type": "object"
|
||
},
|
||
"mode": {
|
||
"enum": ["vertical", "horizontal"],
|
||
"default": "horizontal",
|
||
"description": "展示模式",
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/name",
|
||
"description": "给当前 wizard 取个名字,可用来跟其他 Renderer 交互。"
|
||
},
|
||
"readOnly": {
|
||
"description": "是否为只读模式。",
|
||
"type": "boolean"
|
||
},
|
||
"redirect": {
|
||
"description": "保存完后,可以指定跳转地址,支持相对路径和组内绝对路径,同时可以通过 $xxx 使用变量",
|
||
"type": "string"
|
||
},
|
||
"reload": {
|
||
"description": "保存完后,可以通过配置此属性来让其他组件刷新",
|
||
"type": "string"
|
||
},
|
||
"steps": {
|
||
"description": "步骤集合, 每一个配置同 form 渲染器。",
|
||
"items": {
|
||
"allOf": [
|
||
{
|
||
"properties": {
|
||
"api": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api",
|
||
"description": "当前步骤用来保存数据的 api。[详情](https://baidu.github.io/amis/docs/api#form)"
|
||
},
|
||
"initApi": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api",
|
||
"description": "当前步骤用来获取初始数据的 api。[详情](https://baidu.github.io/amis/docs/api#form)"
|
||
},
|
||
"jumpable": {
|
||
"description": "是否可直接跳转到该步骤,一般编辑模式需要可直接跳转查看。",
|
||
"type": "boolean"
|
||
},
|
||
"jumpableOn": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/expression",
|
||
"description": "通过 JS 表达式来配置当前步骤可否被直接跳转到。"
|
||
},
|
||
"label": {
|
||
"description": "Step 标题 title 别名,推荐直接用 title",
|
||
"type": "string"
|
||
},
|
||
"title": {
|
||
"description": "Step 标题",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"type": "object"
|
||
},
|
||
{
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/form.json#/definitions/common"
|
||
}
|
||
],
|
||
"description": "步骤详情"
|
||
},
|
||
"type": "array"
|
||
},
|
||
"target": {
|
||
"description": "默认表单提交自己会通过发送 api 保存数据,但是也可以设定另外一个 form 的 name 值,或者另外一个 `CRUD` 模型的 name 值。 如果 target 目标是一个 `Form` ,则目标 `Form` 会重新触发 `initApi` 和 `schemaApi`,api 可以拿到当前 form 数据。如果目标是一个 `CRUD` 模型,则目标模型会重新触发搜索,参数为当前 Form 数据。",
|
||
"type": "string"
|
||
},
|
||
"visibleOn": {
|
||
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/expression",
|
||
"description": "通过 JS 表达式来配置当前表单项是否显示"
|
||
}
|
||
}
|
||
},
|
||
"test": {
|
||
"properties": {
|
||
"type": {
|
||
"const": "wizard"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"description": "amis Wizard 渲染器,格式说明。https://baidu.github.io/amis/docs/renderers#wizard",
|
||
"type": "object"
|
||
}
|