const obj = {
"name": "高德大云图业务中心",
"id": "amap_yuntu_crm_admin",
"type": "department",
"children": [{
"name": "云图测试组",
"id": "amap_yuntu_crm_yuntu_crm_pre_test",
"type": "department",
"children": [{
"id": "267154",
"name": "权甜甜(甜仙)",
"type": "staff",
"department": "云图测试组"
},
{
"id": "176870",
"name": "孔蕙心(绿蕙)",
"type": "staff",
"department": "云图测试组"
},
{
"id": "WB01056747",
"name": "张志贺(WB01056747)",
"type": "staff",
"department": "云图测试组"
},
{
"name": "刘康宁(康寜)",
"id": "091274",
"type": "staff",
"department": "云图测试组"
},
{
"name": "傅x达(游x)",
"id": "312726",
"type": "staff",
"department": "云图测试组"
}
],
"leader": "241194",
"leaders": [
"176870",
"091274",
"312726"
],
"department": "高德大云图业务中心"
},
{
"name": "高德云图商务组",
"id": "amap_yuntu_crm_yuntu_crm_business",
"type": "department",
"children": [{
"name": "董振宁(091546)",
"id": "091546",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "李彬(醒神)",
"id": "068784",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "刘浩(刘昊)",
"id": "091511",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "王永翔(永翔)",
"id": "091623",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "王富(守悦)",
"id": "092357",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "保萌萌(灵主)",
"id": "092746",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "米磊(墨荀)",
"id": "105210",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "杨刚(澄朗)",
"id": "151257",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "韩鹏(菩醍)",
"id": "160256",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "徐欣(窈窈)",
"id": "169155",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "高扬(还真)",
"id": "207610",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "杨林(阿林)",
"id": "223954",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "代萌萌(梓熙)",
"id": "228228",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "沙无影(沙橘)",
"id": "301224",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "300326",
"name": "李文(曲星)",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "王路扬(凡远)",
"id": "275680",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "093154",
"name": "索晨曦(天格)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "WB550564",
"name": "施鳕轩(WB550564)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "266194",
"name": "徐骥(虚济)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "089654",
"name": "梁子雅(089654)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "138992",
"name": "刘月阳(翎汐)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "055797",
"name": "孙文芳(紫缃)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "092464",
"name": "孙雪莲(远清)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "214657",
"name": "肖阳(惟妙)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "199629",
"name": "赵丽(美意)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "297423",
"name": "孙成文(默润)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "322157",
"name": "陈云(羊措)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "337999",
"name": "王春盛(辞中)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "239047",
"name": "陈志伟(智纬)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "323052",
"name": "杨易(曼陀)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "179003",
"name": "胡才益(禾季)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "092784",
"name": "杨颢(鹓雏)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "WB01143517",
"name": "张未(WB01143517)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "092004",
"name": "张青芳(佛玲)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "346649",
"name": "佟捷然(赫涟)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "274759",
"name": "叶妍伶(彩蛋)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "246749",
"name": "雷宇(246749)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "090071",
"name": "任越(祾钊)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "WB01083428",
"name": "岳鹏(WB01083428)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "291929",
"name": "林云青(青工)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "257828",
"name": "王政杰(元朕)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "120354",
"name": "夏同洋(刃天)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "161174",
"name": "毕超凡(凡笔)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "204030",
"name": "陶荟竹(桃气)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "090637",
"name": "金鑫(两金)",
"type": "staff",
"department": "高德云图商务组"
},
{
"id": "155183",
"name": "赵紫妤(愿海)",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "物流",
"id": "logistics",
"type": "department",
"children": [{
"name": "张琳(162236)",
"id": "162236",
"type": "staff",
"department": "物流"
},
{
"id": "317313",
"name": "陈建国(通川)",
"type": "staff",
"department": "物流"
},
{
"id": "345973",
"name": "杨欢(优仔)",
"type": "staff",
"department": "物流"
},
{
"id": "359186",
"name": "赵岩(福凡)",
"type": "staff",
"department": "物流"
},
{
"id": "118876",
"name": "邹云峰(肘子)",
"type": "staff",
"department": "物流"
},
{
"name": "物流渠道",
"id": "qudao_wuliu",
"type": "department",
"children": [{
"name": "星希尔-物流",
"id": "xingxier_wuliu",
"type": "department",
"children": [{
"id": "176860",
"name": "王怡(兰也)",
"type": "staff",
"department": "星希尔-物流"
}],
"leaders": [
"176860"
],
"department": "物流渠道"
},
{
"name": "祥亚淳嘉-物流",
"id": "xiangyachunjia_wuliu",
"type": "department",
"children": [],
"department": "物流渠道"
},
{
"name": "铂悦云图-物流",
"id": "boyueyuntu_wuliu",
"type": "department",
"children": [{
"name": "张章(璋璋)",
"id": "150844",
"type": "staff",
"department": "铂悦云图-物流"
}],
"leaders": [],
"department": "物流渠道"
},
{
"name": "红石榴_物流",
"id": "hongshiliu_wuliu",
"type": "department",
"children": [],
"department": "物流渠道"
},
{
"name": "美奥_物流",
"id": "meiao_wuliu",
"type": "department",
"children": [{
"name": "付x(WB01326775)",
"id": "WB01326775",
"type": "staff",
"department": "美奥_物流"
}],
"department": "物流渠道"
}
],
"department": "物流"
},
{
"id": "WB01029185",
"name": "倪雪萍(WB01029185)",
"type": "staff",
"department": "物流"
}
],
"leaders": [
"162236"
],
"department": "高德云图商务组"
},
{
"name": "交通",
"id": "smart_transportation",
"type": "department",
"children": [{
"name": "吴泽驹(吴支)",
"id": "130165",
"type": "staff",
"department": "交通"
},
{
"name": "毛中威(爻钱)",
"id": "192839",
"type": "staff",
"department": "交通"
},
{
"name": "基础地图",
"id": "base_map",
"type": "department",
"children": [],
"department": "交通"
},
{
"name": "智慧高速",
"id": "wisdom_high_speed",
"type": "department",
"children": [],
"department": "交通"
},
{
"name": "王旭(莃望)",
"id": "091930",
"type": "staff",
"department": "交通"
},
{
"id": "091735",
"name": "郭成坤(成坤)",
"type": "staff",
"department": "交通"
},
{
"id": "151836",
"name": "李新辉(信懳)",
"type": "staff",
"department": "交通"
},
{
"id": "091563",
"name": "赵琳(璟玟)",
"type": "staff",
"department": "交通"
},
{
"id": "091695",
"name": "房一多(赛问)",
"type": "staff",
"department": "交通"
},
{
"id": "091523",
"name": "贺希凡(莃饭)",
"type": "staff",
"department": "交通"
},
{
"id": "289435",
"name": "张风坤(哇牛)",
"type": "staff",
"department": "交通"
},
{
"id": "253123",
"name": "孙峰(诏齐)",
"type": "staff",
"department": "交通"
},
{
"id": "154713",
"name": "许健(善通)",
"type": "staff",
"department": "交通"
},
{
"id": "196345",
"name": "姜涵(谨力)",
"type": "staff",
"department": "交通"
},
{
"id": "134969",
"name": "何鑫(134969)",
"type": "staff",
"department": "交通"
},
{
"name": "城市大脑",
"id": "data_chassis",
"type": "department",
"department": "交通"
},
{
"name": "评诊治",
"id": "governance",
"type": "department",
"department": "交通"
},
{
"id": "318953",
"name": "王昊(祥松)",
"type": "staff",
"department": "交通"
},
{
"id": "324057",
"name": "杨奔程(晟泓)",
"type": "staff",
"department": "交通"
},
{
"name": "iOT渠道业务人员",
"id": "iot",
"type": "department",
"children": [{
"name": "王东广(白局)",
"id": "025417",
"type": "staff",
"department": "iOT渠道业务人员"
},
{
"name": "赵骐(齐客)",
"id": "288656",
"type": "staff",
"department": "iOT渠道业务人员"
},
{
"name": "沃弗格团队",
"id": "wofuge",
"type": "department",
"children": [{
"name": "徐申升(WB828561)",
"id": "WB828561",
"type": "staff",
"department": "沃弗格团队"
},
{
"id": "WB288472",
"name": "叶文斌(WB288472)",
"type": "staff",
"department": "沃弗格团队"
},
{
"id": "WB01185820",
"name": "陈啸(WB01185820)",
"type": "staff",
"department": "沃弗格团队"
}
],
"leaders": [
"WB828561",
"WB288472"
],
"department": "iOT渠道业务人员"
},
{
"name": "常识(八仙)",
"id": "290647",
"type": "staff",
"department": "iOT渠道业务人员"
},
{
"name": "史辉(092401)",
"id": "092401",
"type": "staff",
"department": "iOT渠道业务人员"
},
{
"name": "潘莉(091664)",
"id": "091664",
"type": "staff",
"department": "iOT渠道业务人员"
},
{
"name": "黄鑫(WB895174)",
"id": "WB895174",
"type": "staff",
"department": "iOT渠道业务人员"
},
{
"name": "德高国成-iot",
"id": "degaoguocheng",
"type": "department",
"children": [],
"leaders": [],
"department": "iOT渠道业务人员"
},
{
"name": "北京竹迈",
"id": "zhumai",
"type": "department",
"children": [{
"name": "朱海飞(WB828556)",
"id": "WB828556",
"type": "staff",
"department": "北京竹迈"
},
{
"id": "WB01310014",
"name": "马跃(WB01310014)",
"type": "staff",
"department": "北京竹迈"
},
{
"id": "WB01310015",
"name": "刘荷艳(WB01310015)",
"type": "staff",
"department": "北京竹迈"
}
],
"leaders": [
"WB828556"
],
"department": "iOT渠道业务人员"
},
{
"name": "重庆一苇以航",
"id": "yiweiyihang",
"type": "department",
"children": [{
"id": "WB01286960",
"name": "徐一航(WB01286960)",
"type": "staff",
"department": "重庆一苇以航"
},
{
"id": "WB01286961",
"name": "李琮(WB01286961)",
"type": "staff",
"department": "重庆一苇以航"
}
],
"leaders": [
"WB01286960"
],
"department": "iOT渠道业务人员"
},
{
"id": "WB661054",
"name": "韩国林(WB661054)",
"type": "staff",
"department": "iOT渠道业务人员"
},
{
"id": "WB01294739",
"name": "栾涛(WB01294739)",
"type": "staff",
"department": "iOT渠道业务人员"
}
],
"leader": "025417",
"leaders": [
"025417",
"288656",
"290647",
"092401",
"091664",
"WB661054",
"WB01294739"
],
"department": "交通"
},
{
"name": "高精地图",
"id": "high_precision_map",
"type": "department",
"department": "交通"
},
{
"id": "091708",
"name": "王宇静(静莫)",
"type": "staff",
"department": "交通"
},
{
"id": "347098",
"name": "李博新(透平)",
"type": "staff",
"department": "交通"
},
{
"name": "公路数字化资产",
"id": "gonglu_shuzi",
"type": "department",
"department": "交通"
},
{
"name": "IOT 服务",
"id": "iot_service",
"type": "department",
"department": "交通"
},
{
"name": "IOT硬件",
"id": "internet_of_things",
"type": "department",
"department": "交通"
},
{
"id": "WB01105792",
"name": "王红军(WB01105792)",
"type": "staff",
"department": "交通"
},
{
"name": "刘叶维(雨久)",
"id": "091853",
"type": "staff",
"department": "交通"
},
{
"name": " 智慧巡检",
"id": "smart_inspection",
"type": "department",
"department": "交通"
}
],
"leaders": [
"130165",
"091930",
"091563",
"151836",
"091735",
"196345",
"154713",
"289435",
"091523",
"091695",
"091708",
"091853"
],
"department": "高德云图商务组"
},
{
"id": "365792",
"name": "梁艳(面仔)",
"type": "staff",
"department": "高德云图商务组"
},
{
"name": "国网",
"id": "sgcc",
"type": "department",
"children": [{
"name": "李瑞(神识)",
"id": "091125",
"type": "staff",
"department": "国网"
}],
"department": "高德云图商务组"
},
{
"name": "测试小组1",
"id": "test_crm_test_1",
"type": "department",
"children": [{
"id": "319420",
"name": "李楠(木杳)",
"type": "staff",
"department": "测试小组1"
},
{
"name": "张宾(WB800860)",
"id": "WB800860",
"type": "staff",
"department": "测试小组1"
}
],
"leaders": [],
"department": "高德云图商务组"
},
{
"name": "开平通用行业",
"id": "open_platform",
"type": "department",
"children": [{
"name": "基础LBS",
"id": "basic_lbs",
"type": "department",
"children": [],
"leaders": [],
"department": "开平通用行业"
},
{
"name": "海外LBS",
"id": "overseas",
"type": "department",
"children": [],
"department": "开平通用行业"
},
{
"name": "孙超(紫檀)",
"id": "204810",
"type": "staff",
"department": "开平通用行业"
},
{
"name": "董佳玉(能兜)",
"id": "274447",
"type": "staff",
"department": "开平通用行业"
},
{
"name": "开放平台及渠道",
"id": "channel_business",
"type": "department",
"children": [{
"name": "陈明东(时谦)",
"id": "138622",
"type": "staff",
"department": "开放平台及渠道"
},
{
"name": "刘思安(WB663748)",
"id": "WB663748",
"type": "staff",
"department": "开放平台及渠道"
},
{
"id": "WB504609",
"name": "李冉冉(WB504609)",
"type": "staff",
"department": "开放平台及渠道"
},
{
"name": "开平及华东渠道",
"id": "huadong",
"type": "department",
"children": [{
"name": "陈龙(修罗)",
"id": "203186",
"type": "staff",
"department": "开平及华东渠道"
},
{
"name": "星希尔",
"id": "huadong2",
"type": "department",
"children": [{
"id": "WB966441",
"name": "王利城(WB966441)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB966442",
"name": "万恋恋(WB966442)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB966443",
"name": "郑杰(WB966443)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB966444",
"name": "李斌(WB966444)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB966445",
"name": "杜鑫(WB966445)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB966446",
"name": "康乐乐(WB966446)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB01057237",
"name": "都玉鑫(WB01057237)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB01057238",
"name": "刘百鸣(WB01057238)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB01053580",
"name": "陈飞(WB01053580)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB01078178",
"name": "李静(WB01078178)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB01078179",
"name": "翟伟婷(WB01078179)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB01086935",
"name": "陈达(WB01086935)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB01086934",
"name": "包志新(WB01086934)",
"type": "staff",
"department": "星希尔"
},
{
"id": "WB01086933",
"name": "宋志斌(WB01086933)",
"type": "staff",
"department": "星希尔"
},
{
"name": "付雯(WB01248646)",
"id": "WB01248646",
"type": "staff",
"department": "星希尔"
},
{
"name": "蒋章产(WB01266678)",
"id": "WB01266678",
"type": "staff",
"department": "星希尔"
}
],
"leaders": [
"WB966446"
],
"department": "开平及华东渠道"
},
{
"name": "祥亚淳嘉",
"id": "huadong1",
"type": "department",
"children": [{
"id": "WB966433",
"name": "姚佳安(WB966433)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB966434",
"name": "吴欣珏(WB966434)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB966435",
"name": "赵婷(WB966435)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB966436",
"name": "高顺喆(WB966436)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01014451",
"name": "华俊(WB01014451)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"name": "施达炜(WB01014450)",
"id": "WB01014450",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01048847",
"name": "常雨晴(WB01048847)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01048849",
"name": "刘阿凤(WB01048849)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01048848",
"name": "宋朋(WB01048848)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01073349",
"name": "毛慧敏(WB01073349)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01073350",
"name": "韩芬(WB01073350)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01086931",
"name": "孙丽彤(WB01086931)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"name": "蒋明珠(WB01115469)",
"id": "WB01115469",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"name": "王银鹤(WB01115470)",
"id": "WB01115470",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01132973",
"name": "宋晓晓(WB01132973)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01132974",
"name": "施挺(WB01132974)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"name": "陈磊(WB01159200)",
"id": "WB01159200",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01232602",
"name": "肖雨(WB01232602)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"id": "WB01232603",
"name": "黄维建(WB01232603)",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"name": "柯沁园(WB01286636)",
"id": "WB01286636",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"name": "雷玉廷(WB01286637)",
"id": "WB01286637",
"type": "staff",
"department": "祥亚淳嘉"
},
{
"name": "童天浩(WB01307416)",
"id": "WB01307416",
"type": "staff",
"department": "祥亚淳嘉"
}
],
"leaders": [
"WB966433",
"WB966434"
],
"department": "开平及华东渠道"
}
],
"leaders": [
"203186"
],
"department": "开放平台及渠道"
},
{
"name": "开平及华北渠道",
"id": "huabei",
"type": "department",
"children": [{
"name": "红石榴",
"id": "huabei1",
"type": "department",
"children": [{
"name": "梁洪彬(WB895171)",
"id": "WB895171",
"type": "staff",
"department": "红石榴"
},
{
"name": "周思博(WB895172)",
"id": "WB895172",
"type": "staff",
"department": "红石榴"
},
{
"name": "李瀚林(WB895173)",
"id": "WB895173",
"type": "staff",
"department": "红石榴"
},
{
"name": "邱诗娣(WB895175)",
"id": "WB895175",
"type": "staff",
"department": "红石榴"
},
{
"name": "张丽丽(WB895177)",
"id": "WB895177",
"type": "staff",
"department": "红石榴"
},
{
"name": "柴树伟(WB895179)",
"id": "WB895179",
"type": "staff",
"department": "红石榴"
},
{
"name": "张永涛(WB895181)",
"id": "WB895181",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB493244",
"name": "杨志明(WB493244)",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB535411",
"name": "段昊源(WB535411)",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB01052094",
"name": "汪姗姗(WB01052094)",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB01057257",
"name": "李健(WB01057257)",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB01057256",
"name": "黄洁(WB01057256)",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB01084451",
"name": "李明升(WB01084451)",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB01098635",
"name": "邰瑞雪(WB01098635)",
"type": "staff",
"department": "红石榴"
},
{
"name": "刘世超(WB01185824)",
"id": "WB01185824",
"type": "staff",
"department": "红石榴"
},
{
"name": "敖然(WB01239367)",
"id": "WB01239367",
"type": "staff",
"department": "红石榴"
},
{
"name": "尚亚朋(WB01239368)",
"id": "WB01239368",
"type": "staff",
"department": "红石榴"
},
{
"name": "陈帅(WB01239366)",
"id": "WB01239366",
"type": "staff",
"department": "红石榴"
},
{
"name": "侯志佳(WB01266675)",
"id": "WB01266675",
"type": "staff",
"department": "红石榴"
},
{
"name": "周玲(WB01266676)",
"id": "WB01266676",
"type": "staff",
"department": "红石榴"
},
{
"name": "刘国栋(WB01275072)",
"id": "WB01275072",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB01307414",
"name": "王迎春(WB01307414)",
"type": "staff",
"department": "红石榴"
},
{
"id": "WB01315618",
"name": "路健健(WB01315618)",
"type": "staff",
"department": "红石榴"
}
],
"leaders": [
"WB895171",
"WB895173"
],
"department": "开平及华北渠道"
},
{
"id": "163518",
"name": "刘硕(悦葵)",
"type": "staff",
"department": "开平及华北渠道"
},
{
"name": "德高国成-开平",
"id": "degaoguochengkaiping",
"type": "department",
"children": [],
"department": "开平及华北渠道"
}
],
"leaders": [
"163518"
],
"department": "开放平台及渠道"
},
{
"name": "开平及华南渠道",
"id": "huanan",
"type": "department",
"children": [{
"name": "美奥",
"id": "huanan1",
"type": "department",
"children": [{
"name": "黄敏(WB229717)",
"id": "WB229717",
"type": "staff",
"department": "美奥"
},
{
"name": "卢爽(WB247496)",
"id": "WB247496",
"type": "staff",
"department": "美奥"
},
{
"name": "黄佳欣(WB01096651)",
"id": "WB01096651",
"type": "staff",
"department": "美奥"
},
{
"name": "李雪峰(WB263036)",
"id": "WB263036",
"type": "staff",
"department": "美奥"
},
{
"id": "WB01104925",
"name": "夏晓兰(WB01104925)",
"type": "staff",
"department": "美奥"
},
{
"id": "WB01104924",
"name": "万玉莹(WB01104924)",
"type": "staff",
"department": "美奥"
},
{
"id": "WB01113281",
"name": "孙锋(WB01113281)",
"type": "staff",
"department": "美奥"
},
{
"id": "WB01113280",
"name": "田宇(WB01113280)",
"type": "staff",
"department": "美奥"
},
{
"id": "WB816159",
"name": "范广吉(WB816159)",
"type": "staff",
"department": "美奥"
},
{
"name": "陈超(WB01172428)",
"id": "WB01172428",
"type": "staff",
"department": "美奥"
},
{
"name": "刘辉(WB01246517)",
"id": "WB01246517",
"type": "staff",
"department": "美奥"
},
{
"id": "WB01246518",
"name": "阳小涛(WB01246518)",
"type": "staff",
"department": "美奥"
},
{
"id": "WB01255484",
"name": "高艳(WB01255484)",
"type": "staff",
"department": "美奥"
},
{
"id": "WB01293215",
"name": "李才蓉(WB01293215)",
"type": "staff",
"department": "美奥"
}
],
"leaders": [
"WB229717",
"WB247496"
],
"department": "开平及华南渠道"
},
{
"name": "铂悦",
"id": "huanan2",
"type": "department",
"children": [{
"name": "王泽雄(WB451492)",
"id": "WB451492",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB558541",
"name": "黄桂莹(WB558541)",
"type": "staff",
"department": "铂悦"
},
{
"name": "李广野(WB01119463)",
"id": "WB01119463",
"type": "staff",
"department": "铂悦"
},
{
"name": "张锐涛(WB01119464)",
"id": "WB01119464",
"type": "staff",
"department": "铂悦"
},
{
"name": "陈志祥(WB01119465)",
"id": "WB01119465",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB038138",
"name": "高建平(WB038138)",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB530379",
"name": "江丽萍(WB530379)",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB294318",
"name": "郭少鸿(WB294318)",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB01122789",
"name": "谢文雄(WB01122789)",
"type": "staff",
"department": "铂悦"
},
{
"name": "肖微微(WB448883)",
"id": "WB448883",
"type": "staff",
"department": "铂悦"
},
{
"name": "许基雨(WB01130976)",
"id": "WB01130976",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB01130977",
"name": "刘龙有(WB01130977)",
"type": "staff",
"department": "铂悦"
},
{
"name": "刘鑫君(WB01130978)",
"id": "WB01130978",
"type": "staff",
"department": "铂悦"
},
{
"name": "帅丽琴(WB01140428)",
"id": "WB01140428",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB572708",
"name": "方子铭(WB572708)",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB01232605",
"name": "胡春明(WB01232605)",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB504013",
"name": "邹建(WB504013)",
"type": "staff",
"department": "铂悦"
},
{
"name": "陈加(WB01232604)",
"id": "WB01232604",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB01262282",
"name": "万红琴(WB01262282)",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB520913",
"name": "马延(WB520913)",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB01281906",
"name": "吴婉婷(WB01281906)",
"type": "staff",
"department": "铂悦"
},
{
"id": "WB01292210",
"name": "陈国伟(WB01292210)",
"type": "staff",
"department": "铂悦"
}
],
"leaders": [
"WB451492",
"WB038138"
],
"department": "开平及华南渠道"
},
{
"name": "张博楠(奕睿)",
"id": "105581",
"type": "staff",
"department": "开平及华南渠道"
}
],
"leaders": [
"105581"
],
"department": "开放平台及渠道"
},
{
"name": "开平及华西渠道",
"id": "huaxi",
"type": "department",
"children": [{
"name": "图强行远",
"id": "huaxi1",
"type": "department",
"children": [{
"name": "侯汉林(WB01098628)",
"id": "WB01098628",
"type": "staff",
"department": "图强行远"
},
{
"name": "鲁秋(WB01098627)",
"id": "WB01098627",
"type": "staff",
"department": "图强行远"
},
{
"name": "章婉嫣(WB01098629)",
"id": "WB01098629",
"type": "staff",
"department": "图强行远"
},
{
"name": "韦东(WB01046374)",
"id": "WB01046374",
"type": "staff",
"department": "图强行远"
},
{
"name": "方庆(WB01098630)",
"id": "WB01098630",
"type": "staff",
"department": "图强行远"
},
{
"name": "朱奕(WB01098626)",
"id": "WB01098626",
"type": "staff",
"department": "图强行远"
},
{
"id": "WB01298225",
"name": "晏茂(WB01298225)",
"type": "staff",
"department": "图强行远"
},
{
"id": "WB01298226",
"name": "袁若兰(WB01298226)",
"type": "staff",
"department": "图强行远"
},
{
"id": "WB01308336",
"name": "雷俊杰(WB01308336)",
"type": "staff",
"department": "图强行远"
}
],
"leaders": [
"WB01046374",
"WB01098626"
],
"department": "开平及华西渠道"
},
{
"id": "091758",
"name": "方婧怡(091758)",
"type": "staff",
"department": "开平及华西渠道"
}
],
"leaders": [
"091758"
],
"department": "开放平台及渠道"
}
],
"leader": "163518",
"leaders": [
"WB663748",
"WB504609"
],
"department": "开平通用行业"
},
{
"name": "网约车",
"id": "mobility",
"type": "department",
"children": [],
"department": "开平通用行业"
},
{
"name": "侯颖(181127)",
"id": "181127",
"type": "staff",
"department": "开平通用行业"
}
],
"leader": "204810",
"leaders": [
"204810"
],
"department": "高德云图商务组"
},
{
"name": "能源&央企",
"id": "energy",
"type": "department",
"children": [{
"name": "石油石化",
"id": "oil",
"type": "department",
"children": [],
"department": "能源&央企"
},
{
"id": "282166",
"name": "张英伦(282166)",
"type": "staff",
"department": "能源&央企"
}
],
"leaders": [
"282166"
],
"department": "高德云图商务组"
},
{
"name": "征信",
"id": "industry",
"type": "department",
"children": [{
"name": "金融",
"id": "financial",
"type": "department",
"department": "征信"
},
{
"name": "企业地图",
"id": "me",
"type": "department",
"department": "征信"
},
{
"name": "白晨(云赐)",
"id": "167508",
"type": "staff",
"department": "征信"
},
{
"name": "吴婧雯(170270)",
"id": "170270",
"type": "staff",
"department": "征信"
},
{
"name": "马震(钧天)",
"id": "177483",
"type": "staff",
"department": "征信"
},
{
"name": "刘晓敏(毓贞)",
"id": "178726",
"type": "staff",
"department": "征信"
},
{
"name": "张凡(梵夫)",
"id": "204524",
"type": "staff",
"department": "征信"
},
{
"name": "商业智能",
"id": "business_Intelligence",
"type": "department",
"department": "征信"
},
{
"id": "158173",
"name": "杨薇(芊岱)",
"type": "staff",
"department": "征信"
},
{
"id": "313979",
"name": "孙国敬(臣进)",
"type": "staff",
"department": "征信"
},
{
"id": "132685",
"name": "白艳杰(从榕)",
"type": "staff",
"department": "征信"
},
{
"id": "313329",
"name": "沈喆(尘鑫)",
"type": "staff",
"department": "征信"
}
],
"leader": "167508",
"leaders": [
"167508",
"158173"
],
"department": "高德云图商务组"
},
{
"name": "S级项目",
"id": "s_class",
"type": "department",
"children": [{
"id": "352589",
"name": "武莹(万夕)",
"type": "staff",
"department": "S级项目"
}],
"department": "高德云图商务组"
},
{
"name": "新零售",
"id": "new_retail",
"type": "department",
"department": "高德云图商务组"
},
{
"name": "IOT",
"id": "iot_business",
"type": "department",
"department": "高德云图商务组"
}
],
"leaders": [
"300326",
"223954",
"275680",
"274759",
"246749",
"266194",
"120354",
"068784",
"090637",
"257828"
],
"department": "高德大云图业务中心"
},
{
"id": "206864",
"name": "齐俊鑫(伊一)",
"type": "staff",
"department": "高德大云图业务中心"
},
{
"name": "无测试数据组",
"id": "amap_yuntu_crm_noTestdata",
"type": "department",
"department": "高德大云图业务中心"
},
{
"id": "359807",
"name": "赵宁(宁娃)",
"type": "staff",
"department": "高德大云图业务中心"
},
{
"name": "商务组",
"id": "amap_yuntu_crm_business222",
"type": "department",
"department": "高德大云图业务中心"
},
{
"name": "云图商务组",
"id": "amap_yuntu_crm_business",
"type": "department",
"department": "高德大云图业务中心"
},
{
"name": "三方平台支持专用",
"id": "amap_yuntu_crm_third_pirty_support",
"type": "department",
"department": "高德大云图业务中心"
},
{
"name": "高德云图CRM测试组",
"id": "amap_yuntu_crm_test",
"type": "department",
"children": [{
"name": "赵x豪(WB01270871)",
"id": "WB01270871",
"type": "staff",
"department": "高德云图CRM测试组"
},
{
"name": "焦x杰(WB01312951)",
"id": "WB01312951",
"type": "staff",
"department": "高德云图CRM测试组"
},
{
"id": "WB572233",
"name": "王媛媛(WB572233)",
"type": "staff",
"department": "高德云图CRM测试组"
},
{
"name": "张建宏(宏米)",
"id": "090846",
"type": "staff",
"department": "高德云图CRM测试组"
},
{
"id": "WB01358174",
"name": "马x宁(WB01358174)",
"type": "staff",
"department": "高德云图CRM测试组"
},
{
"id": "241194",
"name": "康恺(慷恺)",
"type": "staff",
"department": "高德云图CRM测试组"
},
{
"id": "WB01425701",
"name": "王x辉(WB01425701)",
"type": "staff",
"department": "高德云图CRM测试组"
}
],
"leaders": [
"090846",
"241194",
"WB01358174"
],
"department": "高德大云图业务中心"
},
{
"name": "李楠前端测试临时组",
"id": "ln_test",
"dep_attr": "产品线",
"dep_type": "自营",
"type": "department",
"dep_financial_prod": "logistics",
"children": [{
"name": "郝浩(浩之)",
"id": "090962",
"job": "测试",
"dep_belong": "商务",
"person_perf": "true",
"sale_process": "false",
"person_attr": "自营",
"person_status": "在职",
"type": "staff",
"department": "李楠前端测试临时组"
},
{
"name": "赵虹(码媛)",
"id": "090964",
"job": "商务",
"dep_belong": "商务",
"person_perf": "true",
"sale_process": "true",
"person_attr": "自营",
"person_status": "在职",
"type": "staff",
"department": "李楠前端测试临时组"
}
],
"leaders": [],
"department": "高德大云图业务中心"
}
],
"leader": "176860",
"leaders": []
}
const getStaff = (obj) => {
const pathStaff = {}
let path = []
const getPathArray = (obj) => {
if (obj?.children?.length) {
path.push(obj.id)
let i = 0
const key = path.join('/')
pathStaff[key] = []
obj.children.forEach(item => {
i++
item.type === "staff" && pathStaff[key].push(item)
item?.children?.length && getPathArray(item)
if (i === obj.children.length) {
path.pop()
}
})
}
}
getPathArray(obj)
const result = {}
const pathArrayAllStaff = {}
Object.keys(pathStaff).forEach(key => {
pathArrayAllStaff[key] = []
Object.keys(pathStaff).forEach(key2 => {
if (key2.includes(key)) {
pathArrayAllStaff[key] = pathArrayAllStaff[key].concat(pathStaff[key2])
}
})
const keyArray = key.split('/')
const lastKey = keyArray[keyArray.length - 1]
result[lastKey] = pathArrayAllStaff[key]
})
return result
}
console.time()
console.log(getStaff(obj))
console.timeEnd()
console