Created
October 22, 2016 09:04
-
-
Save xx7y7xx/6638209a33a87535b0637ffd38779071 to your computer and use it in GitHub Desktop.
parse从NC百分百上dump的数据
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//res = {}; | |
var item, area, project, chuchai, | |
areaname, projectname, | |
ret = {}; | |
for ( i in res.data ) { | |
item = res.data[i]; | |
areaname = item.areaname; | |
projectname = item.projectname; | |
if (!ret[areaname]) ret[areaname] = {}; // 创建深圳节点 | |
area = ret[areaname]; | |
if (!area[projectname]) area[projectname] = {}; // 创建项目节点 | |
project = area[projectname]; | |
project["领域"] = item.field; | |
if (!project["出差人员"]) project["出差人员"] = {}; // 创建出差人员节点 | |
chuchai = project["出差人员"]; | |
chuchai[item.creatorname] = item; | |
chuchai[item.solvername] = item; | |
} | |
//目标数据 | |
/* | |
{ | |
"深圳": { | |
"观澜湖(房地产)": { | |
"领域": "房地产", | |
"出差人员": { | |
"马培": {...} | |
} | |
} | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment