提交rbac

提交设置右键错位的bug
This commit is contained in:
2025-04-08 15:15:02 +08:00
parent ab38ee029a
commit 9f7c6206ca
139 changed files with 27868 additions and 117 deletions

View 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;
}
}
}
}

View 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; }
}
}

View 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;
}
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class AuthorParms
{
public string roleId { get; set; }
public List<string> perIds { get; set; }
public string operater { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class FileUploadParms
{
public byte[] file { get; set; }
public string fileName { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class ItemDetailIndexParms
{
public int pageIndex { get; set; }
public int pageSize { get; set; }
public string keyWord { get; set; }
public string itemId { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class KeyValue
{
public string Name { get; set; }
public string Value { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class LogDeleteParms
{
public string type { get; set; }
public string index { get; set; }
public string operateUser { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class LogIndexParms
{
public int pageIndex { get; set; }
public int pageSize { get; set; }
public string type { get; set; }
public string index { get; set; }
public string keyWord { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class LongPrimaryKeyParms
{
public string operaterId { get; set; }
public long primaryKey { get; set; }
public string operateUser { get; set; }
public string userIds { get; set; }
public string roleId { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class ModifyPasswordParms
{
public string userId { get; set; }
public string oldPassword { get; set; }
public string newPassword { get; set; }
public string confirmPassword { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class RoleDeleteParms
{
public List<string> roleIdList { get; set; }
public string operateUser { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class SearchParms
{
public int pageIndex { get; set; }
public int pageSize { get; set; }
public string keyWord { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class StrPrimaryKeyParms
{
public string operaterId { get; set; }
public string primaryKey { get; set; }
public string operateUser { get; set; }
public string userIds { get; set; }
public string roleId { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class UserDeleteParms
{
public List<string> userIdList { get; set; }
public string currentUserId { get; set; }
public string operateUser { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.DTO.Parms
{
public class UserLoginParms
{
public string verifyCode { get; set; }
public string userName { get; set; }
public string password { get; set; }
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Enum
{
/// <summary>
/// 权限类型。
/// </summary>
public class ModuleType
{
/// <summary>
/// 主菜单。
/// </summary>
public const int Menu = 2;
/// <summary>
/// 子菜单
/// </summary>
public const int SubMenu = 0;
/// <summary>
/// 按钮。
/// </summary>
public const int Button = 1;
}
}

View File

@ -0,0 +1,37 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_Item")]
public partial class SysItem : BaseModelEntity
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "EnCode")]
public string EnCode { get; set; }
[SugarColumn(ColumnName = "ParentId")]
public string ParentId { get; set; }
[SugarColumn(ColumnName = "Name")]
public string Name { get; set; }
[SugarColumn(ColumnName = "Layer")]
public int? Layer { get; set; }
[SugarColumn(ColumnName = "SortCode")]
public int? SortCode { get; set; }
[SugarColumn(ColumnName = "IsTree")]
public string IsTree { get; set; }
[SugarColumn(ColumnName = "Remark")]
public string Remark { get; set; }
}
}

View File

@ -0,0 +1,35 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_ItemsDetail")]
public partial class SysItemDetail : BaseModelEntity
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "ItemId")]
public string ItemId { get; set; }
[SugarColumn(ColumnName = "EnCode")]
public string EnCode { get; set; }
[SugarColumn(ColumnName = "Name")]
public string Name { get; set; }
[SugarColumn(ColumnName = "IsDefault")]
public string IsDefault { get; set; }
[SugarColumn(ColumnName = "SortCode")]
public int? SortCode { get; set; }
}
}

View File

@ -0,0 +1,29 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_Log")]
public class SysLog : BaseModelEntity
{
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
[SugarColumn]
public string Type { get; set; }
[SugarColumn]
public int ThreadId { get; set; }
[SugarColumn]
public string Message { get; set; }
[SugarColumn]
public DateTime CreateTime { get; set; }
}
}

View File

@ -0,0 +1,58 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_Organize")]
public partial class SysOrganize : BaseModelEntity
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "ParentId")]
public string ParentId { get; set; }
[SugarColumn(ColumnName = "Layer")]
public int? Layer { get; set; }
[SugarColumn(ColumnName = "EnCode")]
public string EnCode { get; set; }
[SugarColumn(ColumnName = "FullName")]
public string FullName { get; set; }
[SugarColumn(ColumnName = "Type")]
public int? Type { get; set; }
[SugarColumn(ColumnName = "ManagerId")]
public string ManagerId { get; set; }
[SugarColumn(ColumnName = "TelePhone")]
public string TelePhone { get; set; }
[SugarColumn(ColumnName = "WeChat")]
public string WeChat { get; set; }
[SugarColumn(ColumnName = "Fax")]
public string Fax { get; set; }
[SugarColumn(ColumnName = "Email")]
public string Email { get; set; }
[SugarColumn(ColumnName = "Address")]
public string Address { get; set; }
[SugarColumn(ColumnName = "SortCode")]
public int? SortCode { get; set; }
[SugarColumn(ColumnName = "Remark")]
public string Remark { get; set; }
}
}

View File

@ -0,0 +1,61 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_Permission")]
public partial class SysPermission : BaseModelEntity
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "ParentId")]
public string ParentId { get; set; }
[SugarColumn(ColumnName = "Layer")]
public int? Layer { get; set; }
[SugarColumn(ColumnName = "EnCode")]
public string EnCode { get; set; }
[SugarColumn(ColumnName = "Name")]
public string Name { get; set; }
[SugarColumn(ColumnName = "JsEvent")]
public string JsEvent { get; set; }
[SugarColumn(ColumnName = "Icon")]
public string Icon { get; set; }
[SugarColumn(ColumnName = "SymbolIndex")]
public int SymbolIndex { get; set; }
[SugarColumn(ColumnName = "Url")]
public string Url { get; set; }
[SugarColumn(ColumnName = "Remark")]
public string Remark { get; set; }
[SugarColumn(ColumnName = "Type")]
public int? Type { get; set; }
[SugarColumn(ColumnName = "SortCode")]
public int? SortCode { get; set; }
[SugarColumn(ColumnName = "IsPublic")]
public string IsPublic { get; set; }
[SugarColumn(ColumnName = "IsEdit")]
public string IsEdit { get; set; }
}
}

View File

@ -0,0 +1,55 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_Role")]
public partial class SysRole : BaseModelEntity
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "OrganizeId")]
public string OrganizeId { get; set; }
[SugarColumn(ColumnName = "EnCode")]
public string EnCode { get; set; }
[SugarColumn(ColumnName = "Type")]
public int? Type { get; set; }
[SugarColumn(ColumnName = "Name")]
public string Name { get; set; }
[SugarColumn(ColumnName = "AllowEdit")]
public string AllowEdit { get; set; }
[SugarColumn(ColumnName = "Remark")]
public string Remark { get; set; }
[SugarColumn(ColumnName = "SortCode")]
public int? SortCode { get; set; }
[Navigate(NavigateType.OneToOne, nameof(OrganizeId), nameof(SysOrganize.Id))]
public SysOrganize Organize { get; set; }
[SugarColumn(IsIgnore = true)]
public string DeptName
{
get
{
if (Organize == null)
return "";
return Organize.FullName;
}
}
}
}

View File

@ -0,0 +1,29 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_RoleAuthorize")]
public partial class SysRoleAuthorize : BaseModelEntity
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "RoleId")]
public string RoleId { get; set; }
[SugarColumn(ColumnName = "ModuleId")]
public string ModuleId { get; set; }
}
}

View File

@ -0,0 +1,115 @@

using DH.RBAC.Utility.Extension;
using DH.RBAC.Utility.Other;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.IO;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_User")]
public partial class SysUser : BaseModelEntity
{
private SysOrganize organize;
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "Account")]
public string Account { get; set; }
[SugarColumn(ColumnName = "RealName")]
public string RealName { get; set; }
[SugarColumn(ColumnName = "NickName")]
public string NickName { get; set; }
[SugarColumn(ColumnName = "Avatar")]
public string Avatar { get; set; }
[SugarColumn(IsIgnore = true)]
public string AvatarBase64
{
get
{
if (Avatar.IsNullOrEmpty())
return "";
string filePath = MyEnvironment.RootPath("wwwroot" + Avatar);
if (!File.Exists(filePath))
{
return "";
}
return filePath;
}
}
[SugarColumn(ColumnName = "Gender")]
public string Gender { get; set; }
[SugarColumn(IsIgnore = true)]
public string GenderStr
{
get
{
return Gender == "1" ? "男" : "女";
}
}
[SugarColumn(ColumnName = "Birthday")]
public DateTime? Birthday { get; set; }
[SugarColumn(ColumnName = "MobilePhone")]
public string MobilePhone { get; set; }
[SugarColumn(ColumnName = "Email")]
public string Email { get; set; }
[SugarColumn(ColumnName = "Signature")]
public string Signature { get; set; }
[SugarColumn(ColumnName = "Address")]
public string Address { get; set; }
[SugarColumn(ColumnName = "CompanyId")]
public string CompanyId { get; set; }
[SugarColumn(ColumnName = "SortCode")]
public int? SortCode { get; set; }
[SugarColumn(ColumnName = "DepartmentId")]
public string DepartmentId { get; set; }
[Navigate(NavigateType.OneToOne, nameof(DepartmentId), nameof(SysOrganize.Id))]
public SysOrganize Organize { get; set; }
[SugarColumn(IsIgnore = true)]
public string DeptName
{
get
{
if (Organize == null)
return "";
return Organize.FullName;
}
}
[SugarColumn(IsIgnore = true)]
public string StrBirthday { get; set; }
[SugarColumn(IsIgnore = true)]
public List<string> RoleId { set; get; }
[SugarColumn(IsIgnore = true)]
public string password { set; get; }
[SugarColumn(IsIgnore = true)]
public string roleIds { set; get; }
}
}

