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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
package com.vci.starter.revision.bo;
 
import com.vci.starter.web.pagemodel.TreeQueryObject;
 
/**
 * 转换为树型数据时的配置信息
 * @author weidy
 * @date 2020/4/22
 */
public class TreeWrapperOptions implements java.io.Serializable{
    /**
     * 请勿修改这个值
     */
    private static final long serialVersionUID = 3183500138266494574L;
 
    /**
     * 显示文本所使用的属性
     */
    private String textFieldName = "name";
 
    /**
     * 多个显示文本的属性时的分隔符(最终显示的值的分隔符)
     */
    private String textValueSep = " ";
 
    /**
     * 上级数据的属性名称
     */
    private String parentFieldName;
 
    /**
     * 主键的属性名称
     */
    private String oidFieldName = "oid";
 
    /**
     * 多个值属性时的分隔符
     */
    private String oidValueSep = ",";
 
    /**
     * 是否查询所有的属性
     */
    private boolean allAttributes = true;
 
    /**
     * 上级的主键的值
     */
    private String parentOid;
 
    /**
     * 是否多选
     */
    private boolean multipleSelect = false;
 
    /**
     * 是否显示复选框
     */
    private boolean showCheckBox = false;
 
    /**
     * 构造函数
     */
    public TreeWrapperOptions(){
    }
 
    /**
     * 常用的构造函数,只设置上级属性的名称
     * @param parentFieldName 上级属性的名称
     */
    public TreeWrapperOptions(String parentFieldName){
        this.parentFieldName = parentFieldName;
    }
 
    /**
     * 常用的构造函数,设置显示text和上级属性的名称
     * @param textFieldName 显示文本属性的名称
     * @param parentFieldName 上级属性的名称
     */
    public TreeWrapperOptions(String textFieldName,String parentFieldName){
        this.textFieldName = textFieldName;
        this.parentFieldName = parentFieldName;
    }
 
    /**
     * 常用的构造函数,设置显示text、上级属性的名称、
     * @param textFieldName 显示文本属性的名称
     * @param parentFieldName 上级属性的名称
     * @param parentOid 上级主键
     */
    public TreeWrapperOptions(String textFieldName,String parentFieldName,String parentOid){
        this.textFieldName = textFieldName;
        this.parentFieldName = parentFieldName;
        this.parentOid = parentOid;
    }
 
    /**
     * 从树形查询对象上拷贝
     * @param treeQueryObject 树形查询对象
     */
    public void copyFromTreeQuery(TreeQueryObject treeQueryObject){
        if(treeQueryObject != null){
            this.parentOid = treeQueryObject.getParentOid();
            this.multipleSelect = treeQueryObject.isMultipleSelect();
            this.showCheckBox = treeQueryObject.isShowCheckBox();
        }
    }
 
    public String getTextFieldName() {
        return textFieldName;
    }
 
    public void setTextFieldName(String textFieldName) {
        this.textFieldName = textFieldName;
    }
 
    public String getParentFieldName() {
        return parentFieldName;
    }
 
    public void setParentFieldName(String parentFieldName) {
        this.parentFieldName = parentFieldName;
    }
 
    public String getOidFieldName() {
        return oidFieldName;
    }
 
    public void setOidFieldName(String oidFieldName) {
        this.oidFieldName = oidFieldName;
    }
 
    public boolean isAllAttributes() {
        return allAttributes;
    }
 
    public void setAllAttributes(boolean allAttributes) {
        this.allAttributes = allAttributes;
    }
 
    public String getParentOid() {
        return parentOid;
    }
 
    public void setParentOid(String parentOid) {
        this.parentOid = parentOid;
    }
 
    public boolean isMultipleSelect() {
        return multipleSelect;
    }
 
    public void setMultipleSelect(boolean multipleSelect) {
        this.multipleSelect = multipleSelect;
    }
 
    public boolean isShowCheckBox() {
        return showCheckBox;
    }
 
    public void setShowCheckBox(boolean showCheckBox) {
        this.showCheckBox = showCheckBox;
    }
 
    public String getTextValueSep() {
        return textValueSep;
    }
 
    public void setTextValueSep(String textValueSep) {
        this.textValueSep = textValueSep;
    }
 
    public String getOidValueSep() {
        return oidValueSep;
    }
 
    public void setOidValueSep(String oidValueSep) {
        this.oidValueSep = oidValueSep;
    }
 
    @Override
    public String toString() {
        return "TreeWrapperOptions{" +
                "textFieldName='" + textFieldName + '\'' +
                ", textValueSep='" + textValueSep + '\'' +
                ", parentFieldName='" + parentFieldName + '\'' +
                ", oidFieldName='" + oidFieldName + '\'' +
                ", oidValueSep='" + oidValueSep + '\'' +
                ", allAttributes=" + allAttributes +
                ", parentOid='" + parentOid + '\'' +
                ", multipleSelect=" + multipleSelect +
                ", showCheckBox=" + showCheckBox +
                '}';
    }
}