You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.8 KiB
74 lines
1.8 KiB
1 year ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.ComponentModel.DataAnnotations;
|
||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||
|
|
||
|
namespace CK.SCP.Models.AppBoxEntity
|
||
|
{
|
||
|
public class Menu : ICustomTree, IKeyID, ICloneable
|
||
|
{
|
||
|
[Key]
|
||
|
public int ID { get; set; }
|
||
|
|
||
|
[Required, StringLength(50)]
|
||
|
public string Name { get; set; }
|
||
|
|
||
|
[StringLength(200)]
|
||
|
public string ImageUrl { get; set; }
|
||
|
|
||
|
[StringLength(200)]
|
||
|
public string NavigateUrl { get; set; }
|
||
|
|
||
|
[StringLength(500)]
|
||
|
public string Remark { get; set; }
|
||
|
|
||
|
[Required]
|
||
|
public int SortIndex { get; set; }
|
||
|
|
||
|
|
||
|
public virtual Menu Parent { get; set; }
|
||
|
public virtual ICollection<Menu> Children { get; set; }
|
||
|
|
||
|
|
||
|
|
||
|
public virtual Power ViewPower {get; set;}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/// <summary>
|
||
|
/// 菜单在树形结构中的层级(从0开始)
|
||
|
/// </summary>
|
||
|
[NotMapped]
|
||
|
public int TreeLevel { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 是否可用(默认true),在模拟树的下拉列表中使用
|
||
|
/// </summary>
|
||
|
[NotMapped]
|
||
|
public bool Enabled { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 是否叶子节点(默认true)
|
||
|
/// </summary>
|
||
|
[NotMapped]
|
||
|
public bool IsTreeLeaf { get; set; }
|
||
|
|
||
|
|
||
|
public object Clone()
|
||
|
{
|
||
|
Menu menu = new Menu {
|
||
|
ID = ID,
|
||
|
Name = Name,
|
||
|
ImageUrl = ImageUrl,
|
||
|
NavigateUrl = NavigateUrl,
|
||
|
Remark = Remark,
|
||
|
SortIndex = SortIndex,
|
||
|
TreeLevel = TreeLevel,
|
||
|
Enabled = Enabled,
|
||
|
IsTreeLeaf = IsTreeLeaf
|
||
|
};
|
||
|
return menu;
|
||
|
}
|
||
|
}
|
||
|
}
|