Skip to content

Instantly share code, notes, and snippets.

@xx7y7xx
Created October 22, 2016 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xx7y7xx/6638209a33a87535b0637ffd38779071 to your computer and use it in GitHub Desktop.
Save xx7y7xx/6638209a33a87535b0637ffd38779071 to your computer and use it in GitHub Desktop.
parse从NC百分百上dump的数据
//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