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