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如何把以上结构转成树结构?
添加回答
举报
0/150
提交
取消