package cn.besteam.modules.system.vo; import cn.besteam.modules.system.entity.SysPermission; import lombok.Data; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 树形列表用到 */ @Data public class TreeModel implements Serializable { private static final long serialVersionUID = 4013193970046502756L; private Integer key; private String title; private String slotTitle; private Boolean isLeaf; private String icon; private Integer ruleFlag; private Map scopedSlots; private List children; private boolean disabled; 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.getIsLeaf(); this.label = permission.getName(); if (!permission.getIsLeaf()) { this.children = new ArrayList(); } if(permission.getId().equals(6)){ this.disabled=true; } } public TreeModel(Integer key, Integer parentId, String slotTitle, Integer ruleFlag, boolean isLeaf) { this.key = key; this.parentId = parentId; this.ruleFlag = ruleFlag; this.title = slotTitle; this.slotTitle = slotTitle; Map map = new HashMap(); map.put("title", "hasDatarule"); this.scopedSlots = map; this.isLeaf = isLeaf; this.value = key; if (!isLeaf) { this.children = new ArrayList(); } if(key.equals(6)){ this.disabled=true; } } private Integer parentId; private String label; private Integer value; }