| { | |
| "schema": { | |
| "type": "object", | |
| "properties": { | |
| "case1": { | |
| "title": "整体隐藏", | |
| "type": "object", | |
| "properties": { | |
| "showMore": { | |
| "title": "显示更多", | |
| "type": "boolean" | |
| }, | |
| "x1": { | |
| "title": "输入框1", | |
| "type": "string", | |
| "hidden": "{{!formData.case1.showMore}}" | |
| }, | |
| "x2": { | |
| "title": "输入框2", | |
| "type": "string", | |
| "hidden": "{{!formData.case1.showMore}}" | |
| } | |
| } | |
| }, | |
| "case2": { | |
| "title": "选项联动", | |
| "type": "object", | |
| "properties": { | |
| "bi": { | |
| "title": "汇款币种", | |
| "type": "string", | |
| "enum": [ | |
| "rmb", | |
| "dollar" | |
| ], | |
| "enumNames": [ | |
| "人民币", | |
| "美元" | |
| ] | |
| }, | |
| "inputName": { | |
| "title": "金额", | |
| "tooltip": "{{formData.case2.bi === 'dollar' ? '一次汇款不超过150美元':'一次汇款不超过1000元'}}", | |
| "type": "string", | |
| "props": { | |
| "addonBefore": "{{formData.case2.bi === 'dollar'? '$':'¥'}}", | |
| "addonAfter": "{{formData.case2.bi === 'dollar'? '美元':'元'}}" | |
| } | |
| } | |
| } | |
| }, | |
| "case3": { | |
| "title": "列表/显示不同组件", | |
| "type": "object", | |
| "properties": { | |
| "ruleList": { | |
| "title": "球员筛选", | |
| "type": "array", | |
| "items": { | |
| "type": "object", | |
| "properties": { | |
| "attr": { | |
| "title": "标准", | |
| "type": "string", | |
| "widget": "select", | |
| "enum": [ | |
| "goal", | |
| "league" | |
| ], | |
| "enumNames": [ | |
| "入球数", | |
| "所在联盟" | |
| ], | |
| "width": "40%" | |
| }, | |
| "relation": { | |
| "title": "关系", | |
| "type": "string", | |
| "enum": [ | |
| ">", | |
| "<", | |
| "=" | |
| ], | |
| "widget": "select", | |
| "hidden": "{{rootValue.attr === 'league'}}", | |
| "width": "20%" | |
| }, | |
| "goal": { | |
| "title": "入球数", | |
| "type": "string", | |
| "rules": [ | |
| { | |
| "pattern": "^[0-9]+$", | |
| "message": "输入正确得分" | |
| } | |
| ], | |
| "hidden": "{{rootValue.attr === 'league'}}", | |
| "width": "40%" | |
| }, | |
| "league": { | |
| "title": "名称", | |
| "type": "string", | |
| "enum": [ | |
| "a", | |
| "b", | |
| "c" | |
| ], | |
| "enumNames": [ | |
| "西甲", | |
| "英超", | |
| "中超" | |
| ], | |
| "widget": "select", | |
| "hidden": "{{rootValue.attr !== 'league'}}", | |
| "width": "40%" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |