层级树
组件名称:层级树
组件样式:
组件说明: 类似层级和数结构的功能组件。有明确的层级关系,需要通过参数指定层级。 组件支持任意多层级,层级的图片暂时不支持修改,三级和三级以下图标都一样。 组件支持自由拖动位置并保存位置。组件的颜色支持通过自定义修改。
请求方式:POST
https://doc.tingyun.com/sense/example/hierarchytree.json
参数:
字段 | 类型 | 描述 | 是否必选 |
---|---|---|---|
currentTime | Number | 当前时间戳 | 是 |
token | String | 盐值,校验规则为md5(timePeriod+currentTime+ 配置的token), 例如:timePeriod为30,currentTime为 1513137332798,token为abc,则应对 301513137332798abc进行MD5。 |
否 |
timePeriod | Number | 时间范围分钟数 | 是 |
正确响应数据:
字段 | 类型 | 描述 |
---|---|---|
nodes | Array | 节点数组 |
id | string | 唯一的id |
zIndex | number | 层级,值越小层级越高 |
name | string | 节点名称 |
value | string/number | 节点在值,可以是数字或者字符串(如:良好,优秀) |
links | Array | 链接数组 |
source | string | 指向链接的起点的id |
target | String | 指向链接的终点的id |
示例:
{
"nodes": [
{ "id": "a1", "zIndex": 1, "name": "主调中心-南京", "value": 78 },
{ "id": "a2", "zIndex": 1, "name": "主调中心-扬州", "value": 87 },
{ "id": "b1", "zIndex": 2, "name": "扬州汇集中心", "value": 54 },
{ "id": "b2", "zIndex": 2, "name": "淮安汇集中心", "value": 65 },
{ "id": "b3", "zIndex": 2, "name": "宿迁汇聚中心", "value": 57 },
{ "id": "b4", "zIndex": 2, "name": "徐州汇聚中心", "value": 55 },
{ "id": "c1", "zIndex": 3, "name": "扬州分公司", "value": 23 },
{ "id": "c2", "zIndex": 3, "name": "宝应站", "value": 22 },
{ "id": "c3", "zIndex": 3, "name": "金湖站", "value": 25 },
{ "id": "c4", "zIndex": 3, "name": "淮安分公司", "value": 26 },
{ "id": "c5", "zIndex": 3, "name": "淮阴三站", "value": 28 },
{ "id": "c6", "zIndex": 3, "name": "淮安四站", "value": 12 },
{ "id": "c7", "zIndex": 3, "name": "洪泽站", "value": 17 },
{ "id": "c8", "zIndex": 3, "name": "宿迁分公司", "value": 26 },
{ "id": "c9", "zIndex": 3, "name": "刘老涧二站", "value": 34 },
{ "id": "c10", "zIndex": 3, "name": "泗洪站", "value": 38 },
{ "id": "c11", "zIndex": 3, "name": "泗阳站", "value": 23 },
{ "id": "c12", "zIndex": 3, "name": "睢陵二站", "value": 19 },
{ "id": "c13", "zIndex": 3, "name": "皂河二站", "value": 12 },
{ "id": "c14", "zIndex": 3, "name": "徐州分公司", "value": 27 },
{ "id": "c15", "zIndex": 3, "name": "刘山站", "value": 23 },
{ "id": "c16", "zIndex": 3, "name": "邳州站", "value": 22 },
{ "id": "c17", "zIndex": 3, "name": "解台站", "value": 45 },
{ "id": "c18", "zIndex": 3, "name": "蔺家坝站", "value": 21 }
],
"links": [
{ "source": "a1", "target": "a2" },
{ "source": "a1", "target": "b1" },
{ "source": "a1", "target": "b2" },
{ "source": "a1", "target": "b3" },
{ "source": "a1", "target": "b4" },
{ "source": "a2", "target": "b1" },
{ "source": "a2", "target": "b2" },
{ "source": "a2", "target": "b3" },
{ "source": "a2", "target": "b4" },
{ "source": "b1", "target": "c1" },
{ "source": "b1", "target": "c2" },
{ "source": "b1", "target": "c3" },
{ "source": "b2", "target": "c4" },
{ "source": "b2", "target": "c5" },
{ "source": "b2", "target": "c6" },
{ "source": "b2", "target": "c7" },
{ "source": "b3", "target": "c8" },
{ "source": "b3", "target": "c9" },
{ "source": "b3", "target": "c10" },
{ "source": "b3", "target": "c11" },
{ "source": "b3", "target": "c12" },
{ "source": "b3", "target": "c13" },
{ "source": "b4", "target": "c14" },
{ "source": "b4", "target": "c15" },
{ "source": "b4", "target": "c16" },
{ "source": "b4", "target": "c17" },
{ "source": "b4", "target": "c18" }
]
}