12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using Model;
- using Newtonsoft.Json;
- namespace Vo
- {
- /// <summary>
- /// Treeselect树结构实体类
- /// </summary>
- public class TreeSelectVo
- {
- /// <summary>
- /// 节点Id
- /// </summary>
- public long Id { get; set; }
- /// <summary>
- /// 节点名称
- /// </summary>
- 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<string>();
- Permission = menu.permission;
- List<TreeSelectVo> child = new List<TreeSelectVo>();
- 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<TreeSelectVo> child = new List<TreeSelectVo>();
- foreach (var item in dept.children)
- {
- child.Add(new TreeSelectVo(item));
- }
- Children = child;
- }
- [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
- public List<TreeSelectVo> Children { get; set; }
- }
- public class TreeSelectMeta
- {
- public string title { get; set; }
- public string enName { get; set; }
- public string icon { get; set; }
- public List<string> roles { get; set; }
- public List<string> auths { get; set; }
- }
- }
|