amis/schemas/form/formula.json
2020-09-03 11:45:31 +08:00

76 lines
2.0 KiB
JSON

{
"$id": "/schemas/form/formula.json#",
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "/schemas/form/formula.json#/definitions/common"
},
{
"additionalProperties": false,
"patternProperties": {
"^(\\$ref|name|formula|value|initSet|autoSet|id|condition)$": {}
},
"properties": {
"$schema": {
"format": "uri",
"type": "string",
"description": "绑定 JSON 格式说明,可忽略!"
},
"type": {
"const": "formula",
"description": "指定为公式功能框"
}
},
"required": ["type"],
"type": "object"
}
],
"definitions": {
"common": {
"description": "隐藏域格式说明",
"properties": {
"$ref": {
"$ref": "/schemas/page.json#/definitions/$ref",
"description": "引用页面中的定义"
},
"id": {
"description": "当某个按钮的目标指定为此值后,会触发一次公式应用。这个机制可以在 autoSet 为 false 时用来手动触发",
"type": "string"
},
"condition": {
"description": "触发公式的作用条件,如 data.xxx == \"a\" 或者 ${xx} ",
"type": "string"
},
"autoSet": {
"description": "是否自动应用",
"type": "boolean"
},
"formula": {
"description": "公式",
"type": "string"
},
"initSet": {
"description": "是否初始应用",
"type": "boolean"
},
"name": {
"description": "字段名,公式结果将作用到此处指定的变量中去",
"type": "string"
},
"value": {
"description": "默认值"
}
}
},
"test": {
"properties": {
"type": {
"const": "formula"
}
}
}
},
"description": "隐藏域格式说明",
"type": "object"
}