提交rbac
提交设置右键错位的bug
This commit is contained in:
91
DH.RBAC/Models/Base/BaseModelEntity.cs
Normal file
91
DH.RBAC/Models/Base/BaseModelEntity.cs
Normal file
@ -0,0 +1,91 @@
|
||||
using AntdUI;
|
||||
using DH.RBAC.Model.Sys;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DH.RBAC.Model
|
||||
{
|
||||
public class BaseModelEntity: NotifyProperty
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "EnableFlag", ColumnDescription = "是否启用", IsNullable = true, Length = 1)]
|
||||
public virtual string EnableFlag { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "DeleteFlag", ColumnDescription = "是否删除", IsNullable = true, Length = 1)]
|
||||
public virtual string DeleteFlag { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateUserId", ColumnDescription = "创建人", IsNullable = true, Length = 255)]
|
||||
public virtual string CreateUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateTime", ColumnDescription = "创建时间", IsNullable = true, Length = 3)]
|
||||
public virtual DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ModifyUserId", ColumnDescription = "更新人", IsNullable = true, Length = 255)]
|
||||
public virtual string ModifyUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime", ColumnDescription = "更新时间", IsNullable = true, Length = 3)]
|
||||
public virtual DateTime? ModifyTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(CreateUserId), nameof(SysUser.Id))]//一对一 SchoolId是StudentA类里面的
|
||||
public SysUser CreateUser { get; set; } //不能赋值只能是null
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
[Navigate(NavigateType.OneToOne, nameof(ModifyUserId), nameof(SysUser.Id))]//一对一 SchoolId是StudentA类里面的
|
||||
public SysUser ModifyUser { get; set; } //不能赋值只能是null
|
||||
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string CreateUserName
|
||||
{
|
||||
get
|
||||
{
|
||||
return CreateUser == null ? "" : CreateUser.RealName;
|
||||
}
|
||||
}
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string ModifyUserName
|
||||
{
|
||||
get
|
||||
{
|
||||
return ModifyUser == null ? "" : ModifyUser.RealName;
|
||||
}
|
||||
}
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public bool IsDeleted
|
||||
{
|
||||
get
|
||||
{
|
||||
return DeleteFlag == "Y" ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public bool IsEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return EnableFlag == "Y" ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
22
DH.RBAC/Models/Base/CodeGenerator.cs
Normal file
22
DH.RBAC/Models/Base/CodeGenerator.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DH.RBAC.Model.Base
|
||||
{
|
||||
public class CodeGenerator
|
||||
{
|
||||
public string TableName { get; set; }
|
||||
public string ColumnName { get; set; }
|
||||
public string TypeName { get; set; }
|
||||
public string TypeLength { get; set; }
|
||||
public string IsPrimaryKey { get; set; }
|
||||
public string ClassName { get; set; }
|
||||
public string PropertyName { get; set; }
|
||||
public string CSType { get; set; }
|
||||
|
||||
public string Other { get; set; }
|
||||
}
|
||||
}
|
20
DH.RBAC/Models/Base/MenuControlAttribute.cs
Normal file
20
DH.RBAC/Models/Base/MenuControlAttribute.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DH.RBAC.Models.Base
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
|
||||
public class MenuControlAttribute : Attribute
|
||||
{
|
||||
public string ParentMenu { get; } // 父菜单名称(如 "相机设置")
|
||||
public Type ConfigType { get; } // 配置类型(如 CameraBase)
|
||||
|
||||
public MenuControlAttribute(string parentMenu)
|
||||
{
|
||||
ParentMenu = parentMenu;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user