优化项目命名空间

This commit is contained in:
izory
2021-09-16 19:07:49 +08:00
parent ced13d7b10
commit 086ccbfb6d
37 changed files with 50 additions and 92 deletions

View File

@@ -0,0 +1,50 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
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; }
//[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
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 Meta(string title, string icon, bool noCache)
{
Title = title;
Icon = icon;
NoCache = noCache;
}
}
}

View File

@@ -0,0 +1,58 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
using ZR.Model.System;
namespace ZR.Model.Vo.System
{
/// <summary>
/// Treeselect树结构实体类
/// </summary>
public class TreeSelectVo
{
/// <summary>
/// 节点Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 节点名称
/// </summary>
public string Label { get; set; }
public TreeSelectVo() { }
public TreeSelectVo(SysMenu menu)
{
Id = menu.menuId;
Label = menu.menuName;
//menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); java写法
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; }
}
}