jquery easyui 后台(strust2)如何一次性将整个树结构数据转换成JSON格式

数据库查询出的数据如下,其中LEVEL代表树结点级数,RELATION_TREE为树的结构结构。主要看父节点PARENT和节点ID。
LEVEL RELATION_TREE            PARENT              ID
1            t_000011                                     t_000011                           t_000011
1            t_010000                                     t_010000                           t_010000
2            ---t_091001                                 t_010000                           t_091001
3            ------t_091002                              t_091001                           t_091002
2            ---t_010003                                  t_010000                           t_010003
2            ---t_010001                                  t_010000                           t_010001
2            ---t_010002                                  t_010000                           t_010002
3            ------t_011002                              t_010002                           t_011002
3            ------t_011001                              t_010002                           t_011001
4            ---------t_011003                           t_011001                           t_011003
1            t_020000                                      t_020000                           t_020000
1            t_030000                                      t_030000                           t_030000
2            ---t_030001                                  t_030000                           t_030001
2            ---t_030002                                  t_030000                           t_030002
1            t_050000                                      t_050000                           t_050000
2            ---t_000001                                  t_050000                           t_000001
2            ---t_000002                                  t_050000                           t_000002
                                                                                                  

你可能感兴趣的:(jquery,json,easyui,struts2)