来源是三条 json,拼一下格式化:
[JavaScript] 纯文本查看 复制代码 {
"source": [
{
"count": 8,
"id": {
"responsibleRegion": "市公司",
"responsibleGrid": "生产室",
"responsibleName": "唐生",
"workType": "核查资源",
"isComplete": false
}
},
{
"count": 7,
"id": {
"responsibleRegion": "茂南 ",
"responsibleGrid": "城东",
"responsibleName": "李生",
"workType": "弱光整治",
"isComplete": false
}
},
{
"count": 16,
"id": {
"responsibleRegion": "高州",
"responsibleGrid": "城西",
"responsibleName": "梁生",
"workType": "弱光整治",
"isComplete": true
}
}
]
}
你要的结果拼一下格式化:
[JavaScript] 纯文本查看 复制代码 {
"result": [
{
"name": "核查资源",
"isComplete": 88,
"notComplete": 66,
"item": [
{
"name": "茂南",
"isComplete": 38,
"notComplete": 36,
"item": [
{
"name": "城东",
"isComplete": 28,
"notComplete": 26,
"item": [
{
"name": "李生",
"isComplete": 8,
"notComplete": 6
}
]
}
]
}
]
}
]
}
就是解析Json取节点再组织json输出的事情 |