文档
测试

通过父层级查询N条

POST
{{host}}/api/task/queryByParentLevel

请求参数

参数名
类型
描述
必填
parent_level_id
int
定时ID
必填

响应参数

参数名
类型
描述
必填
ret
int
返回码:0-正常,非0-失败
必填
msg
string
返回消息
必填
data
array
返回数据
必填
task_id
int
定时ID
必填
task_content
json
层级ID
必填
task_rule
string
自动方案名称
必填
level_id
int
层级ID,默认:0
必填
level_name
string
层级名称
必填
status
enum
0-未启用,1-启用,默认:0
必填
level_id
int
层级ID
必填
level_name
string
层级名称
必填
tasks
array
定时集合
必填
task_id
int
定时ID
必填
task_content
json
层级ID
必填
task_rule
string
自动方案名称
必填
status
enum
0-未启用,1-启用,默认:0
必填

说明 / 示例

###### 示例代码 ```javascript //请求 let res = await post("api/task/queryByParentLevel", { parent_level_id: 166 }) //返回 res = { "ret": 0, "msg": "查询成功", "result": [{ "level_id": 223, "level_name": "进站通道", "tasks": [{ "status": 0, "task_id": 82, "task_rule": "5|0", "task_content": { "url": "/api/device_control/sendCommand", "params": [{ "button_id": 24 }] } }, { "status": 0, "task_id": 83, "task_rule": "5|0", "task_content": { "url": "/api/device_control/sendCommand", "params": [{ "button_id": 24 }] } }, { "status": 1, "task_id": 84, "task_rule": "0|0", "task_content": { "url": "/api/device_control/sendCommand", "params": [{ "button_id": 24 }] } }] }, { "level_id": 173, "level_name": "右侧配电间", "tasks": [{ "status": 1, "task_id": 79, "task_rule": "0|0", "task_content": { "url": "/api/device_control/sendCommand", "params": [{ "button_id": 14 }] } }] }, { "level_id": 169, "level_name": "候车厅", "tasks": [{ "status": 1, "task_id": 93, "task_rule": "13|0", "task_content": { "url": "/api/device_control/sendCommand", "params": [{ "status": 1, "command": "switch", "loop_id": "32", "device_type": "LoopController_6" }, { "status": 1, "command": "switch", "loop_id": "36", "device_type": "LoopController_6" }, { "status": 1, "command": "switch", "loop_id": "31", "device_type": "LoopController_6" }, { "status": 1, "command": "switch", "loop_id": "33", "device_type": "LoopController_6" }] } }, { "status": 1, "task_id": 94, "task_rule": "0|0", "task_content": { "url": "/api/device_control/sendCommand", "params": [{ "button_id": 19 }, { "button_id": 18 }, { "button_id": 30 }] } }] }] } ```