//递归方法 生成 json tree 数据 var getJsonTree = function(data, parentId) { var itemArr = []; for (var i = 0; i < data.length; i++) { var node = data[i]; if (node.parentId == parentId) { var newNode = {}; newNode.id = node.id; newNode.name = node.name; newNo