为了账号安全,请及时绑定邮箱和手机立即绑定

有大佬遇到过这个问题吗:平级转树结构谢谢哈~

有大佬遇到过这个问题吗:平级转树结构谢谢哈~

一只斗牛犬 2019-12-11 12:09:29
vardata={"organization":[{"id":"1","pid":"0","organization":"/A"},{"id":"2","pid":"0","organization":"/AA"},{"id":"11","pid":"1","organization":"/A/B"},{"id":"22","pid":"2","organization":"/AA/BB"},{"id":"44","pid":"2","organization":"/AA/CC"}],"user":[{"id":"xxxx","pid":"2","email":"yu@test.com","organization":"/A","display_name":"玉"},{"id":"yyy","pid":"2","email":"yy@test.com","organization":"/A/B","display_name":"哈"},{"id":"zzzz","pid":"22","email":"nn@test.com","organization":"/AA/BB","display_name":"欧式"},{"id":"hhhh","pid":"44","email":"yfef@test.com","organization":"/AA/CC","display_name":"红"},{"id":"effef","pid":"44","email":"yfesf@test.com","organization":"/AA/CC","display_name":"xe"}]}如果是organization数组中的话title字段显示组织,如果是user数组中的话title字段显示email如何把以上结构转成树结构?
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 244 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信