LinkDownProperty.java 1.5 KB
Newer Older
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
package org.jeecg.common.util.jsonschema.validate;

import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.util.jsonschema.BaseColumn;
import org.jeecg.common.util.jsonschema.CommonProperty;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 级联下拉
 */
public class LinkDownProperty extends CommonProperty {

    /**
     * 配置信息
     */
    String dictTable;

    /**
     * 级联下拉组件 的其他级联列
     */
    List<BaseColumn> otherColumns;

    public String getDictTable(){
        return this.dictTable;
    }

    public void setDictTable(String dictTable){
        this.dictTable = dictTable;
    }

    public List<BaseColumn> getOtherColumns(){
        return this.otherColumns;
    }

    public void setOtherColumns(List<BaseColumn> otherColumns){
        this.otherColumns = otherColumns;
    }

    public LinkDownProperty() {}

    /**
     *  构造器
     */
    public LinkDownProperty(String key,String title,String dictTable) {
        this.type = "string";
        this.view = "link_down";
        this.key = key;
        this.title = title;
        this.dictTable= dictTable;
    }

    @Override
    public Map<String, Object> getPropertyJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("key", getKey());
        JSONObject prop = getCommonJson();
        JSONObject temp = JSONObject.parseObject(this.dictTable);
        prop.put("config", temp);
        prop.put("others", otherColumns);
        map.put("prop", prop);
        return map;
    }
}