123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using Model;
- using Newtonsoft.Json;
- namespace Vo
- {
- /// <summary>
- /// Treeselect树结构实体类
- /// </summary>
- public class LeftMenuVo
- {
- /// <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 List<string> Permission { get; set; }
- public LeftMenuVo() { }
- public LeftMenuVo(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>();
- List<LeftMenuVo> child = new List<LeftMenuVo>();
- foreach (var item in menu.children)
- {
- if(item.menuType == "0")
- {
- child.Add(new LeftMenuVo(item));
- }
- else
- {
- Permission.Add(item.permission);
- }
- }
- Children = child;
- }
- public LeftMenuVo(SysDept dept)
- {
- Id = dept.deptId;
- Name = dept.name;
- List<LeftMenuVo> child = new List<LeftMenuVo>();
- foreach (var item in dept.children)
- {
- child.Add(new LeftMenuVo(item));
- }
- Children = child;
- }
- [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
- public List<LeftMenuVo> Children { get; set; }
- }
- }
|