View File

@ -0,0 +1,60 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_UserLogOn")]
public partial class SysUserLogOn : BaseModelEntity
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "UserId")]
public string UserId { get; set; }
[SugarColumn(ColumnName = "Password")]
public string Password { get; set; }
[SugarColumn(ColumnName = "SecretKey")]
public string SecretKey { get; set; }
[SugarColumn(ColumnName = "PrevVisitTime")]
public DateTime? PrevVisitTime { get; set; }
[SugarColumn(ColumnName = "LastVisitTime")]
public DateTime? LastVisitTime { get; set; }
[SugarColumn(ColumnName = "ChangePwdTime")]
public DateTime? ChangePwdTime { get; set; }
[SugarColumn(ColumnName = "LoginCount")]
public int LoginCount { get; set; }
[SugarColumn(ColumnName = "AllowMultiUserOnline")]
public string AllowMultiUserOnline { get; set; }
[SugarColumn(ColumnName = "IsOnLine")]
public string IsOnLine { get; set; }
[SugarColumn(ColumnName = "Question")]
public string Question { get; set; }
[SugarColumn(ColumnName = "AnswerQuestion")]
public string AnswerQuestion { get; set; }
[SugarColumn(ColumnName = "CheckIPAddress")]
public string CheckIPAddress { get; set; }
[SugarColumn(ColumnName = "Language")]
public string Language { get; set; }
[SugarColumn(ColumnName = "Theme")]
public string Theme { get; set; }
}
}

View File

@ -0,0 +1,26 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.RBAC.Model.Sys
{
[SugarTable("Sys_UserRoleRelation")]
public partial class SysUserRoleRelation : BaseModelEntity
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public string Id { get; set; }
[SugarColumn(ColumnName = "UserId")]
public string UserId { get; set; }
[SugarColumn(ColumnName = "RoleId")]
public string RoleId { get; set; }
}
}