Merge pull request 'v2-2' (#260) from jasondom/Admin.NET.Pro:v2-2 into v2

Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/260
This commit is contained in:
zuohuaijun 2025-02-14 00:23:19 +08:00
commit 7fd20084ba
42 changed files with 2505 additions and 467 deletions

View File

@ -0,0 +1,64 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 系统租户配置参数表
/// </summary>
[SugarTable(null, "系统租户配置参数表")]
[SysTable]
[SugarIndex("index_{table}_N", nameof(Name), OrderByType.Asc)]
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc, IsUnique = true)]
public partial class SysConfigTenant : EntityTenant
{
/// <summary>
/// 名称
/// </summary>
[SugarColumn(ColumnDescription = "名称", Length = 64)]
[Required, MaxLength(64)]
public virtual string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
[SugarColumn(ColumnDescription = "编码", Length = 64)]
[MaxLength(64)]
public string? Code { get; set; }
/// <summary>
/// 参数值
/// </summary>
[SugarColumn(ColumnDescription = "参数值", Length = 512)]
[MaxLength(512)]
public string? Value { get; set; }
/// <summary>
/// 是否是内置参数Y-是N-否)
/// </summary>
[SugarColumn(ColumnDescription = "是否是内置参数", DefaultValue = "1")]
public YesNoEnum SysFlag { get; set; } = YesNoEnum.Y;
/// <summary>
/// 分组编码
/// </summary>
[SugarColumn(ColumnDescription = "分组编码", Length = 64)]
[MaxLength(64)]
public string? GroupCode { get; set; }
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
public int OrderNo { get; set; } = 100;
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", Length = 256)]
[MaxLength(256)]
public string? Remark { get; set; }
}

View File

