Permission.cs
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using HHECS.DataContract;
using System.ComponentModel;
using ColumnAttribute = FreeSql.DataAnnotations.ColumnAttribute;
using NotMapped = System.ComponentModel.DataAnnotations.Schema.NotMappedAttribute;
namespace HHECS.RobotTool.Model
{
/// <summary>
/// 权限表/菜单表
/// </summary>
public class Permission : BaseEntityCU<int>
{
public string Code { get; set; } = null!;
public string Name { get; set; } = null!;
/// <summary>
/// 类型
/// </summary>
[Column(DbType = "varchar(50)", MapType = typeof(string))]
public PermissionType PermissionType { get; set; }
/// <summary>
/// 父节点
/// </summary>
public int? ParentId { get; set; }
/// <summary>
/// 页面名称
/// </summary>
public string ViewName { get; set; } = null!;
public string Description { get; set; } = null!;
public event PropertyChangedEventHandler? PropertyChanged;
public List<Permission> Children { get; set; } = new List<Permission>();
[NotMapped]
public bool CurrentNodeIsChanged { get; set; }
}
public enum PermissionType
{
/// <summary>
/// 菜单选项
/// </summary>
MenuItem,
/// <summary>
/// 按钮
/// </summary>
Button,
}
public enum ButtonType
{
QueryBtn,
CreateBtn,
EditBtn,
DeleteBtn,
BatchDeleteBtn,
DetailBtn,
}
}