cuikaidong
2025-06-12 44e283b774bb1168d0c17dfe5070a1ca8e2274cd
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
package org.jeecg.common.util.jsonschema.validate;
 
import java.util.HashMap;
import java.util.Map;
 
import org.jeecg.common.util.jsonschema.CommonProperty;
 
import com.alibaba.fastjson.JSONObject;
 
/**
 * 字典属性
 * @author 86729
 *
 */
public class TreeSelectProperty extends CommonProperty {
    
    private static final long serialVersionUID = 3786503639885610767L;
    
    private String dict;//表名,文本,id
    private String pidField;//父级字段 默认pid
    private String pidValue;//父级节点的值 暂时没用到 默认为0
    private String hasChildField;
    private String textField;//树形下拉保存text值的字段名
 
    /**
     * 是不是pid 组件 1是 0否
     */
    private Integer pidComponent = 0;
    
    public String getDict() {
        return dict;
    }
 
    public void setDict(String dict) {
        this.dict = dict;
    }
 
    public String getPidField() {
        return pidField;
    }
 
    public void setPidField(String pidField) {
        this.pidField = pidField;
    }
 
    public String getPidValue() {
        return pidValue;
    }
 
    public void setPidValue(String pidValue) {
        this.pidValue = pidValue;
    }
    
    public String getHasChildField() {
        return hasChildField;
    }
 
    public void setHasChildField(String hasChildField) {
        this.hasChildField = hasChildField;
    }
 
    public TreeSelectProperty() {}
 
    public String getTextField() {
        return textField;
    }
 
    public void setTextField(String textField) {
        this.textField = textField;
    }
 
    public Integer getPidComponent() {
        return pidComponent;
    }
 
    public void setPidComponent(Integer pidComponent) {
        this.pidComponent = pidComponent;
    }
 
    /**
     *  构造器 构造普通树形下拉
     */
    public TreeSelectProperty(String key,String title,String dict,String pidField,String pidValue) {
        this.type = "string";
        this.view = "sel_tree";
        this.key = key;
        this.title = title;
        this.dict = dict;
        this.pidField= pidField;
        this.pidValue= pidValue;
    }
 
    /**
     * 分类字典下拉专用
     * @param key
     * @param title
     * @param pidValue
     */
    public TreeSelectProperty(String key,String title,String pidValue) {
        this.type = "string";
        this.view = "cat_tree";
        this.key = key;
        this.title = title;
        this.pidValue = pidValue;
    }
 
    /**
     * 分类字典 支持存储text 下拉专用
     * @param key
     * @param title
     * @param pidValue
     * @param textField
     */
    public TreeSelectProperty(String key,String title,String pidValue,String textField) {
        this(key,title,pidValue);
        this.textField = textField;
    }
    
    @Override
    public Map<String, Object> getPropertyJson() {
        Map<String,Object> map = new HashMap<>();
        map.put("key",getKey());
        JSONObject prop = getCommonJson();
        if(dict!=null) {
            prop.put("dict",dict);
        }
        if(pidField!=null) {
            prop.put("pidField",pidField);
        }
        if(pidValue!=null) {
            prop.put("pidValue",pidValue);
        }
        if(textField!=null) {
            prop.put("textField",textField);
        }
        if(hasChildField!=null) {
            prop.put("hasChildField",hasChildField);
        }
        if(pidComponent!=null) {
            prop.put("pidComponent",pidComponent);
        }
        map.put("prop",prop);
        return map;
    }
 
}