56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using YLErp.Abstract;
|
|
|
|
namespace YLErp.Web
|
|
{
|
|
/// <summary>
|
|
/// 系统菜单项目
|
|
/// </summary>
|
|
public class MenuItem : ITreeMenuItem
|
|
{
|
|
public string Id { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
public string[] Rights { get; set; } = new string[] { null };
|
|
|
|
public string Url { get; set; }
|
|
|
|
public string Icon { get; set; }
|
|
|
|
public List<MenuItem> SubItems { get; set; }
|
|
|
|
public int Level { get; set; }
|
|
|
|
public string Target { get; set; }
|
|
|
|
public MenuItem AppendChild(string name, string[] rights,
|
|
string url, string icon = null, string target = null)
|
|
{
|
|
var menu = new MenuItem
|
|
{
|
|
Name = name,
|
|
Rights = rights,
|
|
Url = url,
|
|
Icon = icon,
|
|
Target = target
|
|
};
|
|
if (SubItems == null)
|
|
{
|
|
SubItems = new List<MenuItem>();
|
|
}
|
|
SubItems.Add(menu);
|
|
return menu;
|
|
}
|
|
|
|
public ITreeMenuItem AppendChild(string id, string name, string[] rights,
|
|
string url, string icon, string target)
|
|
{
|
|
return AppendChild(name, rights, url, icon, target);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{Name}--{Url}";
|
|
}
|
|
}
|
|
} |