@ -12,7 +12,7 @@ namespace Admin.NET.Core;
[SugarTable(null, "系统字典值表")]
[SysTable]
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
public partial class SysDictData : EntityTenant
public partial class SysDictData : EntityBase
{
/// <summary>
/// 字典类型Id
@ -28,6 +28,13 @@ public partial class SysDictData : EntityTenant
[Navigate(NavigateType.OneToOne, nameof(DictTypeId))]
public SysDictType DictType { get; set; }
/// <summary>
/// 显示文本
/// </summary>
[SugarColumn(ColumnDescription = "显示文本", Length = 256)]
[Required, MaxLength(256)]
public virtual string Label { get; set; }
/// <summary>
/// 值
/// </summary>
@ -38,16 +45,10 @@ public partial class SysDictData : EntityTenant
/// <summary>
/// 编码
/// </summary>
/// <remarks>
/// </remarks>
[SugarColumn(ColumnDescription = "编码", Length = 256)]
[Required, MaxLength(256)]
public virtual string Code { get; set; }
/// <summary>
/// 名称
/// </summary>
[SugarColumn(ColumnDescription = "名称", Length = 256)]
[MaxLength(256)]
public virtual string? Name { get; set; }
public virtual string? Code { get; set; }
/// <summary>
/// 显示样式-标签颜色

View File

@ -0,0 +1,105 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 系统租户字典值表
/// </summary>
[SugarTable(null, "系统租户字典值表")]
[SysTable]
[SugarIndex("index_{table}_C", nameof(Code), OrderByType.Asc)]
public partial class SysDictDataTenant : EntityTenant
{
/// <summary>
/// 字典类型Id
/// </summary>
[SugarColumn(ColumnDescription = "字典类型Id")]
public long DictTypeId { get; set; }
/// <summary>
/// 字典类型
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
[Navigate(NavigateType.OneToOne, nameof(DictTypeId))]
public SysDictType DictType { get; set; }
/// <summary>
/// 显示文本
/// </summary>
[SugarColumn(ColumnDescription = "显示文本", Length = 256)]
[Required, MaxLength(256)]
public virtual string Label { get; set; }
/// <summary>
/// 值
/// </summary>
[SugarColumn(ColumnDescription = "值", Length = 256)]
[Required, MaxLength(256)]
public virtual string Value { get; set; }
/// <summary>
/// 编码
/// </summary>
/// <remarks>
/// </remarks>
[SugarColumn(ColumnDescription = "编码", Length = 256)]
public virtual string? Code { get; set; }
/// <summary>
/// 名称
/// </summary>
[SugarColumn(ColumnDescription = "名称", Length = 256)]
[MaxLength(256)]
public virtual string? Name { get; set; }
/// <summary>
/// 显示样式-标签颜色
/// </summary>
[SugarColumn(ColumnDescription = "显示样式-标签颜色", Length = 16)]
[MaxLength(16)]
public string? TagType { get; set; }
/// <summary>
/// 显示样式-Style(控制显示样式)
/// </summary>
[SugarColumn(ColumnDescription = "显示样式-Style", Length = 512)]
[MaxLength(512)]
public string? StyleSetting { get; set; }
/// <summary>
/// 显示样式-Class(控制显示样式)
/// </summary>
[SugarColumn(ColumnDescription = "显示样式-Class", Length = 512)]
[MaxLength(512)]
public string? ClassSetting { get; set; }
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
public int OrderNo { get; set; } = 100;
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", Length = 2048)]
[MaxLength(2048)]
public string? Remark { get; set; }
/// <summary>
/// 拓展数据(保存业务功能的配置项)
/// </summary>
[SugarColumn(ColumnDescription = "拓展数据(保存业务功能的配置项)", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? ExtData { get; set; }
/// <summary>
/// 状态
/// </summary>
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
public StatusEnum Status { get; set; } = StatusEnum.Enable;
}

View File

@ -54,6 +54,12 @@ public partial class SysDictType : EntityBase
[SugarColumn(ColumnDescription = "是否是内置字典", DefaultValue = "1")]
public virtual YesNoEnum SysFlag { get; set; } = YesNoEnum.Y;
/// <summary>
/// 是否是租户字典Y-是N-否)
/// </summary>
[SugarColumn(ColumnDescription = "是否是租户字典", DefaultValue = "2")]
public virtual YesNoEnum IsTenant { get; set; } = YesNoEnum.N;
/// <summary>
/// 字典值集合
/// </summary>

View File

@ -367,6 +367,18 @@ public enum ErrorCodeEnum
[ErrorCodeItemMetadata("禁止删除系统内置字典")]
D3010,
/// <summary>
/// 获取字典值集合入参有误
/// </summary>
[ErrorCodeItemMetadata("获取字典值集合入参有误")]
D3011,
/// <summary>
/// 禁止修改租户字典状态
/// </summary>
[ErrorCodeItemMetadata("禁止修改租户字典状态")]
D3012,
/// <summary>
/// 菜单已存在
/// </summary>

View File

@ -128,9 +128,9 @@ public class EnumToDictJob : IJob
{
Id = YitIdHelper.NextId(),
DictTypeId = t2.Id,
Name = u.Describe,
Value = u.Value.ToString(),
Code = u.Name,
Label = u.Describe,
Value = u.Value.ToString(),
Remark = t2.Remark,
OrderNo = u.Value + OrderOffset,
TagType = u.Theme != "" ? u.Theme : DefaultTagType,
@ -178,9 +178,10 @@ public class EnumToDictJob : IJob
var enumData = e.EnumEntities.FirstOrDefault(u => dictData.Code == u.Name);
if (enumData != null)
{
dictData.Code = enumData.Name;
dictData.Label = enumData.Describe;
dictData.Value = enumData.Value.ToString();
dictData.OrderNo = enumData.Value + OrderOffset;
dictData.Name = enumData.Describe;
dictData.TagType = enumData.Theme != "" ? enumData.Theme : dictData.TagType != "" ? dictData.TagType : DefaultTagType;
updatedSysDictData.Add(dictData);
}
@ -197,9 +198,9 @@ public class EnumToDictJob : IJob
{
Id = YitIdHelper.NextId(),
DictTypeId = updatedDictType.Id,
Name = enumData.Describe,
Value = enumData.Value.ToString(),
Code = enumData.Name,
Label = enumData.Describe,
Value = enumData.Value.ToString(),
Remark = updatedDictType.Remark,
OrderNo = enumData.Value + OrderOffset,
TagType = enumData.Theme != "" ? enumData.Theme : DefaultTagType,

View File

@ -19,61 +19,61 @@ public class SysDictDataSeedData : ISqlSugarEntitySeedData<SysDictData>
{
return
[
new SysDictData{ Id=1300000000101, DictTypeId=1300000000101, Value="输入框", Code="Input", OrderNo=100, Remark="输入框", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000102, DictTypeId=1300000000101, Value="字典选择器", Code="DictSelector", OrderNo=100, Remark="字典选择器", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000103, DictTypeId=1300000000101, Value="常量选择器", Code="ConstSelector", OrderNo=100, Remark="常量选择器", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000104, DictTypeId=1300000000101, Value="枚举选择器", Code="EnumSelector", OrderNo=100, Remark="枚举选择器", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000105, DictTypeId=1300000000101, Value="树选择器", Code="ApiTreeSelector", OrderNo=100, Remark="树选择器", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000106, DictTypeId=1300000000101, Value="外键", Code="ForeignKey", OrderNo=100, Remark="外键", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000107, DictTypeId=1300000000101, Value="数字输入框", Code="InputNumber", OrderNo=100, Remark="数字输入框", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000108, DictTypeId=1300000000101, Value="时间选择", Code="DatePicker", OrderNo=100, Remark="时间选择", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000109, DictTypeId=1300000000101, Value="文本域", Code="InputTextArea", OrderNo=100, Remark="文本域", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000110, DictTypeId=1300000000101, Value="上传", Code="Upload", OrderNo=100, Remark="上传", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000111, DictTypeId=1300000000101, Value="开关", Code="Switch", OrderNo=100, Remark="开关", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000101, DictTypeId=1300000000101, Label="输入框", Value="Input", OrderNo=100, Remark="输入框", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000102, DictTypeId=1300000000101, Label="字典选择器", Value="DictSelector", OrderNo=100, Remark="字典选择器", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000103, DictTypeId=1300000000101, Label="常量选择器", Value="ConstSelector", OrderNo=100, Remark="常量选择器", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000104, DictTypeId=1300000000101, Label="枚举选择器", Value="EnumSelector", OrderNo=100, Remark="枚举选择器", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000105, DictTypeId=1300000000101, Label="树选择器", Value="ApiTreeSelector", OrderNo=100, Remark="树选择器", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000106, DictTypeId=1300000000101, Label="外键", Value="ForeignKey", OrderNo=100, Remark="外键", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000107, DictTypeId=1300000000101, Label="数字输入框", Value="InputNumber", OrderNo=100, Remark="数字输入框", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000108, DictTypeId=1300000000101, Label="时间选择", Value="DatePicker", OrderNo=100, Remark="时间选择", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000109, DictTypeId=1300000000101, Label="文本域", Value="InputTextArea", OrderNo=100, Remark="文本域", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000110, DictTypeId=1300000000101, Label="上传", Value="Upload", OrderNo=100, Remark="上传", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000111, DictTypeId=1300000000101, Label="开关", Value="Switch", OrderNo=100, Remark="开关", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000201, DictTypeId=1300000000102, Value="等于", Code="==", OrderNo=1, Remark="等于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000202, DictTypeId=1300000000102, Value="模糊", Code="like", OrderNo=1, Remark="模糊", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000203, DictTypeId=1300000000102, Value="大于", Code=">", OrderNo=1, Remark="大于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000204, DictTypeId=1300000000102, Value="小于", Code="<", OrderNo=1, Remark="小于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000205, DictTypeId=1300000000102, Value="不等于", Code="!=", OrderNo=1, Remark="不等于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000206, DictTypeId=1300000000102, Value="大于等于", Code=">=", OrderNo=1, Remark="大于等于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000207, DictTypeId=1300000000102, Value="小于等于", Code="<=", OrderNo=1, Remark="小于等于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000208, DictTypeId=1300000000102, Value="不为空", Code="isNotNull", OrderNo=1, Remark="不为空", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000209, DictTypeId=1300000000102, Value="时间范围", Code="~", OrderNo=1, Remark="时间范围", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000201, DictTypeId=1300000000102, Label="等于", Value="==", OrderNo=1, Remark="等于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000202, DictTypeId=1300000000102, Label="模糊", Value="like", OrderNo=1, Remark="模糊", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000203, DictTypeId=1300000000102, Label="大于", Value=">", OrderNo=1, Remark="大于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000204, DictTypeId=1300000000102, Label="小于", Value="<", OrderNo=1, Remark="小于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000205, DictTypeId=1300000000102, Label="不等于", Value="!=", OrderNo=1, Remark="不等于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000206, DictTypeId=1300000000102, Label="大于等于", Value=">=", OrderNo=1, Remark="大于等于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000207, DictTypeId=1300000000102, Label="小于等于", Value="<=", OrderNo=1, Remark="小于等于", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000208, DictTypeId=1300000000102, Label="不为空", Value="isNotNull", OrderNo=1, Remark="不为空", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000209, DictTypeId=1300000000102, Label="时间范围", Value="~", OrderNo=1, Remark="时间范围", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000301, DictTypeId=1300000000103, Value="long", Code="long", OrderNo=1, Remark="long", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000302, DictTypeId=1300000000103, Value="string", Code="string", OrderNo=1, Remark="string", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000303, DictTypeId=1300000000103, Value="DateTime", Code="DateTime", OrderNo=1, Remark="DateTime", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000304, DictTypeId=1300000000103, Value="bool", Code="bool", OrderNo=1, Remark="bool", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000305, DictTypeId=1300000000103, Value="int", Code="int", OrderNo=1, Remark="int", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000306, DictTypeId=1300000000103, Value="double", Code="double", OrderNo=1, Remark="double", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000307, DictTypeId=1300000000103, Value="float", Code="float", OrderNo=1, Remark="float", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000308, DictTypeId=1300000000103, Value="decimal", Code="decimal", OrderNo=1, Remark="decimal", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000309, DictTypeId=1300000000103, Value="Guid", Code="Guid", OrderNo=1, Remark="Guid", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000310, DictTypeId=1300000000103, Value="DateTimeOffset", Code="DateTimeOffset", OrderNo=1, Remark="DateTimeOffset", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000301, DictTypeId=1300000000103, Label="long", Value="long", OrderNo=1, Remark="long", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000302, DictTypeId=1300000000103, Label="string", Value="string", OrderNo=1, Remark="string", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000303, DictTypeId=1300000000103, Label="DateTime", Value="DateTime", OrderNo=1, Remark="DateTime", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000304, DictTypeId=1300000000103, Label="bool", Value="bool", OrderNo=1, Remark="bool", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000305, DictTypeId=1300000000103, Label="int", Value="int", OrderNo=1, Remark="int", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000306, DictTypeId=1300000000103, Label="double", Value="double", OrderNo=1, Remark="double", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000307, DictTypeId=1300000000103, Label="float", Value="float", OrderNo=1, Remark="float", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000308, DictTypeId=1300000000103, Label="decimal", Value="decimal", OrderNo=1, Remark="decimal", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000309, DictTypeId=1300000000103, Label="Guid", Value="Guid", OrderNo=1, Remark="Guid", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000310, DictTypeId=1300000000103, Label="DateTimeOffset", Value="DateTimeOffset", OrderNo=1, Remark="DateTimeOffset", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000401, DictTypeId=1300000000104, Value="下载压缩包", Code="100", OrderNo=1, Remark="下载压缩包", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000402, DictTypeId=1300000000104, Value="下载压缩包(前端)", Code="111", OrderNo=2, Remark="下载压缩包(前端)", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000403, DictTypeId=1300000000104, Value="下载压缩包(后端)", Code="121", OrderNo=3, Remark="下载压缩包(后端)", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000404, DictTypeId=1300000000104, Value="生成到本项目", Code="200", OrderNo=4, Remark="生成到本项目", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
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=1300000000401, DictTypeId=1300000000104, Label="下载压缩包", Value="100", OrderNo=1, Remark="下载压缩包", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000402, DictTypeId=1300000000104, Label="下载压缩包(前端)", Value="111", OrderNo=2, Remark="下载压缩包(前端)", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000403, DictTypeId=1300000000104, Label="下载压缩包(后端)", Value="121", OrderNo=3, Remark="下载压缩包(后端)", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000404, DictTypeId=1300000000104, Label="生成到本项目", Value="200", OrderNo=4, Remark="生成到本项目", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000405, DictTypeId=1300000000104, Label="生成到本项目(前端)", Value="211", OrderNo=5, Remark="生成到本项目(前端)", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000406, DictTypeId=1300000000104, Label="生成到本项目(后端)", Value="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.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=1300000000501, DictTypeId=1300000000105, Label="EntityBaseId【基础实体Id】", Value="EntityBaseId", OrderNo=1, Remark="【基础实体Id】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000502, DictTypeId=1300000000105, Label="EntityBase【基础实体】", Value="EntityBase", OrderNo=1, Remark="【基础实体】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000503, DictTypeId=1300000000105, Label="EntityTenantId【租户实体Id】", Value="EntityTenantId", OrderNo=1, Remark="【租户实体Id】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000504, DictTypeId=1300000000105, Label="EntityTenant【租户实体】", Value="EntityTenant", OrderNo=1, Remark="【租户实体】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000505, DictTypeId=1300000000105, Label="EntityBaseData【业务实体】", Value="EntityBaseData", OrderNo=1, Remark="【业务实体】", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
new SysDictData{ Id=1300000000506, DictTypeId=1300000000105, Label="EntityTenantBaseData【租户业务实体】", Value="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") },
new SysDictData{ Id=1300000000601, DictTypeId=1300000000106, Label="不需要", Value="off", OrderNo=100, Remark="不需要打印支持", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-12-04 00:00:00") },
new SysDictData{ Id=1300000000602, DictTypeId=1300000000106, Label="绑定打印模版", Value="custom", OrderNo=101, Remark="绑定打印模版", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-12-04 00:00:00") },
new SysDictData{ Id=1300000000701, DictTypeId=1300000000201, Value="集团", Code="101", OrderNo=100, Remark="集团", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000702, DictTypeId=1300000000201, Value="公司", Code="201", OrderNo=101, Remark="公司", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000703, DictTypeId=1300000000201, Value="部门", Code="301", OrderNo=102, Remark="部门", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000704, DictTypeId=1300000000201, Value="区域", Code="401", OrderNo=103, Remark="区域", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000705, DictTypeId=1300000000201, Value="组", Code="501", OrderNo=104, Remark="组", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000701, DictTypeId=1300000000201, Label="集团", Value="101", OrderNo=100, Remark="集团", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000702, DictTypeId=1300000000201, Label="公司", Value="201", OrderNo=101, Remark="公司", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000703, DictTypeId=1300000000201, Label="部门", Value="301", OrderNo=102, Remark="部门", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000704, DictTypeId=1300000000201, Label="区域", Value="401", OrderNo=103, Remark="区域", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
new SysDictData{ Id=1300000000705, DictTypeId=1300000000201, Label="组", Value="501", OrderNo=104, Remark="组", Status=StatusEnum.Enable, CreateTime=DateTime.Parse("2023-02-10 00:00:00") },
];
}
}

View File

@ -0,0 +1,49 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core.Service;
public class ConfigTenantInput : BaseIdInput;
public class PageConfigTenantInput : BasePageInput
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 分组编码
/// </summary>
public string GroupCode { get; set; }
}
public class AddConfigTenantInput : SysConfigTenant;
public class UpdateConfigTenantInput : AddConfigTenantInput;
public class DeleteConfigTenantInput : BaseIdInput;
/// <summary>
/// 批量配置参数输入
/// </summary>
public class BatchConfigTenantInput
{
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 属性值
/// </summary>
public string Value { get; set; }
}

View File

@ -182,8 +182,7 @@ public class SysConfigService : IDynamicApiController, ITransient
var value = _sysCacheService.Get<string>($"{CacheConst.KeyConfig}{code}");
if (string.IsNullOrEmpty(value))
{
var config = await _sysConfigRep.CopyNew().GetFirstAsync(u => u.Code == code);
value = config != null ? config.Value : default;
value = (await _sysConfigRep.CopyNew().GetFirstAsync(u => u.Code == code))?.Value;
_sysCacheService.Set($"{CacheConst.KeyConfig}{code}", value);
}
if (string.IsNullOrWhiteSpace(value)) return default;

View File

@ -0,0 +1,253 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core.Service;
/// <summary>
/// 系统租户配置参数服务 🧩
/// </summary>
[ApiDescriptionSettings(Order = 440, Description = "租户配置参数")]
public class SysConfigTenantService : IDynamicApiController, ITransient
{
private readonly SysCacheService _sysCacheService;
private readonly SqlSugarRepository<SysConfigTenant> _sysConfigRep;
public SysConfigTenantService(SysCacheService sysCacheService,
SqlSugarRepository<SysConfigTenant> sysConfigRep)
{
_sysCacheService = sysCacheService;
_sysConfigRep = sysConfigRep;
}
/// <summary>
/// 获取配置参数分页列表 🔖
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[DisplayName("获取配置参数分页列表")]
public async Task<SqlSugarPagedList<SysConfigTenant>> Page(PageConfigTenantInput input)
{
return await _sysConfigRep.AsQueryable()
.Where(u => u.GroupCode != ConfigConst.SysWebConfigGroup || u.GroupCode == null) // 不显示 WebConfig 分组
.WhereIF(!string.IsNullOrWhiteSpace(input.Name?.Trim()), u => u.Name.Contains(input.Name))
.WhereIF(!string.IsNullOrWhiteSpace(input.Code?.Trim()), u => u.Code.Contains(input.Code))
.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
.OrderBuilder(input)
.ToPagedListAsync(input.Page, input.PageSize);
}
/// <summary>
/// 获取配置参数列表 🔖
/// </summary>
/// <returns></returns>
[DisplayName("获取配置参数列表")]
public async Task<List<SysConfigTenant>> List(PageConfigTenantInput input)
{
return await _sysConfigRep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
.ToListAsync();
}
/// <summary>
/// 增加配置参数 🔖
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "Add"), HttpPost]
[DisplayName("增加配置参数")]
public async Task AddConfig(AddConfigTenantInput input)
{
var isExist = await _sysConfigRep.IsAnyAsync(u => u.Name == input.Name || u.Code == input.Code);
if (isExist) throw Oops.Oh(ErrorCodeEnum.D9000);
await _sysConfigRep.InsertAsync(input.Adapt<SysConfigTenant>());
}
/// <summary>
/// 更新配置参数 🔖
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "Update"), HttpPost]
[DisplayName("更新配置参数")]
[UnitOfWork]
public async Task UpdateConfig(UpdateConfigTenantInput input)
{
var isExist = await _sysConfigRep.IsAnyAsync(u => (u.Name == input.Name || u.Code == input.Code) && u.Id != input.Id);
if (isExist) throw Oops.Oh(ErrorCodeEnum.D9000);
//// 若修改国密SM2密匙则密码重新加密
//if (input.Code == ConfigConst.SysSM2Key && CryptogramUtil.CryptoType == CryptogramEnum.SM2.ToString())
//{
// var sysUserRep = _sysConfigRep.ChangeRepository<SqlSugarRepository<SysUser>>();
// var sysUsers = await sysUserRep.AsQueryable().Select(u => new { u.Id, u.Password }).ToListAsync();
// foreach(var user in sysUsers)
// {
// user.Password = CryptogramUtil.Encrypt(CryptogramUtil.Decrypt(user.Password));
// }
// await sysUserRep.AsUpdateable(sysUsers).UpdateColumns(u => new { u.Password }).ExecuteCommandAsync();
//}
var config = input.Adapt<SysConfigTenant>();
await _sysConfigRep.AsUpdateable(config).IgnoreColumns(true).ExecuteCommandAsync();
RemoveConfigCache(config);
}
/// <summary>
/// 删除配置参数 🔖
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "Delete"), HttpPost]
[DisplayName("删除配置参数")]
public async Task DeleteConfig(DeleteConfigTenantInput input)
{
var config = await _sysConfigRep.GetByIdAsync(input.Id);
// 禁止删除系统参数
if (config.SysFlag == YesNoEnum.Y) throw Oops.Oh(ErrorCodeEnum.D9001);
await _sysConfigRep.DeleteAsync(config);
RemoveConfigCache(config);
}
/// <summary>
/// 批量删除配置参数 🔖
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "BatchDelete"), HttpPost]
[DisplayName("批量删除配置参数")]
public async Task BatchDeleteConfig(List<long> ids)
{
foreach (var id in ids)
{
var config = await _sysConfigRep.GetByIdAsync(id);
// 禁止删除系统参数
if (config.SysFlag == YesNoEnum.Y) continue;
await _sysConfigRep.DeleteAsync(config);
RemoveConfigCache(config);
}
}
/// <summary>
/// 获取配置参数详情 🔖
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[DisplayName("获取配置参数详情")]
public async Task<SysConfigTenant> GetDetail([FromQuery] ConfigTenantInput input)
{
return await _sysConfigRep.GetByIdAsync(input.Id);
}
/// <summary>
/// 根据Code获取配置参数
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[NonAction]
public async Task<SysConfigTenant> GetConfig(string code)
{
return await _sysConfigRep.GetFirstAsync(u => u.Code == code);
}
/// <summary>
/// 根据Code获取配置参数值 🔖
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[DisplayName("根据Code获取配置参数值")]
public async Task<string> GetConfigValueByCode(string code)
{
return await GetConfigValueByCode<string>(code);
}
/// <summary>
/// 获取配置参数值
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[NonAction]
public async Task<T> GetConfigValueByCode<T>(string code)
{
if (string.IsNullOrWhiteSpace(code)) return default;
var value = _sysCacheService.Get<string>($"{CacheConst.KeyConfig}{code}");
if (string.IsNullOrEmpty(value))
{
value = (await _sysConfigRep.CopyNew().GetFirstAsync(u => u.Code == code))?.Value;
_sysCacheService.Set($"{CacheConst.KeyConfig}{code}", value);
}
if (string.IsNullOrWhiteSpace(value)) return default;
return (T)Convert.ChangeType(value, typeof(T));
}
/// <summary>
/// 更新配置参数值
/// </summary>
/// <param name="code"></param>
/// <param name="value"></param>
/// <returns></returns>
[NonAction]
public async Task UpdateConfigValue(string code, string value)
{
var config = await _sysConfigRep.GetFirstAsync(u => u.Code == code);
if (config == null) return;
config.Value = value;
await _sysConfigRep.AsUpdateable(config).ExecuteCommandAsync();
RemoveConfigCache(config);
}
/// <summary>
/// 获取分组列表 🔖
/// </summary>
/// <returns></returns>
[DisplayName("获取分组列表")]
public async Task<List<string>> GetGroupList()
{
return await _sysConfigRep.AsQueryable()
.Where(u => u.GroupCode != ConfigConst.SysWebConfigGroup || u.GroupCode == null) // 不显示 WebConfig 分组
.GroupBy(u => u.GroupCode)
.Select(u => u.GroupCode).ToListAsync();
}
/// <summary>
/// 批量更新配置参数值 🔖
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "BatchUpdate"), HttpPost]
[DisplayName("批量更新配置参数值")]
public async Task BatchUpdateConfig(List<BatchConfigTenantInput> input)
{
foreach (var config in input)
{
var configInfo = await _sysConfigRep.GetFirstAsync(u => u.Code == config.Code);
if (configInfo == null) continue;
await _sysConfigRep.AsUpdateable().SetColumns(u => u.Value == config.Value).Where(u => u.Code == config.Code).ExecuteCommandAsync();
RemoveConfigCache(configInfo);
}
}
/// <summary>
/// 清除配置缓存
/// </summary>
/// <param name="config"></param>
private void RemoveConfigCache(SysConfigTenant config)
{
_sysCacheService.Remove($"{CacheConst.KeyConfig}Value:{config.Code}");
_sysCacheService.Remove($"{CacheConst.KeyConfig}Remark:{config.Code}");
_sysCacheService.Remove($"{CacheConst.KeyConfig}{config.GroupCode}:GroupWithCache");
_sysCacheService.Remove($"{CacheConst.KeyConfig}{config.Code}");
}
}

