amis/schemas/form/datetime.json

89 lines
4.2 KiB
JSON
Raw Normal View History

2020-05-27 14:57:40 +08:00
{
"$id": "https://houtai.baidu.com/v2/schemas/form/datetime.json#",
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "https://houtai.baidu.com/v2/schemas/form/datetime.json#/definitions/common"
},
{
"additionalProperties": false,
"patternProperties": {
"^(\\$ref|format|inputFormat|timeFormat|minDate|maxDate|clearable|name|value|placeholder|label|remark|labelRemark|desc|description|inline|mode|horizontal|className|labelClassName|inputClassName|descriptionClassName|validations|validationErrors|validateOnChange|submitOnChange|disabled|disabledOn|visible|visibleOn|hidden|hiddenOn|required)$": {}
},
"properties": {
"$schema": {
"format": "uri",
"type": "string",
"description": "绑定 JSON 格式说明,可忽略!"
},
"type": {
"const": "datetime",
"description": "指定为日期时间输入类型"
}
},
"required": [
"type"
],
"type": "object"
}
],
"definitions": {
"common": {
"description": "日期时间输入框格式说明",
"allOf": [
{
"$ref": "https://houtai.baidu.com/v2/schemas/form.json#/definitions/item"
},
{
"properties": {
"$ref": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref",
"description": "引用页面中的定义"
},
"clearable": {
"default": true,
"description": "是否显示清除按钮",
"type": "boolean"
},
"format": {
"default": "X",
"description": "默认 `X` 即时间戳格式,用来提交的时间格式。更多格式类型请参考 moment.",
"type": "string"
},
"inputFormat": {
"default": "YYYY-MM-DD HH:mm:ss",
"description": "默认 `YYYY-MM-DD` 用来配置显示的datetime格式。",
"type": "string"
},
"timeFormat": {
"default": "HH:mm:ss",
"description": "默认 `HH:mm:ss` 用来配置显示的time格式。",
"type": "string"
},
"maxDate": {
"description": "最大日期限制,支持变量 $xxx 来取值,或者用相对值如:* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位 `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。",
"type": "string"
},
"minDate": {
"description": "最小日期限制,支持变量 $xxx 来取值,或者用相对值如:* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位 `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。",
"type": "string"
},
"value": {
"description": "这里面 value 需要特殊说明一下,因为支持相对值。* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位 `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。"
}
},
"type": "object"
}
]
},
"test": {
"properties": {
"type": {
"const": "date-time"
}
}
}
},
"description": "日期时间输入框格式说明",
"type": "object"
}