c1247ecdb49b198e9f9dd06366e4f707e1ccfdea.svn-base 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. package org.jeecg.modules.system.model;
  2. import java.io.Serializable;
  3. import java.util.ArrayList;
  4. import java.util.HashMap;
  5. import java.util.List;
  6. import java.util.Map;
  7. import org.jeecg.modules.system.entity.SysPermission;
  8. /**
  9. * 树形列表用到
  10. */
  11. public class TreeModel implements Serializable {
  12. private static final long serialVersionUID = 4013193970046502756L;
  13. private String key;
  14. private String title;
  15. private String slotTitle;
  16. private boolean isLeaf;
  17. private String icon;
  18. private Integer ruleFlag;
  19. private Map<String,String> scopedSlots;
  20. public Map<String, String> getScopedSlots() {
  21. return scopedSlots;
  22. }
  23. public void setScopedSlots(Map<String, String> scopedSlots) {
  24. this.scopedSlots = scopedSlots;
  25. }
  26. public String getKey() {
  27. return key;
  28. }
  29. public void setKey(String key) {
  30. this.key = key;
  31. }
  32. public String getTitle() {
  33. return title;
  34. }
  35. public void setTitle(String title) {
  36. this.title = title;
  37. }
  38. public boolean getIsLeaf() {
  39. return isLeaf;
  40. }
  41. public void setIsLeaf(boolean isLeaf) {
  42. this.isLeaf = isLeaf;
  43. }
  44. public String getIcon() {
  45. return icon;
  46. }
  47. public void setIcon(String icon) {
  48. this.icon = icon;
  49. }
  50. private List<TreeModel> children;
  51. public List<TreeModel> getChildren() {
  52. return children;
  53. }
  54. public void setChildren(List<TreeModel> children) {
  55. this.children = children;
  56. }
  57. public TreeModel() {
  58. }
  59. public TreeModel(SysPermission permission) {
  60. this.key = permission.getId();
  61. this.icon = permission.getIcon();
  62. this.parentId = permission.getParentId();
  63. this.title = permission.getName();
  64. this.slotTitle = permission.getName();
  65. this.value = permission.getId();
  66. this.isLeaf = permission.isLeaf();
  67. this.label = permission.getName();
  68. if(!permission.isLeaf()) {
  69. this.children = new ArrayList<TreeModel>();
  70. }
  71. }
  72. public TreeModel(String key,String parentId,String slotTitle,Integer ruleFlag,boolean isLeaf) {
  73. this.key = key;
  74. this.parentId = parentId;
  75. this.ruleFlag=ruleFlag;
  76. this.slotTitle = slotTitle;
  77. Map<String,String> map = new HashMap<String,String>();
  78. map.put("title", "hasDatarule");
  79. this.scopedSlots = map;
  80. this.isLeaf = isLeaf;
  81. this.value = key;
  82. if(!isLeaf) {
  83. this.children = new ArrayList<TreeModel>();
  84. }
  85. }
  86. private String parentId;
  87. private String label;
  88. private String value;
  89. public String getParentId() {
  90. return parentId;
  91. }
  92. public void setParentId(String parentId) {
  93. this.parentId = parentId;
  94. }
  95. /**
  96. * @return the label
  97. */
  98. public String getLabel() {
  99. return label;
  100. }
  101. /**
  102. * @param label the label to set
  103. */
  104. public void setLabel(String label) {
  105. this.label = label;
  106. }
  107. /**
  108. * @return the value
  109. */
  110. public String getValue() {
  111. return value;
  112. }
  113. /**
  114. * @param value the value to set
  115. */
  116. public void setValue(String value) {
  117. this.value = value;
  118. }
  119. public String getSlotTitle() {
  120. return slotTitle;
  121. }
  122. public void setSlotTitle(String slotTitle) {
  123. this.slotTitle = slotTitle;
  124. }
  125. public Integer getRuleFlag() {
  126. return ruleFlag;
  127. }
  128. public void setRuleFlag(Integer ruleFlag) {
  129. this.ruleFlag = ruleFlag;
  130. }
  131. }