using Model; using Newtonsoft.Json; namespace Vo { /// /// Treeselect树结构实体类 /// public class TreeSelectVo { /// /// 节点Id /// public long Id { get; set; } /// /// 节点名称 /// public string Name { get; set; } public long ParentId { get; set; } public string MenuType { get; set; } public string Path { get; set; } public int SortOrder { get; set; } public TreeSelectMeta meta { get; set; } public string Permission { get; set; } public TreeSelectVo() { } public TreeSelectVo(SysMenu menu) { Id = menu.menuId; Name = menu.name; ParentId = menu.parentId; MenuType = menu.menuType; Path = menu.path; SortOrder = menu.sortOrder; meta = new TreeSelectMeta(); meta.title = menu.name; meta.enName = menu.enName; meta.icon = menu.icon; // Permission = new List(); Permission = menu.permission; List child = new List(); foreach (var item in menu.children) { // if(item.menuType == "0") // { child.Add(new TreeSelectVo(item)); // } // else // { // Permission.Add(item.permission); // } } Children = child; } public TreeSelectVo(SysDept dept) { Id = dept.deptId; Name = dept.name; List child = new List(); foreach (var item in dept.children) { child.Add(new TreeSelectVo(item)); } Children = child; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public List Children { get; set; } } public class TreeSelectMeta { public string title { get; set; } public string enName { get; set; } public string icon { get; set; } public List roles { get; set; } public List auths { get; set; } } }