😎增加表格字段权限管理(字段黑名单)
This commit is contained in:
parent
cf3e6d8a25
commit
3c22af1cc2
33
Admin.NET/Admin.NET.Core/Entity/SysRoleTable.cs
Normal file
33
Admin.NET/Admin.NET.Core/Entity/SysRoleTable.cs
Normal file
@ -0,0 +1,33 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 系统角色表格表
|
||||
/// </summary>
|
||||
[SugarTable(null, "系统角色表格表")]
|
||||
[SysTable]
|
||||
public class SysRoleTable : EntityBaseId
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色Id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "角色Id")]
|
||||
public long RoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "表名", Length = 64)]
|
||||
public string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "列名", Length = 64)]
|
||||
public string ColumnName { get; set; }
|
||||
}
|
||||
@ -59,12 +59,12 @@ public class SysDictDataSeedData : ISqlSugarEntitySeedData<SysDictData>
|
||||
new SysDictData{ Id=1300000000405, DictTypeId=1300000000104, Value="生成到本项目(前端)", Code="211", OrderNo=5, Remark="生成到本项目(前端)", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000406, DictTypeId=1300000000104, Value="生成到本项目(后端)", Code="221", OrderNo=6, Remark="生成到本项目(后端)", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
|
||||
new SysDictData{ Id=1300000000501, DictTypeId=1300000000105, Value="EntityBaseId【基础实体Id】", Code="EntityBaseId", OrderNo=1, Remark="【基础实体Id】", Status=StatusEnum.Disable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000502, DictTypeId=1300000000105, Value="EntityBase【基础实体】", Code="EntityBase", OrderNo=1, Remark="【基础实体】", Status=StatusEnum.Disable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000503, DictTypeId=1300000000105, Value="EntityTenantId【租户实体Id】", Code="EntityTenantId", OrderNo=1, Remark="【租户实体Id】", Status=StatusEnum.Disable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000504, DictTypeId=1300000000105, Value="EntityTenant【租户实体】", Code="EntityTenant", OrderNo=1, Remark="【租户实体】", Status=StatusEnum.Disable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000505, DictTypeId=1300000000105, Value="EntityBaseData【业务实体】", Code="EntityBaseData", OrderNo=1, Remark="【业务实体】", Status=StatusEnum.Disable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000506, DictTypeId=1300000000105, Value="EntityTenantBaseData【租户业务实体】", Code="EntityTenantBaseData", OrderNo=1, Remark="【租户业务实体】", Status=StatusEnum.Disable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000501, DictTypeId=1300000000105, Value="EntityBaseId【基础实体Id】", Code="EntityBaseId", OrderNo=1, Remark="【基础实体Id】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000502, DictTypeId=1300000000105, Value="EntityBase【基础实体】", Code="EntityBase", OrderNo=1, Remark="【基础实体】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000503, DictTypeId=1300000000105, Value="EntityTenantId【租户实体Id】", Code="EntityTenantId", OrderNo=1, Remark="【租户实体Id】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000504, DictTypeId=1300000000105, Value="EntityTenant【租户实体】", Code="EntityTenant", OrderNo=1, Remark="【租户实体】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000505, DictTypeId=1300000000105, Value="EntityBaseData【业务实体】", Code="EntityBaseData", OrderNo=1, Remark="【业务实体】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysDictData{ Id=1300000000506, DictTypeId=1300000000105, Value="EntityTenantBaseData【租户业务实体】", Code="EntityTenantBaseData", OrderNo=1, Remark="【租户业务实体】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
|
||||
new SysDictData{ Id=1300000000601, DictTypeId=1300000000106, Value="不需要", Code="off", OrderNo=100, Remark="不需要打印支持", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-12-04 00:00:00") },
|
||||
new SysDictData{ Id=1300000000602, DictTypeId=1300000000106, Value="绑定打印模版", Code="custom", OrderNo=101, Remark="绑定打印模版", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-12-04 00:00:00") },
|
||||
|
||||
@ -45,9 +45,10 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
|
||||
new SysMenu{ Id=1310000000134, Pid=1310000000131, Title="增加", Permission="sysRole/add", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000135, Pid=1310000000131, Title="删除", Permission="sysRole/delete", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000136, Pid=1310000000131, Title="授权菜单", Permission="sysRole/grantMenu", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000137, Pid=1310000000131, Title="授权数据", Permission="sysRole/grantDataScope", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000138, Pid=1310000000131, Title="设置状态", Permission="sysRole/setStatus", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000139, Pid=1310000000131, Title="授权接口", Permission="sysRole/grantApi", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000137, Pid=1310000000131, Title="授权表格", Permission="sysRole/grantTable", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000138, Pid=1310000000131, Title="授权数据", Permission="sysRole/grantDataScope", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000139, Pid=1310000000131, Title="设置状态", Permission="sysRole/setStatus", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000140, Pid=1310000000131, Title="授权接口", Permission="sysRole/grantApi", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
|
||||
new SysMenu{ Id=1310000000141, Pid=1310000000101, Title="机构管理", Path="/system/org", Name="sysOrg", Component="/system/org/index", Icon="ele-OfficeBuilding", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=120 },
|
||||
//new SysMenu{ Id=1310000000142, Pid=1310000000141, Title="查询", Permission="sysOrg/list", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
|
||||
41
Admin.NET/Admin.NET.Core/Service/Role/Dto/RoleTableOutput.cs
Normal file
41
Admin.NET/Admin.NET.Core/Service/Role/Dto/RoleTableOutput.cs
Normal file
@ -0,0 +1,41 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
/// <summary>
|
||||
/// 角色表格
|
||||
/// </summary>
|
||||
public class RoleTableOutput
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Pid { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Label { get; set; }
|
||||
public List<TableColumnOutput> Columns { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 角色表格字段
|
||||
/// </summary>
|
||||
public class TableColumnOutput
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Pid { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Label { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 授权角色表格
|
||||
/// </summary>
|
||||
public class RoleTableInput : BaseIdInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 表格字段集合
|
||||
/// </summary>
|
||||
public List<string> TableColumnList { get; set; }
|
||||
}
|
||||
@ -12,13 +12,10 @@ namespace Admin.NET.Core.Service;
|
||||
public class SysRoleMenuService : ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<SysRoleMenu> _sysRoleMenuRep;
|
||||
private readonly SysCacheService _sysCacheService;
|
||||
|
||||
public SysRoleMenuService(SqlSugarRepository<SysRoleMenu> sysRoleMenuRep,
|
||||
SysCacheService sysCacheService)
|
||||
public SysRoleMenuService(SqlSugarRepository<SysRoleMenu> sysRoleMenuRep)
|
||||
{
|
||||
_sysRoleMenuRep = sysRoleMenuRep;
|
||||
_sysCacheService = sysCacheService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -16,6 +16,7 @@ public class SysRoleService : IDynamicApiController, ITransient
|
||||
private readonly SqlSugarRepository<SysRole> _sysRoleRep;
|
||||
private readonly SysRoleOrgService _sysRoleOrgService;
|
||||
private readonly SysRoleMenuService _sysRoleMenuService;
|
||||
private readonly SysRoleTableService _sysRoleTableService;
|
||||
private readonly SysRoleApiService _sysRoleApiService;
|
||||
private readonly SysOrgService _sysOrgService;
|
||||
private readonly SysUserRoleService _sysUserRoleService;
|
||||
@ -26,6 +27,7 @@ public class SysRoleService : IDynamicApiController, ITransient
|
||||
SqlSugarRepository<SysRole> sysRoleRep,
|
||||
SysRoleOrgService sysRoleOrgService,
|
||||
SysRoleMenuService sysRoleMenuService,
|
||||
SysRoleTableService sysRoleTableService,
|
||||
SysRoleApiService sysRoleApiService,
|
||||
SysOrgService sysOrgService,
|
||||
SysUserRoleService sysUserRoleService,
|
||||
@ -36,6 +38,7 @@ public class SysRoleService : IDynamicApiController, ITransient
|
||||
_sysRoleRep = sysRoleRep;
|
||||
_sysRoleOrgService = sysRoleOrgService;
|
||||
_sysRoleMenuService = sysRoleMenuService;
|
||||
_sysRoleTableService = sysRoleTableService;
|
||||
_sysRoleApiService = sysRoleApiService;
|
||||
_sysOrgService = sysOrgService;
|
||||
_sysUserRoleService = sysUserRoleService;
|
||||
@ -180,6 +183,21 @@ public class SysRoleService : IDynamicApiController, ITransient
|
||||
await ClearUserApiCache(input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 授权角色表格 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[UnitOfWork]
|
||||
[DisplayName("授权角色表格")]
|
||||
public async Task GrantRoleTable(RoleTableInput input)
|
||||
{
|
||||
if (input.TableColumnList == null || input.TableColumnList.Count < 1)
|
||||
return;
|
||||
|
||||
await _sysRoleTableService.GrantRoleTable(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 授权角色数据范围 🔖
|
||||
/// </summary>
|
||||
@ -253,6 +271,37 @@ public class SysRoleService : IDynamicApiController, ITransient
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有表格字段 🔖
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取所有表格字段")]
|
||||
public List<RoleTableOutput> GetAllTableColumnList()
|
||||
{
|
||||
return _sysRoleTableService.HandleTableColumn();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取角色表格字段集合 🔖
|
||||
/// </summary>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取角色表格字段集合")]
|
||||
public async Task<List<string>> GetRoleTable(long roleId)
|
||||
{
|
||||
return await _sysRoleTableService.GetRoleTable(roleId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前用户表格字段集合 🔖
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取当前用户表格字段集合")]
|
||||
public async Task<List<string>> GetUserRoleTableList()
|
||||
{
|
||||
return await _sysRoleTableService.GetUserRoleTableList(_userManager, _sysUserRoleService);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据角色Id获取菜单Id集合 🔖
|
||||
/// </summary>
|
||||
|
||||
155
Admin.NET/Admin.NET.Core/Service/Role/SysRoleTableService.cs
Normal file
155
Admin.NET/Admin.NET.Core/Service/Role/SysRoleTableService.cs
Normal file
@ -0,0 +1,155 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
/// <summary>
|
||||
/// 系统角色表格服务
|
||||
/// </summary>
|
||||
public class SysRoleTableService : ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<SysRoleTable> _sysRoleTableRep;
|
||||
private readonly string _tableColumnDelimiter = ":"; // 表名和字段之间的分隔符
|
||||
|
||||
public SysRoleTableService(SqlSugarRepository<SysRoleTable> sysRoleTableRep)
|
||||
{
|
||||
_sysRoleTableRep = sysRoleTableRep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取角色表格字段集合
|
||||
/// </summary>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> GetRoleTable(long roleId)
|
||||
{
|
||||
return await _sysRoleTableRep.AsQueryable()
|
||||
.Where(u => u.RoleId == roleId)
|
||||
.Select(u => $"{u.TableName}{_tableColumnDelimiter}{u.ColumnName}")
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 授权角色表格
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task GrantRoleTable(RoleTableInput input)
|
||||
{
|
||||
await _sysRoleTableRep.AsDeleteable().Where(u => u.RoleId == input.Id).ExecuteCommandAsync();
|
||||
|
||||
var sysRoleTableList = new List<SysRoleTable>();
|
||||
foreach (var item in input.TableColumnList)
|
||||
{
|
||||
// 过滤掉表名只保留字段名
|
||||
if (item.Contains(_tableColumnDelimiter))
|
||||
{
|
||||
var sysRoleTable = new SysRoleTable()
|
||||
{
|
||||
RoleId = input.Id,
|
||||
TableName = item.Split(_tableColumnDelimiter)[0],
|
||||
ColumnName = item.Split(_tableColumnDelimiter)[1],
|
||||
};
|
||||
sysRoleTableList.Add(sysRoleTable);
|
||||
}
|
||||
}
|
||||
await _sysRoleTableRep.InsertRangeAsync(sysRoleTableList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前用户表格字段集合
|
||||
/// </summary>
|
||||
/// <param name="userManager"></param>
|
||||
/// <param name="sysUserRoleService"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> GetUserRoleTableList(UserManager userManager, SysUserRoleService sysUserRoleService)
|
||||
{
|
||||
// 超管拥有所有表格字段
|
||||
if (userManager.SuperAdmin)
|
||||
return null;
|
||||
|
||||
var roleIdList = await sysUserRoleService.GetUserRoleIdList(userManager.UserId);
|
||||
return await _sysRoleTableRep.AsQueryable()
|
||||
.Where(u => roleIdList.Contains(u.RoleId))
|
||||
.Select(u => $"{u.TableName}{_tableColumnDelimiter}{u.ColumnName}")
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 整理所有表格字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<RoleTableOutput> HandleTableColumn()
|
||||
{
|
||||
// 排除特定表格
|
||||
var ignoreTables = new List<string>
|
||||
{
|
||||
"DingTalkUser",
|
||||
"ApprovalFlow",
|
||||
"GoViewPro",
|
||||
"GoViewPro",
|
||||
"GoViewProData"
|
||||
};
|
||||
// 排除特定字段
|
||||
var ignoreColumns = new List<string>
|
||||
{
|
||||
nameof(EntityBase.CreateTime),
|
||||
nameof(EntityBase.UpdateTime),
|
||||
nameof(EntityBase.CreateUserId),
|
||||
nameof(EntityBase.CreateUserName),
|
||||
nameof(EntityBase.UpdateUserId),
|
||||
nameof(EntityBase.UpdateUserName),
|
||||
nameof(EntityBase.IsDelete),
|
||||
nameof(EntityBase.Id),
|
||||
};
|
||||
|
||||
var roleTableList = new List<RoleTableOutput>();
|
||||
// 遍历所有实体获取所有库表结构
|
||||
var entityTypes = App.EffectiveTypes.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.IsDefined(typeof(SugarTable), false)).ToList();
|
||||
foreach (var entityType in entityTypes)
|
||||
{
|
||||
var entityInfo = _sysRoleTableRep.Context.EntityMaintenance.GetEntityInfoNoCache(entityType);
|
||||
// 排除系统表和特定表
|
||||
if (!entityType.IsDefined(typeof(SysTableAttribute), false) && !ignoreTables.Contains(entityInfo.EntityName))
|
||||
{
|
||||
var table = new RoleTableOutput
|
||||
{
|
||||
Id = PropertyNameToLower(entityInfo.EntityName),
|
||||
Pid = "0",
|
||||
Name = PropertyNameToLower(entityInfo.EntityName),
|
||||
Label = entityInfo.TableDescription,
|
||||
};
|
||||
|
||||
var columnList = new List<TableColumnOutput>();
|
||||
var columns = entityInfo.Columns.Where(u => !ignoreColumns.Contains(u.DbColumnName) && !u.IsIgnore).ToList();
|
||||
foreach (EntityColumnInfo columnInfo in columns)
|
||||
{
|
||||
var column = new TableColumnOutput
|
||||
{
|
||||
Id = $"{PropertyNameToLower(entityInfo.EntityName)}{_tableColumnDelimiter}{PropertyNameToLower(columnInfo.DbColumnName)}",
|
||||
Pid = PropertyNameToLower(entityInfo.EntityName),
|
||||
Name = PropertyNameToLower(columnInfo.DbColumnName),
|
||||
Label = columnInfo.ColumnDescription,
|
||||
};
|
||||
columnList.Add(column);
|
||||
}
|
||||
table.Columns = columnList;
|
||||
roleTableList.Add(table);
|
||||
}
|
||||
}
|
||||
return roleTableList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 首字母小写
|
||||
/// </summary>
|
||||
/// <param name="propertyName"></param>
|
||||
/// <returns></returns>
|
||||
private static string PropertyNameToLower(string propertyName)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(propertyName) ? null : propertyName[..1].ToLower() + propertyName[1..];
|
||||
}
|
||||
}
|
||||
@ -32,6 +32,16 @@ public static class SqlSugarFilter
|
||||
_cache.Remove($"db:{dbConfigId}:orgList:{userId}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除自定义过滤器缓存
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="dbConfigId"></param>
|
||||
public static void DeleteCustomCache(long userId, string dbConfigId)
|
||||
{
|
||||
_cache.Remove($"db:{dbConfigId}:custom:{userId}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置用户机构集合过滤器
|
||||
/// </summary>
|
||||
|
||||
@ -186,6 +186,7 @@
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import { auth } from '/@@/utils/authFunction';
|
||||
import { useUserInfo } from '/@/stores/userInfo';
|
||||
|
||||
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||
import { useVxeTable } from '/@@/hooks/useVxeTableOptionsHook';
|
||||
@ -239,6 +240,7 @@ const xGrid = ref<VxeGridInstance>();
|
||||
@:const printDialogRef = ref<InstanceType<typeof PrintDialog>>();
|
||||
}
|
||||
const editDialogRef = ref<InstanceType<typeof EditDialog>>();
|
||||
const userStore = useUserInfo();
|
||||
|
||||
// 变量
|
||||
const state = reactive({
|
||||
@ -267,6 +269,11 @@ const changeAdvanceQueryUI = () => {
|
||||
state.showAdvanceQueryUI = !state.showAdvanceQueryUI;
|
||||
};
|
||||
|
||||
// 校验表格字段权限
|
||||
const checkTableColumnVisible = (tableColumnName: any) => {
|
||||
return !userStore.userTableList.includes(tableColumnName);
|
||||
};
|
||||
|
||||
// 表格参数配置
|
||||
@if (@Model.IsApiService) {
|
||||
@:const options = useVxeTable<@(@Model.ClassName)>(
|
||||
@ -283,24 +290,24 @@ const changeAdvanceQueryUI = () => {
|
||||
if(@column.WhetherTable == "Y") {
|
||||
if(@column.EffectType == "Upload" || @column.EffectType == "fk" || @column.EffectType == "ApiTreeSelect" || @column.EffectType == "Switch" || @column.EffectType == "ConstSelector") {
|
||||
if(@column.EffectType == "Upload") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
} else if(@column.EffectType == "fk") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
} else if(@column.EffectType == "ApiTreeSelect") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
} else if(@column.EffectType == "Switch") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
} else if(@column.EffectType == "ConstSelector") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
}
|
||||
} else if(@column.EffectType == "Select") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
} else if(@column.EffectType == "EnumSelector") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||
} else if(@column.EffectType == "DatePicker") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', formatter: ({ cellValue }) => formatDate(new Date(cellValue), 'YYYY-mm-dd HH:MM:SS'), @whethersortable },
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', formatter: ({ cellValue }) => formatDate(new Date(cellValue), 'YYYY-mm-dd HH:MM:SS'), @whethersortable },
|
||||
} else {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', @whethersortable},
|
||||
@:{ visible: checkTableColumnVisible('@(@Model.LowerClassName):@(@column.LowerPropertyName)'), field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', @whethersortable},
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -320,6 +327,12 @@ const changeAdvanceQueryUI = () => {
|
||||
toolbarConfig: { export: false },
|
||||
// 行设置
|
||||
// rowConfig: { height: 80 },
|
||||
// 设置列显隐
|
||||
customConfig: {
|
||||
visibleMethod({ column }) {
|
||||
return useUserTableConfig().userTableList.includes(`@Model.LowerClassName:${column.field}`);
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.1.1" />
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.2.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0" />
|
||||
<PackageReference Include="Rezero.Api" Version="1.7.12" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "admin.net.pro",
|
||||
"type": "module",
|
||||
"version": "2.4.33",
|
||||
"lastBuildTime": "2024.11.22",
|
||||
"lastBuildTime": "2024.11.24",
|
||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||
"author": "zuohuaijun",
|
||||
"license": "MIT",
|
||||
@ -15,8 +15,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@logicflow/core": "^1.2.28",
|
||||
"@logicflow/extension": "^1.2.28",
|
||||
"@logicflow/core": "^2.0.7",
|
||||
"@logicflow/extension": "^2.0.11",
|
||||
"@microsoft/signalr": "^8.0.7",
|
||||
"@vue-office/docx": "^1.6.2",
|
||||
"@vue-office/excel": "^1.7.11",
|
||||
@ -56,13 +56,13 @@
|
||||
"relation-graph": "^2.2.9",
|
||||
"screenfull": "^6.0.2",
|
||||
"sm-crypto-v2": "^1.9.3",
|
||||
"sortablejs": "^1.15.3",
|
||||
"sortablejs": "^1.15.4",
|
||||
"splitpanes": "^3.1.5",
|
||||
"vcrontab-3": "^3.3.22",
|
||||
"vform3-builds": "^3.0.10",
|
||||
"vue": "^3.5.13",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-demi": "0.14.6",
|
||||
"vue-demi": "0.14.10",
|
||||
"vue-draggable-plus": "^0.6.0",
|
||||
"vue-grid-layout": "3.0.0-beta1",
|
||||
"vue-i18n": "^10.0.4",
|
||||
@ -82,7 +82,7 @@
|
||||
"@iconify/vue": "^4.1.2",
|
||||
"@plugin-web-update-notification/vite": "^1.7.1",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^20.16.5",
|
||||
"@types/node": "^20.17.7",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/sortablejs": "^1.15.8",
|
||||
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
||||
@ -99,7 +99,7 @@
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"sass": "^1.81.0",
|
||||
"terser": "^5.36.0",
|
||||
"typescript": "^5.6.3",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^5.4.11",
|
||||
"vite-plugin-cdn-import": "^1.0.1",
|
||||
"vite-plugin-compression2": "^1.3.1",
|
||||
|
||||
@ -22,6 +22,7 @@ import { AdminResultInt32 } from '../models';
|
||||
import { AdminResultListInt64 } from '../models';
|
||||
import { AdminResultListListString } from '../models';
|
||||
import { AdminResultListRoleOutput } from '../models';
|
||||
import { AdminResultListRoleTableOutput } from '../models';
|
||||
import { AdminResultListString } from '../models';
|
||||
import { AdminResultSqlSugarPagedListPageRoleOutput } from '../models';
|
||||
import { DeleteRoleInput } from '../models';
|
||||
@ -30,6 +31,7 @@ import { RoleApiInput } from '../models';
|
||||
import { RoleInput } from '../models';
|
||||
import { RoleMenuInput } from '../models';
|
||||
import { RoleOrgInput } from '../models';
|
||||
import { RoleTableInput } from '../models';
|
||||
import { StatusEnum } from '../models';
|
||||
import { UpdateRoleInput } from '../models';
|
||||
/**
|
||||
@ -86,6 +88,49 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有表格字段 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysRoleAllTableColumnListGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysRole/allTableColumnList`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 删除角色 🔖
|
||||
@ -278,6 +323,54 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 授权角色表格 🔖
|
||||
* @param {RoleTableInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysRoleGrantRoleTablePost: async (body?: RoleTableInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysRole/grantRoleTable`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取角色列表 🔖
|
||||
@ -540,6 +633,55 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取角色表格字段集合 🔖
|
||||
* @param {number} roleId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysRoleRoleTableRoleIdGet: async (roleId: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'roleId' is not null or undefined
|
||||
if (roleId === null || roleId === undefined) {
|
||||
throw new RequiredError('roleId','Required parameter roleId was null or undefined when calling apiSysRoleRoleTableRoleIdGet.');
|
||||
}
|
||||
const localVarPath = `/api/sysRole/roleTable/{roleId}`
|
||||
.replace(`{${"roleId"}}`, encodeURIComponent(String(roleId)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 设置角色状态 🔖
|
||||
@ -674,6 +816,49 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取当前用户表格字段集合 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysRoleUserRoleTableListGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysRole/userRoleTableList`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
@ -702,6 +887,19 @@ export const SysRoleApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有表格字段 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRoleAllTableColumnListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListRoleTableOutput>>> {
|
||||
const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleAllTableColumnListGet(options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 删除角色 🔖
|
||||
@ -758,6 +956,20 @@ export const SysRoleApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 授权角色表格 🔖
|
||||
* @param {RoleTableInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRoleGrantRoleTablePost(body?: RoleTableInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleGrantRoleTablePost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取角色列表 🔖
|
||||
@ -830,6 +1042,20 @@ export const SysRoleApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取角色表格字段集合 🔖
|
||||
* @param {number} roleId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRoleRoleTableRoleIdGet(roleId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListString>>> {
|
||||
const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleRoleTableRoleIdGet(roleId, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 设置角色状态 🔖
|
||||
@ -871,6 +1097,19 @@ export const SysRoleApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取当前用户表格字段集合 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRoleUserRoleTableListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListString>>> {
|
||||
const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleUserRoleTableListGet(options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@ -890,6 +1129,15 @@ export const SysRoleApiFactory = function (configuration?: Configuration, basePa
|
||||
async apiSysRoleAddPost(body?: AddRoleInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysRoleApiFp(configuration).apiSysRoleAddPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有表格字段 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRoleAllTableColumnListGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListRoleTableOutput>> {
|
||||
return SysRoleApiFp(configuration).apiSysRoleAllTableColumnListGet(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 删除角色 🔖
|
||||
@ -930,6 +1178,16 @@ export const SysRoleApiFactory = function (configuration?: Configuration, basePa
|
||||
async apiSysRoleGrantMenuPost(body?: RoleMenuInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysRoleApiFp(configuration).apiSysRoleGrantMenuPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 授权角色表格 🔖
|
||||
* @param {RoleTableInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRoleGrantRoleTablePost(body?: RoleTableInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysRoleApiFp(configuration).apiSysRoleGrantRoleTablePost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取角色列表 🔖
|
||||
@ -982,6 +1240,16 @@ export const SysRoleApiFactory = function (configuration?: Configuration, basePa
|
||||
async apiSysRoleRoleApiListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListString>> {
|
||||
return SysRoleApiFp(configuration).apiSysRoleRoleApiListGet(id, status, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取角色表格字段集合 🔖
|
||||
* @param {number} roleId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRoleRoleTableRoleIdGet(roleId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListString>> {
|
||||
return SysRoleApiFp(configuration).apiSysRoleRoleTableRoleIdGet(roleId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 设置角色状态 🔖
|
||||
@ -1011,6 +1279,15 @@ export const SysRoleApiFactory = function (configuration?: Configuration, basePa
|
||||
async apiSysRoleUserApiListGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListListString>> {
|
||||
return SysRoleApiFp(configuration).apiSysRoleUserApiListGet(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取当前用户表格字段集合 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRoleUserRoleTableListGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListString>> {
|
||||
return SysRoleApiFp(configuration).apiSysRoleUserRoleTableListGet(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@ -1032,6 +1309,16 @@ export class SysRoleApi extends BaseAPI {
|
||||
public async apiSysRoleAddPost(body?: AddRoleInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysRoleApiFp(this.configuration).apiSysRoleAddPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有表格字段 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysRoleApi
|
||||
*/
|
||||
public async apiSysRoleAllTableColumnListGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListRoleTableOutput>> {
|
||||
return SysRoleApiFp(this.configuration).apiSysRoleAllTableColumnListGet(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 删除角色 🔖
|
||||
@ -1076,6 +1363,17 @@ export class SysRoleApi extends BaseAPI {
|
||||
public async apiSysRoleGrantMenuPost(body?: RoleMenuInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysRoleApiFp(this.configuration).apiSysRoleGrantMenuPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 授权角色表格 🔖
|
||||
* @param {RoleTableInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysRoleApi
|
||||
*/
|
||||
public async apiSysRoleGrantRoleTablePost(body?: RoleTableInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysRoleApiFp(this.configuration).apiSysRoleGrantRoleTablePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取角色列表 🔖
|
||||
@ -1133,6 +1431,17 @@ export class SysRoleApi extends BaseAPI {
|
||||
public async apiSysRoleRoleApiListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListString>> {
|
||||
return SysRoleApiFp(this.configuration).apiSysRoleRoleApiListGet(id, status, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取角色表格字段集合 🔖
|
||||
* @param {number} roleId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysRoleApi
|
||||
*/
|
||||
public async apiSysRoleRoleTableRoleIdGet(roleId: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListString>> {
|
||||
return SysRoleApiFp(this.configuration).apiSysRoleRoleTableRoleIdGet(roleId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 设置角色状态 🔖
|
||||
@ -1165,4 +1474,14 @@ export class SysRoleApi extends BaseAPI {
|
||||
public async apiSysRoleUserApiListGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListListString>> {
|
||||
return SysRoleApiFp(this.configuration).apiSysRoleUserApiListGet(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取当前用户表格字段集合 🔖
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysRoleApi
|
||||
*/
|
||||
public async apiSysRoleUserRoleTableListGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListString>> {
|
||||
return SysRoleApiFp(this.configuration).apiSysRoleUserRoleTableListGet(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { RoleTableOutput } from './role-table-output';
|
||||
/**
|
||||
* 全局返回结果
|
||||
*
|
||||
* @export
|
||||
* @interface AdminResultListRoleTableOutput
|
||||
*/
|
||||
export interface AdminResultListRoleTableOutput {
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AdminResultListRoleTableOutput
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* 类型success、warning、error
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminResultListRoleTableOutput
|
||||
*/
|
||||
type?: string | null;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminResultListRoleTableOutput
|
||||
*/
|
||||
message?: string | null;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*
|
||||
* @type {Array<RoleTableOutput>}
|
||||
* @memberof AdminResultListRoleTableOutput
|
||||
*/
|
||||
result?: Array<RoleTableOutput> | null;
|
||||
|
||||
/**
|
||||
* 附加数据
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof AdminResultListRoleTableOutput
|
||||
*/
|
||||
extras?: any | null;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AdminResultListRoleTableOutput
|
||||
*/
|
||||
time?: Date;
|
||||
}
|
||||
@ -50,6 +50,7 @@ export * from './admin-result-list-log-vis-output';
|
||||
export * from './admin-result-list-menu-output';
|
||||
export * from './admin-result-list-pos-output';
|
||||
export * from './admin-result-list-role-output';
|
||||
export * from './admin-result-list-role-table-output';
|
||||
export * from './admin-result-list-string';
|
||||
export * from './admin-result-list-sys-code-gen-template';
|
||||
export * from './admin-result-list-sys-config';
|
||||
@ -301,6 +302,8 @@ export * from './role-input';
|
||||
export * from './role-menu-input';
|
||||
export * from './role-org-input';
|
||||
export * from './role-output';
|
||||
export * from './role-table-input';
|
||||
export * from './role-table-output';
|
||||
export * from './runtime-field-handle';
|
||||
export * from './runtime-method-handle';
|
||||
export * from './runtime-type-handle';
|
||||
@ -382,6 +385,7 @@ export * from './sys-user-ext-org';
|
||||
export * from './sys-wechat-pay';
|
||||
export * from './sys-wechat-refund';
|
||||
export * from './sys-wx-open-upload-avatar-body';
|
||||
export * from './table-column-output';
|
||||
export * from './table-output';
|
||||
export * from './tenant-id-input';
|
||||
export * from './tenant-input';
|
||||
|
||||
@ -82,30 +82,6 @@ export interface PageCodeGenInput {
|
||||
*/
|
||||
descStr?: string | null;
|
||||
|
||||
/**
|
||||
* 数据库表名
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
tableName?: string | null;
|
||||
|
||||
/**
|
||||
* 业务名(业务代码包名称)
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
busName?: string | null;
|
||||
|
||||
/**
|
||||
* 命名空间
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
nameSpace?: string | null;
|
||||
|
||||
/**
|
||||
* 作者姓名
|
||||
*
|
||||
@ -114,30 +90,6 @@ export interface PageCodeGenInput {
|
||||
*/
|
||||
authorName?: string | null;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
generateType?: string | null;
|
||||
|
||||
/**
|
||||
* 是否生成菜单
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
generateMenu?: boolean;
|
||||
|
||||
/**
|
||||
* 是否使用 Api Service
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
isApiService?: boolean;
|
||||
|
||||
/**
|
||||
* 类名
|
||||
*
|
||||
@ -186,6 +138,38 @@ export interface PageCodeGenInput {
|
||||
*/
|
||||
connectionString?: string | null;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
generateType?: string | null;
|
||||
|
||||
/**
|
||||
* 数据库表名
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
tableName?: string | null;
|
||||
|
||||
/**
|
||||
* 命名空间
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
nameSpace?: string | null;
|
||||
|
||||
/**
|
||||
* 业务名(业务代码包名称)
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
busName?: string | null;
|
||||
|
||||
/**
|
||||
* 功能名(数据库表名称)
|
||||
*
|
||||
@ -202,6 +186,14 @@ export interface PageCodeGenInput {
|
||||
*/
|
||||
menuApplication?: string | null;
|
||||
|
||||
/**
|
||||
* 是否生成菜单
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
generateMenu?: boolean;
|
||||
|
||||
/**
|
||||
* 菜单父级
|
||||
*
|
||||
@ -241,4 +233,12 @@ export interface PageCodeGenInput {
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
printName?: string | null;
|
||||
|
||||
/**
|
||||
* 是否使用 Api Service
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof PageCodeGenInput
|
||||
*/
|
||||
isApiService?: boolean;
|
||||
}
|
||||
|
||||
38
Web/src/api-services/models/role-table-input.ts
Normal file
38
Web/src/api-services/models/role-table-input.ts
Normal file
@ -0,0 +1,38 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 授权角色表格
|
||||
*
|
||||
* @export
|
||||
* @interface RoleTableInput
|
||||
*/
|
||||
export interface RoleTableInput {
|
||||
|
||||
/**
|
||||
* 主键Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof RoleTableInput
|
||||
*/
|
||||
id: number;
|
||||
|
||||
/**
|
||||
* 表格字段集合
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof RoleTableInput
|
||||
*/
|
||||
tableColumnList?: Array<string> | null;
|
||||
}
|
||||
53
Web/src/api-services/models/role-table-output.ts
Normal file
53
Web/src/api-services/models/role-table-output.ts
Normal file
@ -0,0 +1,53 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { TableColumnOutput } from './table-column-output';
|
||||
/**
|
||||
* 角色表格
|
||||
*
|
||||
* @export
|
||||
* @interface RoleTableOutput
|
||||
*/
|
||||
export interface RoleTableOutput {
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof RoleTableOutput
|
||||
*/
|
||||
id?: string | null;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof RoleTableOutput
|
||||
*/
|
||||
pid?: string | null;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof RoleTableOutput
|
||||
*/
|
||||
name?: string | null;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof RoleTableOutput
|
||||
*/
|
||||
label?: string | null;
|
||||
|
||||
/**
|
||||
* @type {Array<TableColumnOutput>}
|
||||
* @memberof RoleTableOutput
|
||||
*/
|
||||
columns?: Array<TableColumnOutput> | null;
|
||||
}
|
||||
@ -29,14 +29,6 @@ export interface SysRegion {
|
||||
*/
|
||||
id?: number;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SysRegion
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 父Id
|
||||
*
|
||||
@ -45,6 +37,14 @@ export interface SysRegion {
|
||||
*/
|
||||
pid?: number;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SysRegion
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*
|
||||
|
||||
@ -93,14 +93,6 @@ export interface SysSchedule {
|
||||
*/
|
||||
tenantId?: number | null;
|
||||
|
||||
/**
|
||||
* 日程内容
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SysSchedule
|
||||
*/
|
||||
content: string;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*
|
||||
@ -133,6 +125,14 @@ export interface SysSchedule {
|
||||
*/
|
||||
endTime?: string | null;
|
||||
|
||||
/**
|
||||
* 日程内容
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SysSchedule
|
||||
*/
|
||||
content: string;
|
||||
|
||||
/**
|
||||
* @type {FinishStatusEnum}
|
||||
* @memberof SysSchedule
|
||||
|
||||
46
Web/src/api-services/models/table-column-output.ts
Normal file
46
Web/src/api-services/models/table-column-output.ts
Normal file
@ -0,0 +1,46 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 角色表格字段
|
||||
*
|
||||
* @export
|
||||
* @interface TableColumnOutput
|
||||
*/
|
||||
export interface TableColumnOutput {
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof TableColumnOutput
|
||||
*/
|
||||
id?: string | null;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof TableColumnOutput
|
||||
*/
|
||||
pid?: string | null;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof TableColumnOutput
|
||||
*/
|
||||
name?: string | null;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @memberof TableColumnOutput
|
||||
*/
|
||||
label?: string | null;
|
||||
}
|
||||
@ -4,7 +4,7 @@ import Watermark from '/@/utils/watermark';
|
||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { SysAuthApi, SysConstApi, SysDictTypeApi } from '/@/api-services/api';
|
||||
import { SysAuthApi, SysConstApi, SysDictTypeApi, SysRoleApi } from '/@/api-services/api';
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
@ -16,6 +16,7 @@ export const useUserInfo = defineStore('userInfo', {
|
||||
constList: [] as any,
|
||||
dictList: {} as any,
|
||||
dictListInt: {} as any,
|
||||
userTableList: [] as any, // 用户表格字段数据
|
||||
}),
|
||||
getters: {
|
||||
// // 获取系统常量列表
|
||||
@ -60,6 +61,27 @@ export const useUserInfo = defineStore('userInfo', {
|
||||
// }
|
||||
},
|
||||
|
||||
// 存储用户表格列到浏览器缓存
|
||||
async setUserTables() {
|
||||
if (Session.get('userTable')) {
|
||||
this.userTableList = Session.get('userTable');
|
||||
} else {
|
||||
this.userTableList = await this.getUserTableList();
|
||||
Session.set('userTable', this.userTableList);
|
||||
}
|
||||
},
|
||||
|
||||
// 获取当前用户表格列集合
|
||||
getUserTableList() {
|
||||
return new Promise((resolve) => {
|
||||
getAPI(SysRoleApi)
|
||||
.apiSysRoleUserRoleTableListGet()
|
||||
.then(async (res: any) => {
|
||||
resolve(res.data.result ?? []);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 获取当前用户信息
|
||||
getApiUserInfo() {
|
||||
return new Promise((resolve) => {
|
||||
|
||||
1
Web/src/types/pinia.d.ts
vendored
1
Web/src/types/pinia.d.ts
vendored
@ -16,6 +16,7 @@ declare interface UserInfosState {
|
||||
constList: T[];
|
||||
dictList: T;
|
||||
dictListInt: T;
|
||||
userTableList: T[];
|
||||
}
|
||||
|
||||
// 路由缓存列表
|
||||
|
||||
@ -38,8 +38,8 @@ import { ElMessageBox } from 'element-plus';
|
||||
|
||||
import LogicFlow from '@logicflow/core';
|
||||
import { BpmnElement, InsertNodeInPolyline, Menu, MiniMap, SelectionSelect, Snapshot } from '@logicflow/extension';
|
||||
import '@logicflow/core/dist/style/index.css';
|
||||
import '@logicflow/extension/lib/style/index.css';
|
||||
import '@logicflow/core/dist/index.css';
|
||||
import '@logicflow/extension/lib/index.css';
|
||||
|
||||
import RegisterEdge from './LogicFlow/Register/RegisterEdge';
|
||||
import RegisterNode from './LogicFlow/Register/RegisterNode';
|
||||
|
||||
@ -69,7 +69,7 @@ const state = reactive({
|
||||
ruleForm: {} as any,
|
||||
dbData: [] as Array<DatabaseOutput>,
|
||||
tableData: [] as Array<TableOutput>,
|
||||
tableName: "",
|
||||
tableName: '',
|
||||
typeData: [
|
||||
{
|
||||
name: 'Add',
|
||||
|
||||
121
Web/src/views/system/role/component/grantTable.vue
Normal file
121
Web/src/views/system/role/component/grantTable.vue
Normal file
@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div class="sys-grantTable-container">
|
||||
<el-drawer v-model="state.isVisible" size="55%">
|
||||
<template #header>
|
||||
<div style="color: #fff">
|
||||
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Menu /> </el-icon>
|
||||
<span>{{ state.drawerTitle }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<NoticeBar leftIcon="iconfont icon-tongzhi2" text="非超管角色禁止授权系统核心模块表格资源!!!" :scrollable="true" style="margin: 5px" />
|
||||
</div>
|
||||
<div v-loading="state.loading">
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:data="state.roleTableData"
|
||||
node-key="id"
|
||||
show-checkbox
|
||||
:props="{ children: 'columns', label: 'label', class: 'penultimate-node' }"
|
||||
icon="ele-Grid"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
style="margin: 10px"
|
||||
/>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div style="margin-bottom: 20px; margin-right: 20px">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, onMounted, ref } from 'vue';
|
||||
import type { ElTree } from 'element-plus';
|
||||
import NoticeBar from '/@/components/noticeBar/index.vue';
|
||||
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { SysRoleApi } from '/@/api-services/api';
|
||||
import { RoleTableOutput, UpdateRoleInput } from '/@/api-services/models';
|
||||
|
||||
const ruleFormRef = ref();
|
||||
const treeRef = ref<InstanceType<typeof ElTree>>();
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
isVisible: false,
|
||||
drawerTitle: '',
|
||||
menuIdList: [] as any,
|
||||
roleId: 0,
|
||||
ruleForm: {} as UpdateRoleInput,
|
||||
roleTableData: [] as Array<RoleTableOutput>, // 表格字段数据
|
||||
});
|
||||
|
||||
// 页面初始化
|
||||
onMounted(async () => {
|
||||
state.loading = true;
|
||||
var res = await getAPI(SysRoleApi).apiSysRoleAllTableColumnListGet();
|
||||
state.roleTableData = res.data.result ?? [];
|
||||
state.loading = false;
|
||||
});
|
||||
|
||||
// 打开页面
|
||||
const openDrawer = async (row: any) => {
|
||||
state.roleId = row.id;
|
||||
state.drawerTitle = '设置角色字段黑名单【' + row.name + '】';
|
||||
|
||||
state.loading = true;
|
||||
ruleFormRef.value?.resetFields();
|
||||
treeRef.value?.setCheckedKeys([]); // 清空选中值
|
||||
state.ruleForm = JSON.parse(JSON.stringify(row));
|
||||
if (row.id != undefined) {
|
||||
var res = await getAPI(SysRoleApi).apiSysRoleRoleTableRoleIdGet(row.id);
|
||||
setTimeout(() => {
|
||||
treeRef.value?.setCheckedKeys(res.data.result ?? []);
|
||||
}, 100);
|
||||
}
|
||||
state.loading = false;
|
||||
state.isVisible = true;
|
||||
};
|
||||
|
||||
// 取消
|
||||
const cancel = () => {
|
||||
state.isVisible = false;
|
||||
};
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
state.menuIdList = treeRef.value?.getCheckedKeys() as Array<number>; //.concat(treeRef.value?.getHalfCheckedKeys());
|
||||
await getAPI(SysRoleApi).apiSysRoleGrantRoleTablePost({ id: state.roleId, tableColumnList: state.menuIdList });
|
||||
cancel();
|
||||
};
|
||||
|
||||
// 导出对象
|
||||
defineExpose({ openDrawer });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.penultimate-node) {
|
||||
.el-tree-node__children {
|
||||
padding-left: 35px;
|
||||
white-space: pre-wrap;
|
||||
line-height: 100%;
|
||||
|
||||
.el-tree-node {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.el-tree-node__content {
|
||||
padding-left: 5px !important;
|
||||
padding-right: 5px;
|
||||
|
||||
// .el-tree-node__expand-icon {
|
||||
// display: none;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -60,6 +60,7 @@
|
||||
</el-tooltip>
|
||||
<el-button icon="ele-Menu" size="small" text type="primary" @click="openGrantMenu(row)" v-auth="'sysRole/grantMenu'">授权菜单</el-button>
|
||||
<el-button icon="ele-OfficeBuilding" size="small" text type="primary" @click="openGrantData(row)" v-auth="'sysRole/grantDataScope'">授权数据</el-button>
|
||||
<el-button icon="ele-Grid" size="small" text type="primary" @click="openGrantTable(row)" v-auth="'sysRole/grantTable'">字段黑名单</el-button>
|
||||
<el-button icon="ele-Link" size="small" text type="primary" @click="openGrantApi(row)" v-auth="'sysRole/grantApi'"> 接口黑名单 </el-button>
|
||||
</template>
|
||||
</vxe-grid>
|
||||
@ -67,6 +68,7 @@
|
||||
|
||||
<EditRole ref="editRoleRef" :title="state.title" @handleQuery="handleQuery" />
|
||||
<GrantMenu ref="grantMenuRef" />
|
||||
<GrantTable ref="grantTableRef" />
|
||||
<GrantData ref="grantDataRef" @handleQuery="handleQuery" />
|
||||
<GrantApi ref="grantApiRef" />
|
||||
</div>
|
||||
@ -81,6 +83,7 @@ import { Local } from '/@/utils/storage';
|
||||
|
||||
import EditRole from '/@/views/system/role/component/editRole.vue';
|
||||
import GrantMenu from '/@/views/system/role/component/grantMenu.vue';
|
||||
import GrantTable from '/@/views/system/role/component/grantTable.vue';
|
||||
import GrantData from '/@/views/system/role/component/grantData.vue';
|
||||
import GrantApi from '/@/views/system/role/component/grantApi.vue';
|
||||
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
||||
@ -92,6 +95,7 @@ import { PageRoleInput, PageRoleOutput } from '/@/api-services/models';
|
||||
const xGrid = ref<VxeGridInstance>();
|
||||
const editRoleRef = ref<InstanceType<typeof EditRole>>();
|
||||
const grantMenuRef = ref<InstanceType<typeof GrantMenu>>();
|
||||
const grantTableRef = ref<InstanceType<typeof GrantTable>>();
|
||||
const grantDataRef = ref<InstanceType<typeof GrantData>>();
|
||||
const grantApiRef = ref<InstanceType<typeof GrantApi>>();
|
||||
const state = reactive({
|
||||
@ -124,7 +128,7 @@ const options = useVxeTable<PageRoleOutput>(
|
||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
||||
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||
{ title: '操作', fixed: 'right', width: 360, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||
{ title: '操作', fixed: 'right', width: 440, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||
],
|
||||
},
|
||||
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||
@ -211,6 +215,11 @@ const openGrantMenu = (row: any) => {
|
||||
grantMenuRef.value?.openDrawer(row);
|
||||
};
|
||||
|
||||
// 打开授权表格页面
|
||||
const openGrantTable = (row: any) => {
|
||||
grantTableRef.value?.openDrawer(row);
|
||||
};
|
||||
|
||||
// 打开授权数据范围页面
|
||||
const openGrantData = (row: any) => {
|
||||
grantDataRef.value?.openDialog(row);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user