View File

@ -18,9 +18,9 @@ public class PageDictDataInput : BasePageInput
public long DictTypeId { get; set; }
/// <summary>
///
/// 文本
/// </summary>
public string Value { get; set; }
public string Label { get; set; }
/// <summary>
/// 编码
@ -52,10 +52,10 @@ public class GetDataDictDataInput
public class QueryDictDataInput
{
/// <summary>
/// 编码
///
/// </summary>
[Required(ErrorMessage = "字典唯一编码不能为空")]
public string Code { get; set; }
[Required(ErrorMessage = "字典不能为空")]
public string Value { get; set; }
/// <summary>
/// 状态

View File

@ -13,6 +13,7 @@ namespace Admin.NET.Core.Service;
public class SysDictDataService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<SysDictData> _sysDictDataRep;
public readonly ISugarQueryable<SysDictData> VSysDictData;
private readonly SysCacheService _sysCacheService;
private readonly UserManager _userManager;
@ -23,6 +24,10 @@ public class SysDictDataService : IDynamicApiController, ITransient
_userManager = userManager;
_sysDictDataRep = sysDictDataRep;
_sysCacheService = sysCacheService;
VSysDictData = _sysDictDataRep.Context.UnionAll(
_sysDictDataRep.AsQueryable(),
_sysDictDataRep.Change<SysDictDataTenant>().AsQueryable()
.Select<SysDictData>());
}
/// <summary>
@ -33,11 +38,11 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("获取字典值分页列表")]
public async Task<SqlSugarPagedList<SysDictData>> Page(PageDictDataInput input)
{
return await _sysDictDataRep.AsQueryable()
return await VSysDictData
.Where(u => u.DictTypeId == input.DictTypeId)
.WhereIF(!string.IsNullOrEmpty(input.Code?.Trim()), u => u.Code.Contains(input.Code))
.WhereIF(!string.IsNullOrEmpty(input.Value?.Trim()), u => u.Value.Contains(input.Value))
.OrderBy(u => new { u.TenantId, u.OrderNo, u.Code })
.WhereIF(!string.IsNullOrEmpty(input.Label?.Trim()), u => u.Label.Contains(input.Label))
.OrderBy(u => new { u.OrderNo, u.Code })
.ToPagedListAsync(input.Page, input.PageSize);
}
@ -60,14 +65,16 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("增加字典值")]
public async Task AddDictData(AddDictDataInput input)
{
var isExist = await _sysDictDataRep.IsAnyAsync(u => u.Code == input.Code && u.DictTypeId == input.DictTypeId);
var isExist = await VSysDictData.AnyAsync(u => u.Code == input.Code && u.DictTypeId == input.DictTypeId);
if (isExist) throw Oops.Oh(ErrorCodeEnum.D3003);
var dictType = await _sysDictDataRep.Change<SysDictType>().GetByIdAsync(input.DictTypeId);
if (dictType.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D3008);
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictType.Code}");
await _sysDictDataRep.InsertAsync(input.Adapt<SysDictData>());
dynamic dictData = dictType.IsTenant == YesNoEnum.Y ? input.Adapt<SysDictDataTenant>() : input.Adapt<SysDictData>();
await _sysDictDataRep.Context.Insertable(dictData).ExecuteCommandAsync();
}
/// <summary>
@ -80,17 +87,18 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("更新字典值")]
public async Task UpdateDictData(UpdateDictDataInput input)
{
var isExist = await _sysDictDataRep.IsAnyAsync(u => u.Id == input.Id);
var isExist = await VSysDictData.AnyAsync(u => u.Id == input.Id);
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3004);
isExist = await _sysDictDataRep.IsAnyAsync(u => u.Code == input.Code && u.DictTypeId == input.DictTypeId && u.Id != input.Id);
isExist = await VSysDictData.AnyAsync(u => u.Code == input.Code && u.DictTypeId == input.DictTypeId && u.Id != input.Id);
if (isExist) throw Oops.Oh(ErrorCodeEnum.D3003);
var dictType = await _sysDictDataRep.Change<SysDictType>().GetByIdAsync(input.DictTypeId);
if (dictType.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D3009);
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictType.Code}");
await _sysDictDataRep.UpdateAsync(input.Adapt<SysDictData>());
dynamic dictData = dictType.IsTenant == YesNoEnum.Y ? input.Adapt<SysDictDataTenant>() : input.Adapt<SysDictData>();
await _sysDictDataRep.Context.Updateable(dictData).ExecuteCommandAsync();
}
/// <summary>
@ -103,13 +111,14 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("删除字典值")]
public async Task DeleteDictData(DeleteDictDataInput input)
{
var dictData = await _sysDictDataRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
var dictData = await VSysDictData.FirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
var dictType = await _sysDictDataRep.Change<SysDictType>().GetByIdAsync(dictData.DictTypeId);
if (dictType.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D3010);
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictType.Code}");
await _sysDictDataRep.DeleteAsync(dictData);
dynamic entity = dictType.IsTenant == YesNoEnum.Y ? input.Adapt<SysDictDataTenant>() : input.Adapt<SysDictData>();
await _sysDictDataRep.Context.Deleteable(entity).ExecuteCommandAsync();
}
/// <summary>
@ -120,7 +129,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("获取字典值详情")]
public async Task<SysDictData> GetDetail([FromQuery] DictDataInput input)
{
return await _sysDictDataRep.GetByIdAsync(input.Id);
return (await VSysDictData.FirstAsync(u => u.Id == input.Id))?.Adapt<SysDictData>();
}
/// <summary>
@ -132,7 +141,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("修改字典值状态")]
public async Task SetStatus(DictDataInput input)
{
var dictData = await _sysDictDataRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
var dictData = await VSysDictData.FirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D3004);
var dictType = await _sysDictDataRep.Change<SysDictType>().GetByIdAsync(dictData.DictTypeId);
if (dictType.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D3009);
@ -140,7 +149,8 @@ public class SysDictDataService : IDynamicApiController, ITransient
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictType.Code}");
dictData.Status = input.Status;
await _sysDictDataRep.AsUpdateable(dictData).UpdateColumns(u => new { u.Status }, true).ExecuteCommandAsync();
dynamic entity = dictType.IsTenant == YesNoEnum.Y ? input.Adapt<SysDictDataTenant>() : input.Adapt<SysDictData>();
await _sysDictDataRep.Context.Updateable(entity).ExecuteCommandAsync();
}
/// <summary>
@ -151,18 +161,7 @@ public class SysDictDataService : IDynamicApiController, ITransient
[NonAction]
public async Task<List<SysDictData>> GetDictDataListByDictTypeId(long dictTypeId)
{
var dictType = await _sysDictDataRep.Change<SysDictType>().GetByIdAsync(dictTypeId);
var dictDataList = _sysCacheService.Get<List<SysDictData>>($"{CacheConst.KeyDict}{dictType.Code}");
if (dictDataList == null)
{
dictDataList = await _sysDictDataRep.AsQueryable().ClearFilter()
.InnerJoin<SysDictType>((u, a) => u.DictTypeId == a.Id)
.Where((u, a) => a.SysFlag == YesNoEnum.Y || u.TenantId == _userManager.TenantId)
.Where(u => u.DictTypeId == dictTypeId).OrderBy(u => new { u.OrderNo, u.Code }).ToListAsync();
_sysCacheService.Set($"{CacheConst.KeyDict}{dictType.Code}", dictDataList);
}
return dictDataList;
return await GetDataListByIdOrCode(dictTypeId, null);
}
/// <summary>
@ -173,16 +172,41 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("根据字典类型编码获取字典值集合")]
public async Task<List<SysDictData>> GetDataList(string code)
{
var dictDataList = _sysCacheService.Get<List<SysDictData>>($"{CacheConst.KeyDict}{code}");
return await GetDataListByIdOrCode(null, code);
}
/// <summary>
/// 获取字典值集合 🔖
/// </summary>
/// <param name="typeId"></param>
/// <param name="code"></param>
/// <returns></returns>
[NonAction]
public async Task<List<SysDictData>> GetDataListByIdOrCode(long? typeId, string code)
{
if (string.IsNullOrWhiteSpace(code) && typeId == null ||
!string.IsNullOrWhiteSpace(code) && typeId != null)
throw Oops.Oh(ErrorCodeEnum.D3011);
var dictType = await _sysDictDataRep.Change<SysDictType>().AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(code), u => u.Code == code)
.WhereIF(typeId != null, u => u.Id == typeId)
.FirstAsync();
if (dictType == null) return null;
var dictDataList = _sysCacheService.Get<List<SysDictData>>($"{CacheConst.KeyDict}{dictType.Code}");
if (dictDataList == null)
{
dictDataList = await _sysDictDataRep.Change<SysDictType>().AsQueryable()
.LeftJoin<SysDictData>((u, a) => u.Id == a.DictTypeId).ClearFilter()
.Where((u, a) => u.SysFlag == YesNoEnum.Y || a.TenantId == _userManager.TenantId)
.Where((u, a) => u.Code == code && u.Status == StatusEnum.Enable && a.Status == StatusEnum.Enable)
.OrderBy((u, a) => new { a.OrderNo, a.Code })
.Select((u, a) => a).ToListAsync();
_sysCacheService.Set($"{CacheConst.KeyDict}{code}", dictDataList);
dictDataList = await VSysDictData.InnerJoin<SysDictType>((u, a) => u.DictTypeId == a.Id)
.Where(u => u.DictTypeId == dictType.Id)
.Select((u, a) => new SysDictData
{
Status = u.Status == StatusEnum.Enable && a.Status == StatusEnum.Enable ? StatusEnum.Enable : StatusEnum.Disable,
}, true)
.OrderBy(u => new { u.OrderNo, u.Code })
.ToListAsync();
_sysCacheService.Set($"{CacheConst.KeyDict}{dictType.Code}", dictDataList);
}
return dictDataList;
}
@ -195,13 +219,9 @@ public class SysDictDataService : IDynamicApiController, ITransient
[DisplayName("根据查询条件获取字典值集合")]
public async Task<List<SysDictData>> GetDataList([FromQuery] QueryDictDataInput input)
{
return await _sysDictDataRep.Change<SysDictType>().AsQueryable()
.LeftJoin<SysDictData>((u, a) => u.Id == a.DictTypeId).ClearFilter()
.Where((u, a) => u.SysFlag == YesNoEnum.Y || a.TenantId == _userManager.TenantId)
.Where((u, a) => u.Code == input.Code)
.WhereIF(input.Status.HasValue, (u, a) => u.Status == (StatusEnum)input.Status.Value && a.Status == (StatusEnum)input.Status.Value)
.OrderBy((u, a) => new { a.OrderNo, a.Code })
.Select((u, a) => a).ToListAsync();
var dataList = await GetDataList(input.Value);
if (input.Status.HasValue) return dataList.Where(u => u.Status == (StatusEnum)input.Status.Value).ToList();
return dataList;
}
/// <summary>
@ -212,9 +232,12 @@ public class SysDictDataService : IDynamicApiController, ITransient
[NonAction]
public async Task DeleteDictData(long dictTypeId)
{
var dictTypeCode = await _sysDictDataRep.AsQueryable().Where(u => u.DictTypeId == dictTypeId).Select(u => u.DictType.Code).FirstAsync();
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictTypeCode}");
var dictType = await _sysDictDataRep.Change<SysDictType>().AsQueryable().Where(u => u.Id == dictTypeId).FirstAsync();
_sysCacheService.Remove($"{CacheConst.KeyDict}{dictType?.Code}");
await _sysDictDataRep.DeleteAsync(u => u.DictTypeId == dictTypeId);
if (dictType?.IsTenant == YesNoEnum.Y)
await _sysDictDataRep.Change<SysDictDataTenant>().DeleteAsync(u => u.DictTypeId == dictTypeId);
else
await _sysDictDataRep.DeleteAsync(u => u.DictTypeId == dictTypeId);
}
}

