forked from wahello/xproject
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
737 additions
and
150 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
.../main/java/com/certusnet/xproject/admin/support/AdminResourceSimpleTreeNodeConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.certusnet.xproject.admin.support; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.certusnet.xproject.admin.model.AdminResource; | ||
import com.certusnet.xproject.common.support.TreeNodeConverter; | ||
|
||
/** | ||
* 基于ElementUI.Tree组件的资源节点树转换器 | ||
* | ||
* @author pengpeng | ||
* @date 2015年11月15日 下午8:03:51 | ||
* @version 1.0 | ||
*/ | ||
public class AdminResourceSimpleTreeNodeConverter implements TreeNodeConverter<AdminResource, Map<String,Object>> { | ||
|
||
public AdminResourceSimpleTreeNodeConverter() { | ||
super(); | ||
} | ||
|
||
public Map<String, Object> convertTreeNode(AdminResource targetTreeNode) { | ||
Map<String,Object> treeNodeMap = new LinkedHashMap<String,Object>(); | ||
treeNodeMap.put("id", targetTreeNode.getResourceId()); | ||
treeNodeMap.put("label", targetTreeNode.getResourceName()); | ||
treeNodeMap.put("actionType", targetTreeNode.getActionType()); | ||
treeNodeMap.put("resourceType", targetTreeNode.getResourceType()); | ||
return treeNodeMap; | ||
} | ||
|
||
public void setSubTreeNodeList(Map<String, Object> resultTreeNode, List<Map<String, Object>> subTreeNodeList) { | ||
resultTreeNode.put("children", subTreeNodeList); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.