初始刷
This commit is contained in:
78
ZR.Model/System/Model/Vo/RouterVo.cs
Normal file
78
ZR.Model/System/Model/Vo/RouterVo.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
namespace ZR.Model.System.Vo
|
||||
{
|
||||
/// <summary>
|
||||
/// 路由展示
|
||||
/// </summary>
|
||||
public class RouterVo
|
||||
{
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool AlwaysShow { get; set; }
|
||||
private string component;
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool Hidden { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Path { get; set; }
|
||||
public string Redirect { get; set; }
|
||||
public Meta Meta { get; set; }
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||
public List<RouterVo> Children { get; set; }
|
||||
public string Component { get => component; set => component = value; }
|
||||
}
|
||||
|
||||
public class Meta
|
||||
{
|
||||
/// <summary>
|
||||
/// 设置该路由在侧边栏和面包屑中展示的名字
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
/// </summary>
|
||||
public string Icon { get; set; }
|
||||
/// <summary>
|
||||
/// 设置为true,则不会被 <keep-alive>缓存
|
||||
/// </summary>
|
||||
public bool NoCache { get; set; }
|
||||
public string TitleKey { get; set; } = string.Empty;
|
||||
public string Link { get; set; } = string.Empty;
|
||||
public int IsNew { get; set; }
|
||||
/// <summary>
|
||||
/// icon颜色
|
||||
/// </summary>
|
||||
public string IconColor { get; set; }
|
||||
/// <summary>
|
||||
/// 权限字符
|
||||
/// </summary>
|
||||
public string Permi { get; set; }
|
||||
public Meta(string title, string icon)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
}
|
||||
public Meta(string title, string icon, string path)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
Link = path;
|
||||
}
|
||||
public Meta(string title, string icon, bool noCache, string titleKey, string path, DateTime addTime)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
NoCache = noCache;
|
||||
TitleKey = titleKey;
|
||||
if (!string.IsNullOrEmpty(path) && (path.StartsWith(UserConstants.HTTP) || path.StartsWith(UserConstants.HTTPS)))
|
||||
{
|
||||
Link = path;
|
||||
}
|
||||
if (addTime != DateTime.MinValue)
|
||||
{
|
||||
TimeSpan ts = DateTime.Now - addTime;
|
||||
if (ts.Days < 7)
|
||||
{
|
||||
IsNew = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
ZR.Model/System/Model/Vo/TreeSelectVo.cs
Normal file
57
ZR.Model/System/Model/Vo/TreeSelectVo.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
namespace ZR.Model.System.Vo
|
||||
{
|
||||
/// <summary>
|
||||
/// Treeselect树结构实体类
|
||||
/// </summary>
|
||||
public class TreeSelectVo
|
||||
{
|
||||
/// <summary>
|
||||
/// 节点Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 节点名称
|
||||
/// </summary>
|
||||
public string Label { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string MenuType { get; set; }
|
||||
public string Permission { get; set; }
|
||||
|
||||
public TreeSelectVo() { }
|
||||
|
||||
public TreeSelectVo(SysMenu menu)
|
||||
{
|
||||
Id = menu.MenuId;
|
||||
Label = menu.MenuName;
|
||||
Status = menu.Status;
|
||||
MenuType = menu.MenuType;
|
||||
Permission = menu.Perms;
|
||||
|
||||
List<TreeSelectVo> child = new List<TreeSelectVo>();
|
||||
foreach (var item in menu.Children)
|
||||
{
|
||||
child.Add(new TreeSelectVo(item));
|
||||
}
|
||||
|
||||
Children = child;
|
||||
}
|
||||
|
||||
public TreeSelectVo(SysDept dept)
|
||||
{
|
||||
Id = dept.DeptId;
|
||||
Label = dept.DeptName;
|
||||
|
||||
//menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); java写法
|
||||
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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user