View File

@ -36,7 +36,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
public async Task<SqlSugarPagedList<SysDictType>> Page(PageDictTypeInput input)
{
return await _sysDictTypeRep.AsQueryable()
.WhereIF(!_userManager.SuperAdmin, u => u.SysFlag == YesNoEnum.N)
.WhereIF(!_userManager.SuperAdmin, u => u.IsTenant == YesNoEnum.Y)
.WhereIF(!string.IsNullOrEmpty(input.Code?.Trim()), u => u.Code.Contains(input.Code))
.WhereIF(!string.IsNullOrEmpty(input.Name?.Trim()), u => u.Name.Contains(input.Name))
.OrderBy(u => new { u.OrderNo, u.Code })
@ -94,6 +94,7 @@ public class SysDictTypeService : IDynamicApiController, ITransient
public async Task UpdateDictType(UpdateDictTypeInput input)
{
var dict = await _sysDictTypeRep.GetFirstAsync(x => x.Id == input.Id);
if (dict.IsTenant != input.IsTenant) throw Oops.Oh(ErrorCodeEnum.D3012);
if (dict == null) throw Oops.Oh(ErrorCodeEnum.D3000);
if (dict.Code.ToLower().EndsWith("enum") && input.Code != dict.Code) throw Oops.Oh(ErrorCodeEnum.D3007);
@ -161,10 +162,9 @@ public class SysDictTypeService : IDynamicApiController, ITransient
public async Task<dynamic> GetAllDictList()
{
var ds = await _sysDictTypeRep.AsQueryable()
.InnerJoin<SysDictData>((u, a) => u.Id == a.DictTypeId).ClearFilter()
.Where((u, a) => u.SysFlag == YesNoEnum.Y || a.TenantId == _userManager.TenantId)
.Where((u, a) => u.IsDelete == false && a.IsDelete == false && u.Status == StatusEnum.Enable && a.Status == StatusEnum.Enable)
.Select((u, a) => new { TypeCode = u.Code, a.Code, a.Name, a.Value, a.Remark, a.OrderNo, a.TagType, a.ExtData })
.InnerJoin(_sysDictDataService.VSysDictData, (u, a) => u.Id == a.DictTypeId)
.Where((u, a) => u.Status == StatusEnum.Enable && a.Status == StatusEnum.Enable)
.Select((u, a) => new { TypeCode = u.Code, a.Label, a.Value, a.Code, a.Remark, a.OrderNo, a.TagType, a.ExtData })
.ToListAsync();
return ds.OrderBy(u => u.OrderNo).GroupBy(u => u.TypeCode).ToDictionary(u => u.Key, u => u);
}

View File

@ -389,8 +389,8 @@ public static class CommonUtil
.Where((u, a) => u.Status == StatusEnum.Enable && a.Status == StatusEnum.Enable)
.Select((u, a) => new
{
Label = a.Value,
Value = a.Code
a.Label,
a.Value
}).ToList()
.ToDictionary(u => u.Label, u => u.Value.ParseTo(targetProp.PropertyType));
propMappings.Add(propertyInfo.Name, new Tuple<Dictionary<string, object>, PropertyInfo, PropertyInfo>(mappingValues, propertyInfo, targetProp));
@ -431,8 +431,8 @@ public static class CommonUtil
.Where((u, a) => u.Status == StatusEnum.Enable && a.Status == StatusEnum.Enable)
.Select((u, a) => new
{
Label = a.Value,
Value = a.Code
a.Label,
a.Value
}).ToList()
.ToDictionary(u => u.Value.ParseTo(targetProp.PropertyType), u => u.Label);
propMappings.Add(propertyInfo.Name, new Tuple<Dictionary<object, string>, PropertyInfo, PropertyInfo>(mappingValues, targetProp, propertyInfo));

View File

@ -115,8 +115,8 @@ public class ExcelHelper
var dict = prop.GetCustomAttribute<DictAttribute>();
if (dict != null)
{
// 填充字典值value为下列表
dataList = sysDictTypeService.GetDataList(new GetDataDictTypeInput { Code = dict.DictTypeCode }).Result?.Select(u => u.Value).ToList();
// 填充字典值value为下列表
dataList = sysDictTypeService.GetDataList(new GetDataDictTypeInput { Code = dict.DictTypeCode }).Result?.Select(u => u.Label).ToList();
}
}
}

View File

@ -10,8 +10,7 @@
* 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 * from './apis/apijsonapi';
*/export * from './apis/apijsonapi';
export * from './apis/sys-alipay-api';
export * from './apis/sys-auth-api';
export * from './apis/sys-cache-api';
@ -20,6 +19,7 @@ export * from './apis/sys-code-gen-config-api';
export * from './apis/sys-code-gen-template-api';
export * from './apis/sys-common-api';
export * from './apis/sys-config-api';
export * from './apis/sys-config-tenant-api';
export * from './apis/sys-const-api';
export * from './apis/sys-database-api';
export * from './apis/sys-db-backup-api';

View File

