amis/schemas/tasks.json

175 lines
7.3 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"$id": "https://houtai.baidu.com/v2/schemas/tasks.json#",
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "https://houtai.baidu.com/v2/schemas/tasks.json#/definitions/common"
},
{
"additionalProperties": false,
"dependencies": {},
"patternProperties": {
"^(\\$ref|remarkLabel|btnText|retryBtnText|btnClassName|statusLabelMap|statusTextMap|retryBtnClassName|name|className|tableClassName|checkApi|submitApi|reSubmitApi|items|interval|taskNameLabel|operationLabel|statusLabel)$": {}
},
"properties": {
"$schema": {
"format": "uri",
"type": "string",
"description": "绑定 JSON 格式说明,可忽略!"
},
"type": {
"const": "tasks",
"description": "指定为任务类型",
"type": "string"
}
},
"required": [
"type"
]
}
],
"definitions": {
"common": {
"description": "AMis Tasks 渲染器格式说明。https://baidu.github.io/amis/docs/renderers#tasks",
"properties": {
"$ref": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/$ref",
"description": "引用页面中的定义"
},
"btnClassName": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
"default": "btn-sm btn-default",
"description": "配置容器按钮 className"
},
"btnText": {
"default": "上线",
"description": "操作按钮文字",
"type": "string"
},
"checkApi": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api",
"description": "用来获取任务状态的 API当没有进行时任务时不会发送。"
},
"className": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
"default": "b-a bg-white table-responsive",
"description": "配置容器 className"
},
"interval": {
"default": 3000,
"description": "当有任务进行中,会每隔一段时间再次检测,而时间间隔就是通过此项配置,默认 3s。",
"type": "number"
},
"items": {
"items": {
"key": {
"description": "任务键值,请唯一区分",
"type": "string"
},
"label": {
"description": "任务名称",
"type": "string"
},
"remark": {
"description": "当前任务状态,支持 html",
"type": "string"
},
"status": {
"description": "任务状态: \n0: 初始状态,不可操作。\n1: 就绪,可操作状态。\n2: 进行中,还没有结束。\n3有错误不可重试。\n4: 已正常结束。\n5有错误且可以重试。",
"enum": [
0,
1,
2,
3,
4,
5
],
"type": "number"
}
},
"type": "array"
},
"name": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/name",
"description": "给当前组件设定一个名,方便其他组件引用。"
},
"operationLabel": {
"default": "操作",
"description": "操作列说明",
"type": "string"
},
"reSubmitApi": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api",
"description": "如果任务失败,且可以重试,提交的时候会使用此 API"
},
"remarkLabel": {
"default": "备注",
"description": "备注列说明",
"type": "string"
},
"retryBtnClassName": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
"default": "btn-sm btn-danger",
"description": "配置容器重试按钮 className"
},
"retryBtnText": {
"default": "重试",
"description": "重试操作按钮文字",
"type": "string"
},
"statusLabel": {
"default": "状态",
"description": "状态列说明",
"type": "string"
},
"statusLabelMap": {
"default": [
"label-warning",
"label-info",
"label-success",
"label-danger",
"label-default",
"label-danger"
],
"description": "状态显示对应的类名配置。",
"type": "array"
},
"statusTextMap": {
"default": [
"未开始",
"就绪",
"进行中",
"出错",
"已完成",
"出错"
],
"description": "状态显示对应的文字显示配置。",
"type": "array"
},
"submitApi": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/api",
"description": "提交任务使用的 API"
},
"tableClassName": {
"$ref": "https://houtai.baidu.com/v2/schemas/page.json#/definitions/className",
"default": "table table-striped m-b-none",
"description": "配置 table className"
},
"taskNameLabel": {
"default": "任务名称",
"description": "任务名称列说明",
"type": "string"
}
}
},
"test": {
"properties": {
"type": {
"const": "tasks"
}
}
}
},
"description": "AMis Tasks 渲染器格式说明。https://baidu.github.io/amis/docs/renderers#tasks",
"type": "object"
}