|
@@ -15,23 +15,40 @@ namespace Vo
|
|
|
/// <summary>
|
|
|
/// 节点名称
|
|
|
/// </summary>
|
|
|
- public string Label { get; set; }
|
|
|
- public string Status { 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 List<string> Permission { get; set; }
|
|
|
|
|
|
public TreeSelectVo() { }
|
|
|
|
|
|
public TreeSelectVo(SysMenu menu)
|
|
|
{
|
|
|
Id = menu.MenuId;
|
|
|
- Label = menu.Name;
|
|
|
- Status = menu.Visible;
|
|
|
+ Name = menu.Name;
|
|
|
+ ParentId = menu.ParentId;
|
|
|
MenuType = menu.MenuType;
|
|
|
+ Path = menu.Path;
|
|
|
+ SortOrder = menu.SortOrder;
|
|
|
+ Meta = new TreeSelectMeta();
|
|
|
+ Meta.Title = menu.Name;
|
|
|
+ Meta.Icon = menu.Icon;
|
|
|
+ Permission = new List<string>();
|
|
|
|
|
|
List<TreeSelectVo> child = new List<TreeSelectVo>();
|
|
|
foreach (var item in menu.Children)
|
|
|
{
|
|
|
- child.Add(new TreeSelectVo(item));
|
|
|
+ if(item.MenuType == "0")
|
|
|
+ {
|
|
|
+ child.Add(new TreeSelectVo(item));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Permission.Add(item.Permission);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Children = child;
|
|
@@ -40,9 +57,8 @@ namespace Vo
|
|
|
public TreeSelectVo(SysDept dept)
|
|
|
{
|
|
|
Id = dept.DeptId;
|
|
|
- Label = dept.Name;
|
|
|
+ Name = dept.Name;
|
|
|
|
|
|
- //menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); java写法
|
|
|
List<TreeSelectVo> child = new List<TreeSelectVo>();
|
|
|
foreach (var item in dept.children)
|
|
|
{
|
|
@@ -55,4 +71,12 @@ namespace Vo
|
|
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
|
|
public List<TreeSelectVo> Children { get; set; }
|
|
|
}
|
|
|
+
|
|
|
+ public class TreeSelectMeta
|
|
|
+ {
|
|
|
+ public string Title { get; set; }
|
|
|
+ public string Icon { get; set; }
|
|
|
+ public List<string> Roles { get; set; }
|
|
|
+ public List<string> Auths { get; set; }
|
|
|
+ }
|
|
|
}
|