@ -0,0 +1,890 @@
/* 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 globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { AddConfigTenantInput } from '../models';
import { AdminNETResultListString } from '../models';
import { AdminNETResultListSysConfigTenant } from '../models';
import { AdminNETResultSqlSugarPagedListSysConfigTenant } from '../models';
import { AdminNETResultString } from '../models';
import { AdminNETResultSysConfigTenant } from '../models';
import { BatchConfigTenantInput } from '../models';
import { DeleteConfigTenantInput } from '../models';
import { PageConfigTenantInput } from '../models';
import { UpdateConfigTenantInput } from '../models';
/**
* SysConfigTenantApi - axios parameter creator
* @export
*/
export const SysConfigTenantApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary 🔖
* @param {AddConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantAddPost: async (body?: AddConfigTenantInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfigTenant/add`;
// 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 🔖
* @param {Array<number>} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantBatchDeletePost: async (body?: Array<number>, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfigTenant/batchDelete`;
// 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 🔖
* @param {Array<BatchConfigTenantInput>} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantBatchUpdatePost: async (body?: Array<BatchConfigTenantInput>, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfigTenant/batchUpdate`;
// 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 Code获取配置参数值 🔖
* @param {string} code
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantConfigValueByCodeCodeGet: async (code: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'code' is not null or undefined
if (code === null || code === undefined) {
throw new RequiredError('code','Required parameter code was null or undefined when calling apiSysConfigTenantConfigValueByCodeCodeGet.');
}
const localVarPath = `/api/sysConfigTenant/configValueByCode/{code}`
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
// 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 🔖
* @param {DeleteConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantDeletePost: async (body?: DeleteConfigTenantInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfigTenant/delete`;
// 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 🔖
* @param {number} id Id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantDetailGet: async (id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysConfigTenantDetailGet.');
}
const localVarPath = `/api/sysConfigTenant/detail`;
// 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;
}
if (id !== undefined) {
localVarQueryParameter['Id'] = id;
}
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 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantGroupListGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfigTenant/groupList`;
// 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 🔖
* @param {PageConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantListPost: async (body?: PageConfigTenantInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfigTenant/list`;
// 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 🔖
* @param {PageConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantPagePost: async (body?: PageConfigTenantInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfigTenant/page`;
// 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 🔖
* @param {UpdateConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigTenantUpdatePost: async (body?: UpdateConfigTenantInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfigTenant/update`;
// 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,
};
},
}
};
/**
* SysConfigTenantApi - functional programming interface
* @export
*/
export const SysConfigTenantApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary 🔖
* @param {AddConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantAddPost(body?: AddConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantAddPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {Array<number>} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantBatchDeletePost(body?: Array<number>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantBatchDeletePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {Array<BatchConfigTenantInput>} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantBatchUpdatePost(body?: Array<BatchConfigTenantInput>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantBatchUpdatePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary Code获取配置参数值 🔖
* @param {string} code
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantConfigValueByCodeCodeGet(code: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultString>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantConfigValueByCodeCodeGet(code, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {DeleteConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantDeletePost(body?: DeleteConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantDeletePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {number} id Id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantDetailGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSysConfigTenant>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantDetailGet(id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantGroupListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultListString>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantGroupListGet(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {PageConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantListPost(body?: PageConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultListSysConfigTenant>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantListPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {PageConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantPagePost(body?: PageConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSqlSugarPagedListSysConfigTenant>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantPagePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
* @param {UpdateConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantUpdatePost(body?: UpdateConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantUpdatePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* SysConfigTenantApi - factory interface
* @export
*/
export const SysConfigTenantApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @summary 🔖
* @param {AddConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantAddPost(body?: AddConfigTenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantAddPost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {Array<number>} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantBatchDeletePost(body?: Array<number>, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantBatchDeletePost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {Array<BatchConfigTenantInput>} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantBatchUpdatePost(body?: Array<BatchConfigTenantInput>, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantBatchUpdatePost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Code获取配置参数值 🔖
* @param {string} code
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantConfigValueByCodeCodeGet(code: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultString>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantConfigValueByCodeCodeGet(code, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {DeleteConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantDeletePost(body?: DeleteConfigTenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantDeletePost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {number} id Id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantDetailGet(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSysConfigTenant>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantDetailGet(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantGroupListGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultListString>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantGroupListGet(options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {PageConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantListPost(body?: PageConfigTenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultListSysConfigTenant>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantListPost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {PageConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantPagePost(body?: PageConfigTenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSqlSugarPagedListSysConfigTenant>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantPagePost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {UpdateConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigTenantUpdatePost(body?: UpdateConfigTenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(configuration).apiSysConfigTenantUpdatePost(body, options).then((request) => request(axios, basePath));
},
};
};
/**
* SysConfigTenantApi - object-oriented interface
* @export
* @class SysConfigTenantApi
* @extends {BaseAPI}
*/
export class SysConfigTenantApi extends BaseAPI {
/**
*
* @summary 🔖
* @param {AddConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantAddPost(body?: AddConfigTenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantAddPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {Array<number>} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantBatchDeletePost(body?: Array<number>, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantBatchDeletePost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {Array<BatchConfigTenantInput>} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantBatchUpdatePost(body?: Array<BatchConfigTenantInput>, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantBatchUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Code获取配置参数值 🔖
* @param {string} code
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantConfigValueByCodeCodeGet(code: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultString>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantConfigValueByCodeCodeGet(code, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {DeleteConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantDeletePost(body?: DeleteConfigTenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantDeletePost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {number} id Id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantDetailGet(id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSysConfigTenant>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantDetailGet(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantGroupListGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultListString>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantGroupListGet(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {PageConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantListPost(body?: PageConfigTenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultListSysConfigTenant>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantListPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {PageConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantPagePost(body?: PageConfigTenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSqlSugarPagedListSysConfigTenant>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantPagePost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {UpdateConfigTenantInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigTenantApi
*/
public async apiSysConfigTenantUpdatePost(body?: UpdateConfigTenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
}
}

View File

@ -11,7 +11,6 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
@ -132,15 +131,15 @@ export const SysDictDataApiAxiosParamCreator = function (configuration?: Configu
/**
*
* @summary 🔖
* @param {string} code
* @param {string} value
* @param {number} [status]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysDictDataDataListGet: async (code: string, status?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'code' is not null or undefined
if (code === null || code === undefined) {
throw new RequiredError('code','Required parameter code was null or undefined when calling apiSysDictDataDataListGet.');
apiSysDictDataDataListGet: async (value: string, status?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'value' is not null or undefined
if (value === null || value === undefined) {
throw new RequiredError('value','Required parameter value was null or undefined when calling apiSysDictDataDataListGet.');
}
const localVarPath = `/api/sysDictData/dataList`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
@ -162,8 +161,8 @@ export const SysDictDataApiAxiosParamCreator = function (configuration?: Configu
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
if (code !== undefined) {
localVarQueryParameter['Code'] = code;
if (value !== undefined) {
localVarQueryParameter['Value'] = value;
}
if (status !== undefined) {
@ -527,13 +526,13 @@ export const SysDictDataApiFp = function(configuration?: Configuration) {
/**
*
* @summary 🔖
* @param {string} code
* @param {string} value
* @param {number} [status]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysDictDataDataListGet(code: string, status?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultListSysDictData>>> {
const localVarAxiosArgs = await SysDictDataApiAxiosParamCreator(configuration).apiSysDictDataDataListGet(code, status, options);
async apiSysDictDataDataListGet(value: string, status?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultListSysDictData>>> {
const localVarAxiosArgs = await SysDictDataApiAxiosParamCreator(configuration).apiSysDictDataDataListGet(value, status, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
@ -656,13 +655,13 @@ export const SysDictDataApiFactory = function (configuration?: Configuration, ba
/**
*
* @summary 🔖
* @param {string} code
* @param {string} value
* @param {number} [status]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysDictDataDataListGet(code: string, status?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultListSysDictData>> {
return SysDictDataApiFp(configuration).apiSysDictDataDataListGet(code, status, options).then((request) => request(axios, basePath));
async apiSysDictDataDataListGet(value: string, status?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultListSysDictData>> {
return SysDictDataApiFp(configuration).apiSysDictDataDataListGet(value, status, options).then((request) => request(axios, basePath));
},
/**
*
@ -760,14 +759,14 @@ export class SysDictDataApi extends BaseAPI {
/**
*
* @summary 🔖
* @param {string} code
* @param {string} value
* @param {number} [status]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysDictDataApi
*/
public async apiSysDictDataDataListGet(code: string, status?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultListSysDictData>> {
return SysDictDataApiFp(this.configuration).apiSysDictDataDataListGet(code, status, options).then((request) => request(this.axios, this.basePath));
public async apiSysDictDataDataListGet(value: string, status?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultListSysDictData>> {
return SysDictDataApiFp(this.configuration).apiSysDictDataDataListGet(value, status, options).then((request) => request(this.axios, this.basePath));
}
/**
*

View File

@ -0,0 +1,117 @@
/* 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 { YesNoEnum } from './yes-no-enum';
/**
*
* @export
* @interface AddConfigTenantInput
*/
export interface AddConfigTenantInput {
/**
* Id
* @type {number}
* @memberof AddConfigTenantInput
*/
id?: number;
/**
*
* @type {Date}
* @memberof AddConfigTenantInput
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof AddConfigTenantInput
*/
updateTime?: Date | null;
/**
* Id
* @type {number}
* @memberof AddConfigTenantInput
*/
createUserId?: number | null;
/**
*
* @type {string}
* @memberof AddConfigTenantInput
*/
createUserName?: string | null;
/**
* Id
* @type {number}
* @memberof AddConfigTenantInput
*/
updateUserId?: number | null;
/**
*
* @type {string}
* @memberof AddConfigTenantInput
*/
updateUserName?: string | null;
/**
*
* @type {boolean}
* @memberof AddConfigTenantInput
*/
isDelete?: boolean;
/**
* Id
* @type {number}
* @memberof AddConfigTenantInput
*/
tenantId?: number | null;
/**
*
* @type {string}
* @memberof AddConfigTenantInput
*/
name: string;
/**
*
* @type {string}
* @memberof AddConfigTenantInput
*/
code?: string | null;
/**
*
* @type {string}
* @memberof AddConfigTenantInput
*/
value?: string | null;
/**
*
* @type {YesNoEnum}
* @memberof AddConfigTenantInput
*/
sysFlag?: YesNoEnum;
/**
*
* @type {string}
* @memberof AddConfigTenantInput
*/
groupCode?: string | null;
/**
*
* @type {number}
* @memberof AddConfigTenantInput
*/
orderNo?: number;
/**
*
* @type {string}
* @memberof AddConfigTenantInput
*/
remark?: string | null;
}

View File

@ -11,169 +11,123 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { StatusEnum } from './status-enum';
/**
/**
*
*
* @export
* @interface AddDictDataInput
*/
export interface AddDictDataInput {
/**
* Id
*
* @type {number}
* @memberof AddDictDataInput
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof AddDictDataInput
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof AddDictDataInput
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof AddDictDataInput
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof AddDictDataInput
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof AddDictDataInput
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof AddDictDataInput
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof AddDictDataInput
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof AddDictDataInput
*/
tenantId?: number | null;
/**
* Id
*
* @type {number}
* @memberof AddDictDataInput
*/
dictTypeId?: number;
/**
*
* @type {string}
* @memberof AddDictDataInput
*/
label: string;
/**
*
*
* @type {string}
* @memberof AddDictDataInput
*/
value: string;
/**
*
*
* @type {string}
* @memberof AddDictDataInput
*/
code: string;
/**
*
*
* @type {string}
* @memberof AddDictDataInput
*/
name?: string | null;
code?: string | null;
/**
* -
*
* @type {string}
* @memberof AddDictDataInput
*/
tagType?: string | null;
/**
* -Style()
*
* @type {string}
* @memberof AddDictDataInput
*/
styleSetting?: string | null;
/**
* -Class()
*
* @type {string}
* @memberof AddDictDataInput
*/
classSetting?: string | null;
/**
*
*
* @type {number}
* @memberof AddDictDataInput
*/
orderNo?: number;
/**
*
*
* @type {string}
* @memberof AddDictDataInput
*/
remark?: string | null;
/**
* ()
*
* @type {string}
* @memberof AddDictDataInput
*/
extData?: string | null;
/**
*
* @type {StatusEnum}
* @memberof AddDictDataInput
*/

View File

@ -11,129 +11,107 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { StatusEnum } from './status-enum';
import { SysDictData } from './sys-dict-data';
import { YesNoEnum } from './yes-no-enum';
/**
/**
*
*
* @export
* @interface AddDictTypeInput
*/
export interface AddDictTypeInput {
/**
* Id
*
* @type {number}
* @memberof AddDictTypeInput
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof AddDictTypeInput
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof AddDictTypeInput
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof AddDictTypeInput
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof AddDictTypeInput
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof AddDictTypeInput
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof AddDictTypeInput
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof AddDictTypeInput
*/
isDelete?: boolean;
/**
*
*
* @type {string}
* @memberof AddDictTypeInput
*/
name: string;
/**
*
*
* @type {string}
* @memberof AddDictTypeInput
*/
code: string;
/**
*
*
* @type {number}
* @memberof AddDictTypeInput
*/
orderNo?: number;
/**
*
*
* @type {string}
* @memberof AddDictTypeInput
*/
remark?: string | null;
/**
*
* @type {StatusEnum}
* @memberof AddDictTypeInput
*/
status?: StatusEnum;
/**
*
* @type {YesNoEnum}
* @memberof AddDictTypeInput
*/
isTenant?: YesNoEnum;
/**
*
*
* @type {Array<SysDictData>}
* @memberof AddDictTypeInput
*/
children?: Array<SysDictData> | null;
/**
*
* @type {YesNoEnum}
* @memberof AddDictTypeInput
*/

View File

@ -0,0 +1,57 @@
/* 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 { SysConfigTenant } from './sys-config-tenant';
/**
*
* @export
* @interface AdminNETResultListSysConfigTenant
*/
export interface AdminNETResultListSysConfigTenant {
/**
*
* @type {number}
* @memberof AdminNETResultListSysConfigTenant
*/
code?: number;
/**
* successwarningerror
* @type {string}
* @memberof AdminNETResultListSysConfigTenant
*/
type?: string | null;
/**
*
* @type {string}
* @memberof AdminNETResultListSysConfigTenant
*/
message?: string | null;
/**
*
* @type {Array<SysConfigTenant>}
* @memberof AdminNETResultListSysConfigTenant
*/
result?: Array<SysConfigTenant> | null;
/**
*
* @type {any}
* @memberof AdminNETResultListSysConfigTenant
*/
extras?: any | null;
/**
*
* @type {Date}
* @memberof AdminNETResultListSysConfigTenant
*/
time?: Date;
}

View File

@ -0,0 +1,57 @@
/* 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 { SqlSugarPagedListSysConfigTenant } from './sql-sugar-paged-list-sys-config-tenant';
/**
*
* @export
* @interface AdminNETResultSqlSugarPagedListSysConfigTenant
*/
export interface AdminNETResultSqlSugarPagedListSysConfigTenant {
/**
*
* @type {number}
* @memberof AdminNETResultSqlSugarPagedListSysConfigTenant
*/
code?: number;
/**
* successwarningerror
* @type {string}
* @memberof AdminNETResultSqlSugarPagedListSysConfigTenant
*/
type?: string | null;
/**
*
* @type {string}
* @memberof AdminNETResultSqlSugarPagedListSysConfigTenant
*/
message?: string | null;
/**
*
* @type {SqlSugarPagedListSysConfigTenant}
* @memberof AdminNETResultSqlSugarPagedListSysConfigTenant
*/
result?: SqlSugarPagedListSysConfigTenant;
/**
*
* @type {any}
* @memberof AdminNETResultSqlSugarPagedListSysConfigTenant
*/
extras?: any | null;
/**
*
* @type {Date}
* @memberof AdminNETResultSqlSugarPagedListSysConfigTenant
*/
time?: Date;
}

View File

@ -0,0 +1,57 @@
/* 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 { SysConfigTenant } from './sys-config-tenant';
/**
*
* @export
* @interface AdminNETResultSysConfigTenant
*/
export interface AdminNETResultSysConfigTenant {
/**
*
* @type {number}
* @memberof AdminNETResultSysConfigTenant
*/
code?: number;
/**
* successwarningerror
* @type {string}
* @memberof AdminNETResultSysConfigTenant
*/
type?: string | null;
/**
*
* @type {string}
* @memberof AdminNETResultSysConfigTenant
*/
message?: string | null;
/**
*
* @type {SysConfigTenant}
* @memberof AdminNETResultSysConfigTenant
*/
result?: SysConfigTenant;
/**
*
* @type {any}
* @memberof AdminNETResultSysConfigTenant
*/
extras?: any | null;
/**
*
* @type {Date}
* @memberof AdminNETResultSysConfigTenant
*/
time?: Date;
}

View File

@ -0,0 +1,32 @@
/* 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 BatchConfigTenantInput
*/
export interface BatchConfigTenantInput {
/**
*
* @type {string}
* @memberof BatchConfigTenantInput
*/
code?: string | null;
/**
*
* @type {string}
* @memberof BatchConfigTenantInput
*/
value?: string | null;
}

View File

@ -0,0 +1,26 @@
/* 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 DeleteConfigTenantInput
*/
export interface DeleteConfigTenantInput {
/**
* Id
* @type {number}
* @memberof DeleteConfigTenantInput
*/
id: number;
}

View File

@ -0,0 +1,88 @@
/* 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 { Filter } from './filter';
import { Search } from './search';
/**
*
* @export
* @interface PageConfigTenantInput
*/
export interface PageConfigTenantInput {
/**
*
* @type {Search}
* @memberof PageConfigTenantInput
*/
search?: Search;
/**
*
* @type {string}
* @memberof PageConfigTenantInput
*/
keyword?: string | null;
/**
*
* @type {Filter}
* @memberof PageConfigTenantInput
*/
filter?: Filter;
/**
*
* @type {number}
* @memberof PageConfigTenantInput
*/
page?: number;
/**
*
* @type {number}
* @memberof PageConfigTenantInput
*/
pageSize?: number;
/**
*
* @type {string}
* @memberof PageConfigTenantInput
*/
field?: string | null;
/**
*
* @type {string}
* @memberof PageConfigTenantInput
*/
order?: string | null;
/**
*
* @type {string}
* @memberof PageConfigTenantInput
*/
descStr?: string | null;
/**
*
* @type {string}
* @memberof PageConfigTenantInput
*/
name?: string | null;
/**
*
* @type {string}
* @memberof PageConfigTenantInput
*/
code?: string | null;
/**
*
* @type {string}
* @memberof PageConfigTenantInput
*/
groupCode?: string | null;
}

View File

@ -11,96 +11,76 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { Filter } from './filter';
import { Search } from './search';
/**
/**
*
*
* @export
* @interface PageDictDataInput
*/
export interface PageDictDataInput {
/**
*
* @type {Search}
* @memberof PageDictDataInput
*/
search?: Search;
/**
*
*
* @type {string}
* @memberof PageDictDataInput
*/
keyword?: string | null;
/**
*
* @type {Filter}
* @memberof PageDictDataInput
*/
filter?: Filter;
/**
*
*
* @type {number}
* @memberof PageDictDataInput
*/
page?: number;
/**
*
*
* @type {number}
* @memberof PageDictDataInput
*/
pageSize?: number;
/**
*
*
* @type {string}
* @memberof PageDictDataInput
*/
field?: string | null;
/**
*
*
* @type {string}
* @memberof PageDictDataInput
*/
order?: string | null;
/**
*
*
* @type {string}
* @memberof PageDictDataInput
*/
descStr?: string | null;
/**
* Id
*
* @type {number}
* @memberof PageDictDataInput
*/
dictTypeId?: number;
/**
*
*
*
* @type {string}
* @memberof PageDictDataInput
*/
value?: string | null;
label?: string | null;
/**
*
*
* @type {string}
* @memberof PageDictDataInput
*/

View File

@ -0,0 +1,63 @@
/* 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 { SysConfigTenant } from './sys-config-tenant';
/**
*
* @export
* @interface SqlSugarPagedListSysConfigTenant
*/
export interface SqlSugarPagedListSysConfigTenant {
/**
*
* @type {number}
* @memberof SqlSugarPagedListSysConfigTenant
*/
page?: number;
/**
*
* @type {number}
* @memberof SqlSugarPagedListSysConfigTenant
*/
pageSize?: number;
/**
*
* @type {number}
* @memberof SqlSugarPagedListSysConfigTenant
*/
total?: number;
/**
*
* @type {number}
* @memberof SqlSugarPagedListSysConfigTenant
*/
totalPages?: number;
/**
*
* @type {Array<SysConfigTenant>}
* @memberof SqlSugarPagedListSysConfigTenant
*/
items?: Array<SysConfigTenant> | null;
/**
*
* @type {boolean}
* @memberof SqlSugarPagedListSysConfigTenant
*/
hasPrevPage?: boolean;
/**
*
* @type {boolean}
* @memberof SqlSugarPagedListSysConfigTenant
*/
hasNextPage?: boolean;
}

View File

@ -0,0 +1,117 @@
/* 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 { YesNoEnum } from './yes-no-enum';
/**
*
* @export
* @interface SysConfigTenant
*/
export interface SysConfigTenant {
/**
* Id
* @type {number}
* @memberof SysConfigTenant
*/
id?: number;
/**
*
* @type {Date}
* @memberof SysConfigTenant
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof SysConfigTenant
*/
updateTime?: Date | null;
/**
* Id
* @type {number}
* @memberof SysConfigTenant
*/
createUserId?: number | null;
/**
*
* @type {string}
* @memberof SysConfigTenant
*/
createUserName?: string | null;
/**
* Id
* @type {number}
* @memberof SysConfigTenant
*/
updateUserId?: number | null;
/**
*
* @type {string}
* @memberof SysConfigTenant
*/
updateUserName?: string | null;
/**
*
* @type {boolean}
* @memberof SysConfigTenant
*/
isDelete?: boolean;
/**
* Id
* @type {number}
* @memberof SysConfigTenant
*/
tenantId?: number | null;
/**
*
* @type {string}
* @memberof SysConfigTenant
*/
name: string;
/**
*
* @type {string}
* @memberof SysConfigTenant
*/
code?: string | null;
/**
*
* @type {string}
* @memberof SysConfigTenant
*/
value?: string | null;
/**
*
* @type {YesNoEnum}
* @memberof SysConfigTenant
*/
sysFlag?: YesNoEnum;
/**
*
* @type {string}
* @memberof SysConfigTenant
*/
groupCode?: string | null;
/**
*
* @type {number}
* @memberof SysConfigTenant
*/
orderNo?: number;
/**
*
* @type {string}
* @memberof SysConfigTenant
*/
remark?: string | null;
}

View File

@ -11,169 +11,123 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { StatusEnum } from './status-enum';
/**
/**
*
*
* @export
* @interface SysDictData
*/
export interface SysDictData {
/**
* Id
*
* @type {number}
* @memberof SysDictData
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof SysDictData
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof SysDictData
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof SysDictData
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof SysDictData
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof SysDictData
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof SysDictData
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof SysDictData
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof SysDictData
*/
tenantId?: number | null;
/**
* Id
*
* @type {number}
* @memberof SysDictData
*/
dictTypeId?: number;
/**
*
* @type {string}
* @memberof SysDictData
*/
label: string;
/**
*
*
* @type {string}
* @memberof SysDictData
*/
value: string;
/**
*
*
* @type {string}
* @memberof SysDictData
*/
code: string;
/**
*
*
* @type {string}
* @memberof SysDictData
*/
name?: string | null;
code?: string | null;
/**
* -
*
* @type {string}
* @memberof SysDictData
*/
tagType?: string | null;
/**
* -Style()
*
* @type {string}
* @memberof SysDictData
*/
styleSetting?: string | null;
/**
* -Class()
*
* @type {string}
* @memberof SysDictData
*/
classSetting?: string | null;
/**
*
*
* @type {number}
* @memberof SysDictData
*/
orderNo?: number;
/**
*
*
* @type {string}
* @memberof SysDictData
*/
remark?: string | null;
/**
* ()
*
* @type {string}
* @memberof SysDictData
*/
extData?: string | null;
/**
*
* @type {StatusEnum}
* @memberof SysDictData
*/

View File

@ -11,129 +11,107 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { StatusEnum } from './status-enum';
import { SysDictData } from './sys-dict-data';
import { YesNoEnum } from './yes-no-enum';
/**
/**
*
*
* @export
* @interface SysDictType
*/
export interface SysDictType {
/**
* Id
*
* @type {number}
* @memberof SysDictType
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof SysDictType
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof SysDictType
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof SysDictType
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof SysDictType
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof SysDictType
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof SysDictType
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof SysDictType
*/
isDelete?: boolean;
/**
*
*
* @type {string}
* @memberof SysDictType
*/
name: string;
/**
*
*
* @type {string}
* @memberof SysDictType
*/
code: string;
/**
*
*
* @type {number}
* @memberof SysDictType
*/
orderNo?: number;
/**
*
*
* @type {string}
* @memberof SysDictType
*/
remark?: string | null;
/**
*
* @type {StatusEnum}
* @memberof SysDictType
*/
status?: StatusEnum;
/**
*
* @type {YesNoEnum}
* @memberof SysDictType
*/
sysFlag?: YesNoEnum;
/**
*
* @type {YesNoEnum}
* @memberof SysDictType
*/
isTenant?: YesNoEnum;
/**
*
*
* @type {Array<SysDictData>}
* @memberof SysDictType
*/

View File

@ -0,0 +1,117 @@
/* 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 { YesNoEnum } from './yes-no-enum';
/**
*
* @export
* @interface UpdateConfigTenantInput
*/
export interface UpdateConfigTenantInput {
/**
* Id
* @type {number}
* @memberof UpdateConfigTenantInput
*/
id?: number;
/**
*
* @type {Date}
* @memberof UpdateConfigTenantInput
*/
createTime?: Date;
/**
*
* @type {Date}
* @memberof UpdateConfigTenantInput
*/
updateTime?: Date | null;
/**
* Id
* @type {number}
* @memberof UpdateConfigTenantInput
*/
createUserId?: number | null;
/**
*
* @type {string}
* @memberof UpdateConfigTenantInput
*/
createUserName?: string | null;
/**
* Id
* @type {number}
* @memberof UpdateConfigTenantInput
*/
updateUserId?: number | null;
/**
*
* @type {string}
* @memberof UpdateConfigTenantInput
*/
updateUserName?: string | null;
/**
*
* @type {boolean}
* @memberof UpdateConfigTenantInput
*/
isDelete?: boolean;
/**
* Id
* @type {number}
* @memberof UpdateConfigTenantInput
*/
tenantId?: number | null;
/**
*
* @type {string}
* @memberof UpdateConfigTenantInput
*/
name: string;
/**
*
* @type {string}
* @memberof UpdateConfigTenantInput
*/
code?: string | null;
/**
*
* @type {string}
* @memberof UpdateConfigTenantInput
*/
value?: string | null;
/**
*
* @type {YesNoEnum}
* @memberof UpdateConfigTenantInput
*/
sysFlag?: YesNoEnum;
/**
*
* @type {string}
* @memberof UpdateConfigTenantInput
*/
groupCode?: string | null;
/**
*
* @type {number}
* @memberof UpdateConfigTenantInput
*/
orderNo?: number;
/**
*
* @type {string}
* @memberof UpdateConfigTenantInput
*/
remark?: string | null;
}

View File

@ -11,169 +11,123 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { StatusEnum } from './status-enum';
/**
/**
*
*
* @export
* @interface UpdateDictDataInput
*/
export interface UpdateDictDataInput {
/**
* Id
*
* @type {number}
* @memberof UpdateDictDataInput
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof UpdateDictDataInput
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof UpdateDictDataInput
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof UpdateDictDataInput
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof UpdateDictDataInput
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof UpdateDictDataInput
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof UpdateDictDataInput
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof UpdateDictDataInput
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof UpdateDictDataInput
*/
tenantId?: number | null;
/**
* Id
*
* @type {number}
* @memberof UpdateDictDataInput
*/
dictTypeId?: number;
/**
*
* @type {string}
* @memberof UpdateDictDataInput
*/
label: string;
/**
*
*
* @type {string}
* @memberof UpdateDictDataInput
*/
value: string;
/**
*
*
* @type {string}
* @memberof UpdateDictDataInput
*/
code: string;
/**
*
*
* @type {string}
* @memberof UpdateDictDataInput
*/
name?: string | null;
code?: string | null;
/**
* -
*
* @type {string}
* @memberof UpdateDictDataInput
*/
tagType?: string | null;
/**
* -Style()
*
* @type {string}
* @memberof UpdateDictDataInput
*/
styleSetting?: string | null;
/**
* -Class()
*
* @type {string}
* @memberof UpdateDictDataInput
*/
classSetting?: string | null;
/**
*
*
* @type {number}
* @memberof UpdateDictDataInput
*/
orderNo?: number;
/**
*
*
* @type {string}
* @memberof UpdateDictDataInput
*/
remark?: string | null;
/**
* ()
*
* @type {string}
* @memberof UpdateDictDataInput
*/
extData?: string | null;
/**
*
* @type {StatusEnum}
* @memberof UpdateDictDataInput
*/

View File

@ -11,129 +11,107 @@
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { StatusEnum } from './status-enum';
import { SysDictData } from './sys-dict-data';
import { YesNoEnum } from './yes-no-enum';
/**
/**
*
*
* @export
* @interface UpdateDictTypeInput
*/
export interface UpdateDictTypeInput {
/**
* Id
*
* @type {number}
* @memberof UpdateDictTypeInput
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof UpdateDictTypeInput
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof UpdateDictTypeInput
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof UpdateDictTypeInput
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof UpdateDictTypeInput
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof UpdateDictTypeInput
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof UpdateDictTypeInput
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof UpdateDictTypeInput
*/
isDelete?: boolean;
/**
*
*
* @type {string}
* @memberof UpdateDictTypeInput
*/
name: string;
/**
*
*
* @type {string}
* @memberof UpdateDictTypeInput
*/
code: string;
/**
*
*
* @type {number}
* @memberof UpdateDictTypeInput
*/
orderNo?: number;
/**
*
*
* @type {string}
* @memberof UpdateDictTypeInput
*/
remark?: string | null;
/**
*
* @type {StatusEnum}
* @memberof UpdateDictTypeInput
*/
status?: StatusEnum;
/**
*
* @type {YesNoEnum}
* @memberof UpdateDictTypeInput
*/
isTenant?: YesNoEnum;
/**
*
*
* @type {Array<SysDictData>}
* @memberof UpdateDictTypeInput
*/
children?: Array<SysDictData> | null;
/**
*
* @type {YesNoEnum}
* @memberof UpdateDictTypeInput
*/

View File

@ -0,0 +1,120 @@
<!-- 组件使用文档 https://gitee.com/zuohuaijun/Admin.NET/pulls/1559 -->
<script setup lang="ts">
import { reactive, watch, PropType } from 'vue';
import { useUserInfo } from '/@/stores/userInfo';
const emit = defineEmits(['update:modelValue']);
const dictList = useUserInfo().dictList;
const props = defineProps({
modelValue: {
type: [String, Number, Boolean, Array, null],
default: null,
required: true,
},
code: {
type: String,
required: true,
},
propLabel: {
type: String,
default: 'label',
},
propValue: {
type: String,
default: 'value',
},
onItemFilter: {
type: Function,
default: (dict: any): boolean => dict,
},
onItemFormatter: {
type: Function as PropType<(dict: any) => string | undefined | null>,
default: () => undefined,
},
renderAs: {
type: String,
default: 'tag',
validator(value: string) {
return ['tag', 'select', 'radio', 'checkbox'].includes(value);
},
},
multiple: {
type: Boolean,
default: false,
},
});
const state = reactive({
dict: {} as any | any[] | undefined,
dictData: [] as any[],
value: null as any,
});
const setDictValue = (value: any) => {
state.value = value;
state.dictData = dictList[props.code]?.filter(props.onItemFilter) ?? [];
if (Array.isArray(value)) {
state.dict = state.dictData.filter((x: any) => value.includes(x[props.propValue]));
if (state.dict) {
state.dict.forEach((item: any) => {
if (!['success', 'warning', 'info', 'primary', 'danger'].includes(item.tagType ?? '')) {
item.tagType = 'primary';
}
});
}
} else {
state.dict = state.dictData.find((x: any) => x[props.propValue] == state.value);
if (state.dict && !['success', 'warning', 'info', 'primary', 'danger'].includes(state.dict.tagType ?? '')) {
state.dict.tagType = 'primary';
}
}
};
watch(
() => props.modelValue,
(newValue) => setDictValue(newValue),
{ immediate: true }
);
</script>
<template>
<!-- 渲染标签 -->
<template v-if="props.renderAs === 'tag'">
<template v-if="Array.isArray(state.dict)">
<el-tag v-for="(item, index) in state.dict" :key="index" v-bind="$attrs" :type="item.tagType" :style="item.styleSetting" :class="item.classSetting" class="mr-1">
{{ onItemFormatter(item) ?? item[props.propLabel] }}
</el-tag>
</template>
<template v-else>
<el-tag v-if="state.dict" v-bind="$attrs" :type="state.dict.tagType" :style="state.dict.styleSetting" :class="state.dict.classSetting">
{{ onItemFormatter(state.dict) ?? state.dict[props.propLabel] }}
</el-tag>
<span v-else>{{ state.value }}</span>
</template>
</template>
<!-- 渲染选择器 -->
<template v-if="props.renderAs === 'select'">
<el-select v-model="state.value" v-bind="$attrs" :multiple="props.multiple" @change="(newValue: any) => emit('update:modelValue', newValue)">
<el-option v-for="(item, index) in state.dictData" :key="index" :label="onItemFormatter(item) ?? item[props.propLabel]" :value="item[props.propValue]" />
</el-select>
</template>
<!-- 渲染复选框多选 -->
<template v-if="props.renderAs === 'checkbox'">
<el-checkbox-group v-model="state.value" v-bind="$attrs" @change="(newValue: any) => emit('update:modelValue', newValue)">
<el-checkbox v-for="(item, index) in state.dictData" :key="index" :label="item[props.propValue]">
{{ onItemFormatter(item) ?? item[props.propLabel] }}
</el-checkbox>
</el-checkbox-group>
</template>
<!-- 渲染单选框 -->
<template v-if="props.renderAs === 'radio'">
<el-radio-group v-model="state.value" v-bind="$attrs" @change="(newValue: any) => emit('update:modelValue', newValue)">
<el-radio v-for="(item, index) in state.dictData" :key="index" :value="item[props.propValue]">
{{ onItemFormatter(item) ?? item[props.propLabel] }}
</el-radio>
</el-radio-group>
</template>
</template>
<style scoped lang="scss"></style>

View File

@ -24,6 +24,8 @@ import { setupVXETable } from '/@/hooks/setupVXETableHook';
// IM聊天框
import JwChat from 'jwchat';
import 'jwchat/lib/style.css';
// 自定义字典组件
import sysDict from "/@/components/sysDict/sysDict.vue";
// 关闭自动打印
import { disAutoConnect } from 'vue-plugin-hiprint';
@ -37,4 +39,7 @@ const app = createApp(App);
directive(app);
other.elSvg(app);
// 注册全局字典组件
app.component('GSysDict', sysDict);
app.use(pinia).use(router).use(ElementPlus).use(setupVXETable).use(i18n).use(VueGridLayout).use(VForm3).use(VueSignaturePad).use(vue3TreeOrg).use(JwChat).mount('#app');

View File

@ -146,9 +146,7 @@
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生成方式" prop="generateType">
<el-select v-model="state.ruleForm.generateType" filterable class="w100">
<el-option v-for="item in getDictDataByCode('code_gen_create_type')" :key="item.value" :label="item.value" :value="item.code" />
</el-select>
<g-sys-dict v-model="state.ruleForm.generateType" code="code_gen_create_type" render-as="select" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
@ -169,9 +167,7 @@
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="支持打印" prop="printType">
<el-select v-model="state.ruleForm.printType" filterable class="w100" @change="printTypeChanged">
<el-option v-for="item in getDictDataByCode('code_gen_print_type')" :key="item.value" :label="item.value" :value="item.code" />
</el-select>
<g-sys-dict v-model="state.ruleForm.printType" code="code_gen_print_type" render-as="select" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="state.ruleForm.printType == 'custom'">
@ -374,7 +370,6 @@ const props = defineProps({
title: String,
applicationNamespaces: Array<String>,
});
const getDictDataByCode = useUserInfo().getDictDataByCode;
const emits = defineEmits(['handleQuery']);
const ruleFormRef = ref();
const state = reactive({

View File

@ -21,9 +21,7 @@
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="基类" prop="baseClassName">
<el-select v-model="state.ruleForm.baseClassName" clearable class="w100">
<el-option v-for="item in getDictDataByCode('code_gen_base_class')" :key="item.code" :label="item.value" :value="item.code" />
</el-select>
<g-sys-dict v-model="state.ruleForm.baseClassName" code="code_gen_base_class" render-as="select" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
@ -55,7 +53,6 @@ import { useUserInfo } from '/@/stores/userInfo';
import { getAPI } from '/@/utils/axios-utils';
import { SysDatabaseApi } from '/@/api-services/api';
const getDictDataByCode = useUserInfo().getDictDataByCode;
const emits = defineEmits(['handleQueryColumn']);
const ruleFormRef = ref();
const state = reactive({

View File

@ -9,21 +9,21 @@
</template>
<el-form :model="state.ruleForm" ref="formRef" label-width="auto">
<el-row :gutter="10">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="显示文本" prop="label" :rules="[{ required: true, message: '显示文本不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.label" placeholder="显示文本" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="字典值" prop="value" :rules="[{ required: true, message: '字典值不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.value" placeholder="字典值" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="编码" prop="code" :rules="[{ required: true, message: '编码不能为空', trigger: 'blur' }]">
<el-form-item label="编码" prop="code">
<el-input v-model="state.ruleForm.code" placeholder="编码" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="名称">
<el-input v-model="state.ruleForm.name" placeholder="名称" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="标签类型">
<el-radio-group v-model="state.ruleForm.tagType">

View File

@ -19,17 +19,14 @@
<el-input v-model="state.ruleForm.code" placeholder="字典编码" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="状态">
<el-radio-group v-model="state.ruleForm.status">
<el-radio :value="1">启用</el-radio>
<el-radio :value="2">禁用</el-radio>
</el-radio-group>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12" class="mb20" v-if="!state.ruleForm.id && userInfo.accountType === AccountTypeEnum.NUMBER_999">
<el-form-item label="租户字典" prop="isTenant" :rules="[{ required: true, message: '租户字典不能为空', trigger: 'blur' }]">
<g-sys-dict v-model="state.ruleForm.isTenant" code="YesNoEnum" render-as="radio" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="排序">
<el-input-number v-model="state.ruleForm.orderNo" placeholder="排序" class="w100" />
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="状态">
<g-sys-dict v-model="state.ruleForm.status" code="StatusEnum" render-as="radio" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
@ -37,6 +34,11 @@
<el-input v-model="state.ruleForm.remark" placeholder="请输入备注内容" clearable type="textarea" />
</el-form-item>
</el-col>
<el-col :xs="8" :sm="8" :md="8" :lg="8" :xl="8" class="mb20">
<el-form-item label="排序">
<el-input-number v-model="state.ruleForm.orderNo" placeholder="排序" class="w100" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
@ -54,11 +56,13 @@ import { reactive, ref } from 'vue';
import { getAPI } from '/@/utils/axios-utils';
import { SysDictTypeApi } from '/@/api-services/api';
import { UpdateDictTypeInput } from '/@/api-services/models';
import {AccountTypeEnum, UpdateDictTypeInput} from '/@/api-services/models';
import {useUserInfo} from "/@/stores/userInfo";
const props = defineProps({
title: String,
});
const userInfo = useUserInfo().userInfos;
const emits = defineEmits(['handleQuery', 'handleUpdate']);
const formRef = ref();
const state = reactive({

View File

@ -38,13 +38,14 @@
<template #empty>
<el-empty :image-size="200" />
</template>
<template #row_isTenant="{ row }">
<g-sys-dict v-model="row.isTenant" code="YesNoEnum" />
</template>
<template #row_sysFlag="{ row }">
<el-tag v-if="row.sysFlag === 1" type="info"></el-tag>
<el-tag v-else type="info"></el-tag>
<g-sys-dict v-model="row.sysFlag" code="YesNoEnum" />
</template>
<template #row_status="{ row }">
<el-tag v-if="row.status === 1" type="success">启用</el-tag>
<el-tag v-else type="danger">禁用</el-tag>
<g-sys-dict v-model="row.status" code="StatusEnum" />
</template>
<template #row_record="{ row }">
<ModifyRecord :data="row" />
@ -98,11 +99,8 @@
<template #empty>
<el-empty :image-size="200" />
</template>
<template #row_value="{ row }">
<el-tag :type="row.tagType" :style="row.styleSetting" :class="row.classSetting">{{ row.value }}</el-tag>
</template>
<template #row_name="{ row }">
{{ row.name == null ? row.value : row.name }}
<template #row_label="{ row }">
<el-tag :type="row.tagType" :style="row.styleSetting" :class="row.classSetting">{{ row.label }}</el-tag>
</template>
<template #row_extData="{ row }">
<el-tag type="warning" v-if="row.extData == null || row.extData == ''"></el-tag>
@ -150,8 +148,17 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
import { getAPI } from '/@/utils/axios-utils';
import { SysDictTypeApi, SysDictDataApi } from '/@/api-services/api';
import { SysDictType, PageDictTypeInput, SysDictData, PageDictDataInput, UpdateDictDataInput } from '/@/api-services/models';
import {
SysDictType,
PageDictTypeInput,
SysDictData,
PageDictDataInput,
UpdateDictDataInput,
AccountTypeEnum
} from '/@/api-services/models';
import {auth} from "/@/utils/authFunction";
const userInfo = useUserInfo().userInfos;
const xGridDictType = ref<VxeGridInstance>();
const xGridDictData = ref<VxeGridInstance>();
const editRefDictType = ref<InstanceType<typeof EditDictType>>();
@ -189,6 +196,7 @@ const optionsDictType = useVxeTable<SysDictType>(
{ field: 'seq', type: 'seq', title: '序号', width: 60, fixed: 'left' },
{ field: 'name', title: '字典名称', minWidth: 140, align: 'left', headerAlign: 'center', showOverflow: 'tooltip' },
{ field: 'code', title: '字典编码', minWidth: 140, align: 'left', headerAlign: 'center', showOverflow: 'tooltip' },
{ field: 'isTenant', title: '租户隔离', width: 80, showOverflow: 'tooltip', visible: userInfo.accountType === AccountTypeEnum.NUMBER_999, slots: { default: 'row_isTenant' } },
{ field: 'sysFlag', title: '是否内置', width: 80, showOverflow: 'tooltip', slots: { default: 'row_sysFlag' } },
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
@ -239,7 +247,7 @@ const resetQuery = async () => {
//
const handleAdd = () => {
state.title = '添加字典';
editRefDictType.value?.openDialog({ status: 1, orderNo: 100 });
editRefDictType.value?.openDialog({ status: 1, isTenant: 2, orderNo: 100 });
};
//
@ -293,9 +301,9 @@ const optionsDictData = useVxeTable<SysDictData>(
name: '字典值信息',
columns: [
{ field: 'seq', type: 'seq', title: '序号', width: 60, fixed: 'left' },
{ field: 'value', title: '字典值', minWidth: 120, showOverflow: 'tooltip', slots: { default: 'row_value' } },
{ field: 'label', title: '显示文本', minWidth: 140, align: 'left', headerAlign: 'center', showOverflow: 'tooltip', slots: { default: 'row_label' } },
{ field: 'value', title: '字典值', minWidth: 140, align: 'left', headerAlign: 'center', showOverflow: 'tooltip' },
{ field: 'code', title: '编码', minWidth: 150, align: 'left', headerAlign: 'center', showOverflow: 'tooltip' },
{ field: 'name', title: '名称', minWidth: 150, align: 'left', headerAlign: 'center', showOverflow: 'tooltip', slots: { default: 'row_name' } },
{ field: 'extData', title: '拓展数据', showOverflow: 'tooltip', slots: { default: 'row_extData' } },
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },