Merge pull request 'v2' (#5) from Admin.NET/Admin.NET.Pro:v2 into v2

Reviewed-on: http://101.43.53.74:3000/ir0nmax/Admin.NET.Pro/pulls/5
This commit is contained in:
薛原 2025-01-27 15:30:24 +08:00
commit af247de3f7
26 changed files with 124 additions and 567 deletions

View File

@ -32,7 +32,6 @@
<PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.2" />
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.2" />
<PackageReference Include="MailKit" Version="4.9.0" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.6" />
<PackageReference Include="MiniExcel" Version="1.37.0" />
<PackageReference Include="MiniWord" Version="0.9.2" />
<PackageReference Include="MQTTnet" Version="5.0.1.1416" />
@ -44,12 +43,12 @@
<PackageReference Include="RabbitMQ.Client" Version="7.0.0" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.6.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.9.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.10.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.175" />
<PackageReference Include="SSH.NET" Version="2024.2.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.5.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1170" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1171" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup>
@ -61,6 +60,7 @@
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.11" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.7" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
@ -70,6 +70,7 @@
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="9.0.1" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.5.0" />
</ItemGroup>
</Project>

View File

@ -1,35 +0,0 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 系统配置参数值表
/// </summary>
[SugarTable(null, "系统配置参数值表")]
[SysTable]
[SugarIndex("index_{table}_N", nameof(ConfigId), OrderByType.Asc)]
public partial class SysConfigValue : EntityTenant
{
/// <summary>
/// 系统配置Id
/// </summary>
[SugarColumn(ColumnDescription = "系统配置Id")]
public long ConfigId { get; set; }
/// <summary>
/// 系统配置
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(ConfigId))]
public SysConfig Config { get; set; }
/// <summary>
/// 参数默认值
/// </summary>
[MaxLength(64)]
[SugarColumn(ColumnDescription = "参数默认值", Length = 512)]
public string? Value { get; set; }
}

View File

@ -530,9 +530,9 @@ public enum ErrorCodeEnum
D8004,
/// <summary>
/// 已存在同名或同编码参数配置
/// 已存在同名或同编码配置参数
/// </summary>
[ErrorCodeItemMetadata("已存在同名或同编码参数配置")]
[ErrorCodeItemMetadata("已存在同名或同编码配置参数")]
D9000,
/// <summary>

View File

@ -109,12 +109,11 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
new SysMenu{ Id=1310000000324, Pid=1310000000321, Title="增加", Permission="sysMenu/add", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000325, Pid=1310000000321, Title="删除", Permission="sysMenu/delete", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000331, Pid=1310000000301, Title="参数配置", Path="/platform/config", Name="sysConfig", Component="/system/config/index", Icon="ele-DocumentCopy", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=120 },
new SysMenu{ Id=1310000000331, Pid=1310000000301, Title="配置参数", Path="/platform/config", Name="sysConfig", Component="/system/config/index", Icon="ele-DocumentCopy", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=120 },
new SysMenu{ Id=1310000000332, Pid=1310000000331, Title="查询", Permission="sysConfig/page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000333, Pid=1310000000331, Title="编辑", Permission="sysConfig/update", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000334, Pid=1310000000331, Title="增加", Permission="sysConfig/add", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000335, Pid=1310000000331, Title="删除", Permission="sysConfig/delete", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000336, Pid=1310000000331, Title="更新默认值", Permission="sysConfig/updateDefault", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
new SysMenu{ Id=1310000000341, Pid=1310000000301, Title="字典管理", Path="/platform/dict", Name="sysDict", Component="/system/dict/index", Icon="ele-Collection", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=130 },
new SysMenu{ Id=1310000000342, Pid=1310000000341, Title="查询", Permission="sysDictType/page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },

View File

@ -36,14 +36,6 @@ public class UpdateConfigInput : AddConfigInput
{
}
public class UpdateDefaultValueInput : BaseIdInput
{
/// <summary>
/// 默认属性值
/// </summary>
public string DefaultValue { get; set; }
}
public class DeleteConfigInput : BaseIdInput
{
}

View File

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

View File

@ -12,21 +12,14 @@ namespace Admin.NET.Core.Service;
[ApiDescriptionSettings(Order = 440, Description = "配置参数")]
public class SysConfigService : IDynamicApiController, ITransient
{
private readonly UserManager _userManager;
private readonly SysCacheService _sysCacheService;
private readonly SqlSugarRepository<SysConfig> _sysConfigRep;
private readonly SqlSugarRepository<SysConfigValue> _sysConfigValueRep;
public SysConfigService(
UserManager userManager,
SysCacheService sysCacheService,
SqlSugarRepository<SysConfigValue> sysConfigValueRep,
public SysConfigService(SysCacheService sysCacheService,
SqlSugarRepository<SysConfig> sysConfigRep)
{
_sysConfigValueRep = sysConfigValueRep;
_sysCacheService = sysCacheService;
_sysConfigRep = sysConfigRep;
_userManager = userManager;
}
/// <summary>
@ -35,10 +28,9 @@ public class SysConfigService : IDynamicApiController, ITransient
/// <param name="input"></param>
/// <returns></returns>
[DisplayName("获取配置参数分页列表")]
public async Task<SqlSugarPagedList<ConfigOutput>> Page(PageConfigInput input)
public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigInput input)
{
var query = await GetConfigQueryable();
return await query.WhereIF(!_userManager.SuperAdmin, u => u.SysFlag == YesNoEnum.N)
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))
@ -52,10 +44,10 @@ public class SysConfigService : IDynamicApiController, ITransient
/// </summary>
/// <returns></returns>
[DisplayName("获取配置参数列表")]
public async Task<List<ConfigOutput>> List(PageConfigInput input)
public async Task<List<SysConfig>> List(PageConfigInput input)
{
var query = await GetConfigQueryable();
return await query.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
return await _sysConfigRep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
.ToListAsync();
}
@ -68,9 +60,9 @@ public class SysConfigService : IDynamicApiController, ITransient
[DisplayName("增加配置参数")]
public async Task AddConfig(AddConfigInput input)
{
if (input.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D9002);
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<SysConfig>());
}
@ -84,7 +76,6 @@ public class SysConfigService : IDynamicApiController, ITransient
[UnitOfWork]
public async Task UpdateConfig(UpdateConfigInput input)
{
if (input.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D9002);
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);
@ -101,49 +92,8 @@ public class SysConfigService : IDynamicApiController, ITransient
//}
var config = input.Adapt<SysConfig>();
if (input.SysFlag != YesNoEnum.Y)
{
config.Value = null;
var tenantId = _userManager.TenantId;
if (tenantId <= 0) tenantId = SqlSugarConst.DefaultTenantId;
var configValue = await _sysConfigValueRep.AsQueryable().ClearFilter().Where(u => u.TenantId == tenantId).SingleAsync(u => u.ConfigId == config.Id);
if (configValue == null)
{
await _sysConfigValueRep.InsertAsync(new SysConfigValue()
{
ConfigId = config.Id,
Value = input.Value
});
}
else
{
configValue.Value = input.Value;
await _sysConfigValueRep.UpdateAsync(configValue);
}
}
else
{
await _sysConfigValueRep.DeleteAsync(u => u.ConfigId == config.Id);
}
// 非超管用户仅修改参数值
if (_userManager.SuperAdmin) await _sysConfigRep.AsUpdateable(config).IgnoreColumnsIF(input.SysFlag != YesNoEnum.Y, u => u.Value).ExecuteCommandAsync();
RemoveConfigCache(config);
}
await _sysConfigRep.AsUpdateable(config).IgnoreColumns(true).ExecuteCommandAsync();
/// <summary>
/// 更新参数默认值 🔖
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "UpdateDefault"), HttpPost]
[DisplayName("更新参数默认值")]
[UnitOfWork]
public async Task UpdateDefaultConfig(UpdateDefaultValueInput input)
{
var config = await _sysConfigRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
if (config.SysFlag == YesNoEnum.Y && !_userManager.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D9002);
config.Value = input.DefaultValue;
await _sysConfigRep.UpdateAsync(config);
RemoveConfigCache(config);
}
@ -161,7 +111,6 @@ public class SysConfigService : IDynamicApiController, ITransient
if (config.SysFlag == YesNoEnum.Y) throw Oops.Oh(ErrorCodeEnum.D9001);
await _sysConfigRep.DeleteAsync(config);
await _sysConfigValueRep.DeleteAsync(u => u.ConfigId == config.Id);
RemoveConfigCache(config);
}
@ -182,7 +131,6 @@ public class SysConfigService : IDynamicApiController, ITransient
if (config.SysFlag == YesNoEnum.Y) continue;
await _sysConfigRep.DeleteAsync(config);
await _sysConfigValueRep.DeleteAsync(u => u.ConfigId == id);
RemoveConfigCache(config);
}
@ -207,8 +155,7 @@ public class SysConfigService : IDynamicApiController, ITransient
[NonAction]
public async Task<SysConfig> GetConfig(string code)
{
var query = await GetConfigQueryable();
return await query.FirstAsync(u => u.Code == code);
return await _sysConfigRep.GetFirstAsync(u => u.Code == code);
}
/// <summary>
@ -235,9 +182,8 @@ public class SysConfigService : IDynamicApiController, ITransient
var value = _sysCacheService.Get<string>($"{CacheConst.KeyConfig}{code}");
if (string.IsNullOrEmpty(value))
{
var query = await GetConfigQueryable();
var config = await query.FirstAsync(u => u.Code == code);
value = config?.Value;
var config = await _sysConfigRep.CopyNew().GetFirstAsync(u => u.Code == code);
value = config != null ? config.Value : default;
_sysCacheService.Set($"{CacheConst.KeyConfig}{code}", value);
}
if (string.IsNullOrWhiteSpace(value)) return default;
@ -257,7 +203,7 @@ public class SysConfigService : IDynamicApiController, ITransient
if (config == null) return;
config.Value = value;
await UpdateConfig(config.Adapt<UpdateConfigInput>());
await _sysConfigRep.AsUpdateable(config).ExecuteCommandAsync();
RemoveConfigCache(config);
}
@ -269,8 +215,7 @@ public class SysConfigService : IDynamicApiController, ITransient
[DisplayName("获取分组列表")]
public async Task<List<string>> GetGroupList()
{
var query = await GetConfigQueryable();
return await query
return await _sysConfigRep.AsQueryable()
.Where(u => u.GroupCode != ConfigConst.SysWebConfigGroup || u.GroupCode == null) // 不显示 WebConfig 分组
.GroupBy(u => u.GroupCode)
.Select(u => u.GroupCode).ToListAsync();
@ -314,45 +259,11 @@ public class SysConfigService : IDynamicApiController, ITransient
var configInfo = await _sysConfigRep.GetFirstAsync(u => u.Code == config.Code);
if (configInfo == null) continue;
configInfo.Value = config.Value;
await UpdateConfig(configInfo.Adapt<UpdateConfigInput>());
await _sysConfigRep.AsUpdateable().SetColumns(u => u.Value == config.Value).Where(u => u.Code == config.Code).ExecuteCommandAsync();
RemoveConfigCache(configInfo);
}
}
/// <summary>
/// 获取配置参数查询器
/// </summary>
/// <returns></returns>
[NonAction]
public Task<ISugarQueryable<ConfigOutput>> GetConfigQueryable()
{
var tenantId = _userManager.TenantId;
if (_userManager.TenantId <= 0) tenantId = SqlSugarConst.DefaultTenantId;
return Task.FromResult(
_sysConfigRep.AsQueryable()
.LeftJoin<SysConfigValue>((u, w) => u.Id == w.ConfigId).ClearFilter()
.Where((u, w) => w.TenantId == null || w.TenantId == tenantId)
.Select((u, w) => new ConfigOutput
{
Id = u.Id,
Name = u.Name,
Code = u.Code,
GroupCode = u.GroupCode,
SysFlag = u.SysFlag,
Remark = u.Remark,
DefaultValue = u.Value,
Value = w.Value ?? u.Value,
CreateTime = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.CreateTime, w.CreateTime),
UpdateTime = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.UpdateTime, w.UpdateTime),
CreateUserId = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.CreateUserId, w.CreateUserId),
CreateUserName = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.CreateUserName, w.CreateUserName),
UpdateUserId = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.UpdateUserId, w.UpdateUserId),
UpdateUserName = SqlFunc.IIF(u.SysFlag == YesNoEnum.Y, u.UpdateUserName, w.UpdateUserName),
})
);
}
/// <summary>
/// 清除配置缓存
/// </summary>

View File

@ -86,7 +86,7 @@ public class SysSmsService : IDynamicApiController, ITransient
PhoneNumbers = phoneNumber, // 待发送手机号, 多个以逗号分隔
SignName = template.SignName, // 短信签名
TemplateCode = template.TemplateCode, // 短信模板
TemplateParam = templateParam.ToString(), // 模板中的变量替换JSON串
TemplateParam = templateParam.ToJson(), // 模板中的变量替换JSON串
OutId = YitIdHelper.NextId().ToString()
};
var sendSmsResponse = await client.SendSmsAsync(sendSmsRequest);

View File

@ -188,11 +188,7 @@ public static class ComputerUtil
}
else
{
#if NET8_0 || NET9_0
string output = ShellUtil.Cmd("wmic", "cpu get LoadPercentage");
#else
string output = ShellUtil.PowerShell("Get-CimInstance -ClassName Win32_Processor | Measure-Command {Start-Sleep -Seconds 1}");
#endif
cpuRates.AddRange(output.Replace("LoadPercentage", string.Empty).Trim().Split("\r\r\n"));
}
return cpuRates;
@ -221,11 +217,7 @@ public static class ComputerUtil
}
else
{
#if NET8_0 || NET9_0
string output = ShellUtil.Cmd("wmic", "OS get LastBootUpTime/Value");
#else
string output = ShellUtil.PowerShell("(Get-Date) - (Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime");
#endif
string[] outputArr = output.Split('=', (char)StringSplitOptions.RemoveEmptyEntries);
if (outputArr.Length == 2)
runTime = DateTimeUtil.FormatTime((DateTime.Now - outputArr[1].Split('.')[0].ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong());
@ -336,11 +328,7 @@ public class MemoryMetricsClient
/// <returns></returns>
public static MemoryMetrics GetWindowsMetrics()
{
#if NET8_0 || NET9_0
string output = ShellUtil.Cmd("wmic", "OS get FreePhysicalMemory,TotalVisibleMemorySize /Value");
#else
string output = ShellUtil.PowerShell("Get-CimInstance -ClassName Win32_OperatingSystem | Select FreePhysicalMemory, TotalVisibleMemorySize");
#endif
var metrics = new MemoryMetrics();
var lines = output.Trim().Split('\n', (char)StringSplitOptions.RemoveEmptyEntries);
if (lines.Length <= 1) return metrics;
@ -448,7 +436,6 @@ public class ShellUtil
/// <returns></returns>
public static string PowerShell(string script)
{
#if NET8_0 || NET9_0
using var PowerShellInstance = System.Management.Automation.PowerShell.Create();
PowerShellInstance.AddScript(script);
var PSOutput = PowerShellInstance.Invoke();
@ -459,9 +446,6 @@ public class ShellUtil
output.AppendLine(outputItem.BaseObject.ToString());
}
return output.ToString();
#else
return "";
#endif
}
}
@ -523,7 +507,6 @@ public class ShellHelper
/// <returns></returns>
public static string PowerShell(string script)
{
#if NET8_0 || NET9_0
using var PowerShellInstance = System.Management.Automation.PowerShell.Create();
PowerShellInstance.AddScript(script);
var PSOutput = PowerShellInstance.Invoke();
@ -534,8 +517,5 @@ public class ShellHelper
output.AppendLine(outputItem.BaseObject.ToString());
}
return output.ToString();
#else
return "";
#endif
}
}

View File

@ -9,42 +9,42 @@ namespace Admin.NET.Plugin.ApprovalFlow;
/// <summary>
/// 审批流流程记录
/// </summary>
[SugarTable("ApprovalFlowRecord", "审批流流程记录")]
[SugarTable(null, "审批流流程记录")]
public class ApprovalFlowRecord : EntityBaseData
{
/// <summary>
/// 表单名称
/// </summary>
[SugarColumn(ColumnName = "FormName", ColumnDescription = "表单名称", Length = 255)]
[SugarColumn(ColumnDescription = "表单名称", Length = 255)]
public string? FormName { get; set; }
/// <summary>
/// 表单状态
/// </summary>
[SugarColumn(ColumnName = "FormStatus", ColumnDescription = "表单状态", Length = 32)]
[SugarColumn(ColumnDescription = "表单状态", Length = 32)]
public string? FormStatus { get; set; }
/// <summary>
/// 表单触发
/// </summary>
[SugarColumn(ColumnName = "FormJson", ColumnDescription = "表单触发", ColumnDataType = StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "表单触发", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? FormJson { get; set; }
/// <summary>
/// 表单结果
/// </summary>
[SugarColumn(ColumnName = "FormResult", ColumnDescription = "表单结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "表单结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? FormResult { get; set; }
/// <summary>
/// 流程结构
/// </summary>
[SugarColumn(ColumnName = "FlowJson", ColumnDescription = "流程结构", ColumnDataType = StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "流程结构", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? FlowJson { get; set; }
/// <summary>
/// 流程结果
/// </summary>
[SugarColumn(ColumnName = "FlowResult", ColumnDescription = "流程结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "流程结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? FlowResult { get; set; }
}

View File

@ -9,54 +9,54 @@ namespace Admin.NET.Plugin.ApprovalFlow;
/// <summary>
/// 审批流表单
/// </summary>
[SugarTable("ApprovalForm", "审批流表单")]
[SugarTable(null, "审批流表单")]
public class ApprovalForm : EntityBaseData
{
/// <summary>
/// 编号
/// </summary>
[SugarColumn(ColumnName = "Code", ColumnDescription = "编号", Length = 32)]
[SugarColumn(ColumnDescription = "编号", Length = 32)]
public string? Code { get; set; }
/// <summary>
/// 名称
/// </summary>
[SugarColumn(ColumnName = "Name", ColumnDescription = "名称", Length = 32)]
[SugarColumn(ColumnDescription = "名称", Length = 32)]
public string? Name { get; set; }
/// <summary>
/// 表单名称
/// </summary>
[SugarColumn(ColumnName = "FormName", ColumnDescription = "表单名称", Length = 32)]
[SugarColumn(ColumnDescription = "表单名称", Length = 32)]
public string? FormName { get; set; }
/// <summary>
/// 表单属性
/// </summary>
[SugarColumn(ColumnName = "FormType", ColumnDescription = "表单属性", Length = 32)]
[SugarColumn(ColumnDescription = "表单属性", Length = 32)]
public string? FormType { get; set; }
/// <summary>
/// 表单状态
/// </summary>
[SugarColumn(ColumnName = "FormStatus", ColumnDescription = "表单状态")]
[SugarColumn(ColumnDescription = "表单状态")]
public int? FormStatus { get; set; }
/// <summary>
/// 表单结果
/// </summary>
[SugarColumn(ColumnName = "FormResult", ColumnDescription = "表单结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "表单结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? FormResult { get; set; }
/// <summary>
/// 状态
/// </summary>
[SugarColumn(ColumnName = "Status", ColumnDescription = "状态")]
[SugarColumn(ColumnDescription = "状态")]
public int? Status { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnName = "Remark", ColumnDescription = "备注", Length = 255)]
[SugarColumn(ColumnDescription = "备注", Length = 255)]
public string? Remark { get; set; }
}

View File

@ -9,48 +9,48 @@ namespace Admin.NET.Plugin.ApprovalFlow;
/// <summary>
/// 审批流表单记录
/// </summary>
[SugarTable("ApprovalFormRecord", "审批流表单记录")]
[SugarTable(null, "审批流表单记录")]
public class ApprovalFormRecord : EntityBaseData
{
/// <summary>
/// 流程Id
/// </summary>
[SugarColumn(ColumnName = "FlowId", ColumnDescription = "流程Id")]
[SugarColumn(ColumnDescription = "流程Id")]
public long? FlowId { get; set; }
/// <summary>
/// 表单名称
/// </summary>
[SugarColumn(ColumnName = "FormName", ColumnDescription = "表单名称", Length = 32)]
[SugarColumn(ColumnDescription = "表单名称", Length = 32)]
public string? FormName { get; set; }
/// <summary>
/// 表单类型
/// </summary>
[SugarColumn(ColumnName = "FormType", ColumnDescription = "表单类型", Length = 32)]
[SugarColumn(ColumnDescription = "表单类型", Length = 32)]
public string? FormType { get; set; }
/// <summary>
/// 表单状态
/// </summary>
[SugarColumn(ColumnName = "FormStatus", ColumnDescription = "表单状态", Length = 11)]
[SugarColumn(ColumnDescription = "表单状态", Length = 11)]
public string? FormStatus { get; set; }
/// <summary>
/// 修改前
/// </summary>
[SugarColumn(ColumnName = "FormBefore", ColumnDescription = "修改前", ColumnDataType = StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "修改前", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? FormBefore { get; set; }
/// <summary>
/// 修改后
/// </summary>
[SugarColumn(ColumnName = "FormAfter", ColumnDescription = "修改后", ColumnDataType = StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "修改后", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? FormAfter { get; set; }
/// <summary>
/// 表单结果
/// </summary>
[SugarColumn(ColumnName = "FormResult", ColumnDescription = "表单结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
[SugarColumn(ColumnDescription = "表单结果", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string? FormResult { get; set; }
}

View File

@ -34,16 +34,17 @@ public class ApprovalFlowMiddleware
private readonly RequestDelegate _next;
private readonly SysApprovalService _sysApprovalService;
public ApprovalFlowMiddleware(RequestDelegate next, SysApprovalService sysApprovalService)
public ApprovalFlowMiddleware(RequestDelegate next)
{
_next = next;
_sysApprovalService = sysApprovalService;
_sysApprovalService = App.GetRequiredService<SysApprovalService>();
}
public async Task Invoke(HttpContext context)
public async Task InvokeAsync(HttpContext context)
{
await _sysApprovalService.MatchApproval(context);
await _next.Invoke(context);
// 调用下一个中间件
await _next(context);
}
}

View File

@ -103,7 +103,7 @@ public class SuperApiAop : DefaultSuperApiAop
var logger = App.GetRequiredService<ILoggerFactory>().CreateLogger(CommonConst.SysLogCategoryName);
using var scope = logger.ScopeContext(new Dictionary<object, object> {
{ "loggingMonitor", apiInfo.ToString() }
{ "loggingMonitor", apiInfo.ToJson() }
});
logger.Log(logLevel, "ReZero超级API接口日志");
}

View File

@ -2,7 +2,7 @@
"name": "admin.net.pro",
"type": "module",
"version": "2.4.33",
"lastBuildTime": "2025.01.23",
"lastBuildTime": "2025.01.25",
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
"author": "zuohuaijun",
"license": "MIT",
@ -85,7 +85,7 @@
"@iconify/vue": "^4.3.0",
"@plugin-web-update-notification/vite": "^2.0.0",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.17.14",
"@types/node": "^20.17.16",
"@types/nprogress": "^0.2.3",
"@types/sortablejs": "^1.15.8",
"@typescript-eslint/eslint-plugin": "^8.21.0",
@ -94,7 +94,7 @@
"@vitejs/plugin-vue-jsx": "^4.1.1",
"@vue/compiler-sfc": "^3.5.13",
"code-inspector-plugin": "^0.19.2",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"eslint-plugin-vue": "^9.32.0",
"globals": "^15.14.0",
"less": "^4.2.2",

View File

@ -18,16 +18,15 @@ import { Configuration } from '../configuration';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { AddConfigInput } from '../models';
import { AdminNETResultListConfigOutput } from '../models';
import { AdminNETResultListString } from '../models';
import { AdminNETResultSqlSugarPagedListConfigOutput } from '../models';
import { AdminNETResultListSysConfig } from '../models';
import { AdminNETResultSqlSugarPagedListSysConfig } from '../models';
import { AdminNETResultString } from '../models';
import { AdminNETResultSysConfig } from '../models';
import { BatchConfigInput } from '../models';
import { DeleteConfigInput } from '../models';
import { PageConfigInput } from '../models';
import { UpdateConfigInput } from '../models';
import { UpdateDefaultValueInput } from '../models';
/**
* SysConfigApi - axios parameter creator
* @export
@ -466,54 +465,6 @@ export const SysConfigApiAxiosParamCreator = function (configuration?: Configura
options: localVarRequestOptions,
};
},
/**
*
* @summary 🔖
* @param {UpdateDefaultValueInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysConfigUpdateDefaultPost: async (body?: UpdateDefaultValueInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysConfig/updateDefault`;
// 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 🔖
@ -675,7 +626,7 @@ export const SysConfigApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultListConfigOutput>>> {
async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultListSysConfig>>> {
const localVarAxiosArgs = await SysConfigApiAxiosParamCreator(configuration).apiSysConfigListPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
@ -689,27 +640,13 @@ export const SysConfigApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSqlSugarPagedListConfigOutput>>> {
async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSqlSugarPagedListSysConfig>>> {
const localVarAxiosArgs = await SysConfigApiAxiosParamCreator(configuration).apiSysConfigPagePost(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 {UpdateDefaultValueInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigUpdateDefaultPost(body?: UpdateDefaultValueInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysConfigApiAxiosParamCreator(configuration).apiSysConfigUpdateDefaultPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary 🔖
@ -809,7 +746,7 @@ export const SysConfigApiFactory = function (configuration?: Configuration, base
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultListConfigOutput>> {
async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultListSysConfig>> {
return SysConfigApiFp(configuration).apiSysConfigListPost(body, options).then((request) => request(axios, basePath));
},
/**
@ -819,19 +756,9 @@ export const SysConfigApiFactory = function (configuration?: Configuration, base
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSqlSugarPagedListConfigOutput>> {
async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSqlSugarPagedListSysConfig>> {
return SysConfigApiFp(configuration).apiSysConfigPagePost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
* @param {UpdateDefaultValueInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysConfigUpdateDefaultPost(body?: UpdateDefaultValueInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysConfigApiFp(configuration).apiSysConfigUpdateDefaultPost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary 🔖
@ -936,7 +863,7 @@ export class SysConfigApi extends BaseAPI {
* @throws {RequiredError}
* @memberof SysConfigApi
*/
public async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultListConfigOutput>> {
public async apiSysConfigListPost(body?: PageConfigInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultListSysConfig>> {
return SysConfigApiFp(this.configuration).apiSysConfigListPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
@ -947,20 +874,9 @@ export class SysConfigApi extends BaseAPI {
* @throws {RequiredError}
* @memberof SysConfigApi
*/
public async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSqlSugarPagedListConfigOutput>> {
public async apiSysConfigPagePost(body?: PageConfigInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSqlSugarPagedListSysConfig>> {
return SysConfigApiFp(this.configuration).apiSysConfigPagePost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖
* @param {UpdateDefaultValueInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysConfigApi
*/
public async apiSysConfigUpdateDefaultPost(body?: UpdateDefaultValueInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysConfigApiFp(this.configuration).apiSysConfigUpdateDefaultPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary 🔖

View File

@ -12,20 +12,20 @@
* Do not edit the class manually.
*/
import { ConfigOutput } from './config-output';
import { SysConfig } from './sys-config';
/**
*
*
* @export
* @interface AdminNETResultListConfigOutput
* @interface AdminNETResultListSysConfig
*/
export interface AdminNETResultListConfigOutput {
export interface AdminNETResultListSysConfig {
/**
*
*
* @type {number}
* @memberof AdminNETResultListConfigOutput
* @memberof AdminNETResultListSysConfig
*/
code?: number;
@ -33,7 +33,7 @@ export interface AdminNETResultListConfigOutput {
* successwarningerror
*
* @type {string}
* @memberof AdminNETResultListConfigOutput
* @memberof AdminNETResultListSysConfig
*/
type?: string | null;
@ -41,23 +41,23 @@ export interface AdminNETResultListConfigOutput {
*
*
* @type {string}
* @memberof AdminNETResultListConfigOutput
* @memberof AdminNETResultListSysConfig
*/
message?: string | null;
/**
*
*
* @type {Array<ConfigOutput>}
* @memberof AdminNETResultListConfigOutput
* @type {Array<SysConfig>}
* @memberof AdminNETResultListSysConfig
*/
result?: Array<ConfigOutput> | null;
result?: Array<SysConfig> | null;
/**
*
*
* @type {any}
* @memberof AdminNETResultListConfigOutput
* @memberof AdminNETResultListSysConfig
*/
extras?: any | null;
@ -65,7 +65,7 @@ export interface AdminNETResultListConfigOutput {
*
*
* @type {Date}
* @memberof AdminNETResultListConfigOutput
* @memberof AdminNETResultListSysConfig
*/
time?: Date;
}

View File

@ -12,20 +12,20 @@
* Do not edit the class manually.
*/
import { SqlSugarPagedListConfigOutput } from './sql-sugar-paged-list-config-output';
import { SqlSugarPagedListSysConfig } from './sql-sugar-paged-list-sys-config';
/**
*
*
* @export
* @interface AdminNETResultSqlSugarPagedListConfigOutput
* @interface AdminNETResultSqlSugarPagedListSysConfig
*/
export interface AdminNETResultSqlSugarPagedListConfigOutput {
export interface AdminNETResultSqlSugarPagedListSysConfig {
/**
*
*
* @type {number}
* @memberof AdminNETResultSqlSugarPagedListConfigOutput
* @memberof AdminNETResultSqlSugarPagedListSysConfig
*/
code?: number;
@ -33,7 +33,7 @@ export interface AdminNETResultSqlSugarPagedListConfigOutput {
* successwarningerror
*
* @type {string}
* @memberof AdminNETResultSqlSugarPagedListConfigOutput
* @memberof AdminNETResultSqlSugarPagedListSysConfig
*/
type?: string | null;
@ -41,21 +41,21 @@ export interface AdminNETResultSqlSugarPagedListConfigOutput {
*
*
* @type {string}
* @memberof AdminNETResultSqlSugarPagedListConfigOutput
* @memberof AdminNETResultSqlSugarPagedListSysConfig
*/
message?: string | null;
/**
* @type {SqlSugarPagedListConfigOutput}
* @memberof AdminNETResultSqlSugarPagedListConfigOutput
* @type {SqlSugarPagedListSysConfig}
* @memberof AdminNETResultSqlSugarPagedListSysConfig
*/
result?: SqlSugarPagedListConfigOutput;
result?: SqlSugarPagedListSysConfig;
/**
*
*
* @type {any}
* @memberof AdminNETResultSqlSugarPagedListConfigOutput
* @memberof AdminNETResultSqlSugarPagedListSysConfig
*/
extras?: any | null;
@ -63,7 +63,7 @@ export interface AdminNETResultSqlSugarPagedListConfigOutput {
*
*
* @type {Date}
* @memberof AdminNETResultSqlSugarPagedListConfigOutput
* @memberof AdminNETResultSqlSugarPagedListSysConfig
*/
time?: Date;
}

View File

@ -1,149 +0,0 @@
/* 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 ConfigOutput
*/
export interface ConfigOutput {
/**
* Id
*
* @type {number}
* @memberof ConfigOutput
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof ConfigOutput
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof ConfigOutput
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof ConfigOutput
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof ConfigOutput
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof ConfigOutput
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof ConfigOutput
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof ConfigOutput
*/
isDelete?: boolean;
/**
*
*
* @type {string}
* @memberof ConfigOutput
*/
name: string;
/**
*
*
* @type {string}
* @memberof ConfigOutput
*/
code?: string | null;
/**
*
*
* @type {string}
* @memberof ConfigOutput
*/
value?: string | null;
/**
* @type {YesNoEnum}
* @memberof ConfigOutput
*/
sysFlag?: YesNoEnum;
/**
*
*
* @type {string}
* @memberof ConfigOutput
*/
groupCode?: string | null;
/**
*
*
* @type {number}
* @memberof ConfigOutput
*/
orderNo?: number;
/**
*
*
* @type {string}
* @memberof ConfigOutput
*/
remark?: string | null;
/**
*
*
* @type {string}
* @memberof ConfigOutput
*/
defaultValue?: string | null;
}

View File

@ -39,7 +39,6 @@ export * from './admin-netresult-jobject';
export * from './admin-netresult-list-api-output';
export * from './admin-netresult-list-code-gen-config';
export * from './admin-netresult-list-column-ouput';
export * from './admin-netresult-list-config-output';
export * from './admin-netresult-list-const-output';
export * from './admin-netresult-list-database-output';
export * from './admin-netresult-list-db-backup-output';
@ -57,6 +56,7 @@ export * from './admin-netresult-list-role-table-output';
export * from './admin-netresult-list-stat-log-output';
export * from './admin-netresult-list-string';
export * from './admin-netresult-list-sys-code-gen-template';
export * from './admin-netresult-list-sys-config';
export * from './admin-netresult-list-sys-dict-data';
export * from './admin-netresult-list-sys-dict-type';
export * from './admin-netresult-list-sys-file';
@ -78,13 +78,13 @@ export * from './admin-netresult-login-output';
export * from './admin-netresult-login-user-output';
export * from './admin-netresult-object';
export * from './admin-netresult-sm-key-pair-output';
export * from './admin-netresult-sql-sugar-paged-list-config-output';
export * from './admin-netresult-sql-sugar-paged-list-job-detail-output';
export * from './admin-netresult-sql-sugar-paged-list-oauth-user-output';
export * from './admin-netresult-sql-sugar-paged-list-open-access-output';
export * from './admin-netresult-sql-sugar-paged-list-page-pos-output';
export * from './admin-netresult-sql-sugar-paged-list-page-role-output';
export * from './admin-netresult-sql-sugar-paged-list-sys-code-gen';
export * from './admin-netresult-sql-sugar-paged-list-sys-config';
export * from './admin-netresult-sql-sugar-paged-list-sys-dict-data';
export * from './admin-netresult-sql-sugar-paged-list-sys-dict-type';
export * from './admin-netresult-sql-sugar-paged-list-sys-file';
@ -148,7 +148,6 @@ export * from './code-gen-type-enum';
export * from './column-ouput';
export * from './column-relation';
export * from './compare-info';
export * from './config-output';
export * from './const-output';
export * from './constructor-info';
export * from './create-entity-input';
@ -340,13 +339,13 @@ export * from './signature-input';
export * from './sm-key-pair-output';
export * from './sms-verify-code-input';
export * from './sort-version';
export * from './sql-sugar-paged-list-config-output';
export * from './sql-sugar-paged-list-job-detail-output';
export * from './sql-sugar-paged-list-oauth-user-output';
export * from './sql-sugar-paged-list-open-access-output';
export * from './sql-sugar-paged-list-page-pos-output';
export * from './sql-sugar-paged-list-page-role-output';
export * from './sql-sugar-paged-list-sys-code-gen';
export * from './sql-sugar-paged-list-sys-config';
export * from './sql-sugar-paged-list-sys-dict-data';
export * from './sql-sugar-paged-list-sys-dict-type';
export * from './sql-sugar-paged-list-sys-file';
@ -437,7 +436,6 @@ export * from './update-code-gen-input';
export * from './update-config-input';
export * from './update-db-column-input';
export * from './update-db-table-input';
export * from './update-default-value-input';
export * from './update-dict-data-input';
export * from './update-dict-type-input';
export * from './update-job-detail-input';

View File

@ -12,20 +12,20 @@
* Do not edit the class manually.
*/
import { ConfigOutput } from './config-output';
import { SysConfig } from './sys-config';
/**
*
*
* @export
* @interface SqlSugarPagedListConfigOutput
* @interface SqlSugarPagedListSysConfig
*/
export interface SqlSugarPagedListConfigOutput {
export interface SqlSugarPagedListSysConfig {
/**
*
*
* @type {number}
* @memberof SqlSugarPagedListConfigOutput
* @memberof SqlSugarPagedListSysConfig
*/
page?: number;
@ -33,7 +33,7 @@ export interface SqlSugarPagedListConfigOutput {
*
*
* @type {number}
* @memberof SqlSugarPagedListConfigOutput
* @memberof SqlSugarPagedListSysConfig
*/
pageSize?: number;
@ -41,7 +41,7 @@ export interface SqlSugarPagedListConfigOutput {
*
*
* @type {number}
* @memberof SqlSugarPagedListConfigOutput
* @memberof SqlSugarPagedListSysConfig
*/
total?: number;
@ -49,23 +49,23 @@ export interface SqlSugarPagedListConfigOutput {
*
*
* @type {number}
* @memberof SqlSugarPagedListConfigOutput
* @memberof SqlSugarPagedListSysConfig
*/
totalPages?: number;
/**
*
*
* @type {Array<ConfigOutput>}
* @memberof SqlSugarPagedListConfigOutput
* @type {Array<SysConfig>}
* @memberof SqlSugarPagedListSysConfig
*/
items?: Array<ConfigOutput> | null;
items?: Array<SysConfig> | null;
/**
*
*
* @type {boolean}
* @memberof SqlSugarPagedListConfigOutput
* @memberof SqlSugarPagedListSysConfig
*/
hasPrevPage?: boolean;
@ -73,7 +73,7 @@ export interface SqlSugarPagedListConfigOutput {
*
*
* @type {boolean}
* @memberof SqlSugarPagedListConfigOutput
* @memberof SqlSugarPagedListSysConfig
*/
hasNextPage?: boolean;
}

View File

@ -1,38 +0,0 @@
/* 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 UpdateDefaultValueInput
*/
export interface UpdateDefaultValueInput {
/**
* Id
*
* @type {number}
* @memberof UpdateDefaultValueInput
*/
id: number;
/**
*
*
* @type {string}
* @memberof UpdateDefaultValueInput
*/
defaultValue?: string | null;
}

View File

@ -149,6 +149,11 @@ onMounted(async () => {
const accessToken = route.query.token;
if (accessToken) await saveTokenAndInitRoutes(accessToken);
// //
// if (window.__env__.VITE_SM_PUBLIC_KEY == '' || window.__env__.VITE_SM_PUBLIC_KEY == undefined) {
// window.location.reload();
// }
//
state.secondVerEnabled = themeConfig.value.secondVer ?? false;
state.captchaEnabled = themeConfig.value.captcha ?? true;
@ -192,9 +197,6 @@ const getCaptcha = async () => {
state.captchaImage = 'data:text/html;base64,' + res?.img;
state.expirySeconds = res?.expirySeconds;
state.ruleForm.codeId = res?.id;
if (state.captchaImage != '' && window.__env__.VITE_SM_PUBLIC_KEY == '') {
window.location.reload();
}
};
//

View File

@ -84,7 +84,7 @@ const getThemeConfig = computed(() => {
return themeConfig.value;
});
//
onMounted(() => {
onMounted(async () => {
// Id
var tenantid = Number(route.query.tid);
if (isNaN(tenantid)) {
@ -92,7 +92,7 @@ onMounted(() => {
} else if (tenantid > 99999) {
Local.set('tid', tenantid);
}
loadSysInfo(tenantid);
await loadSysInfo(tenantid);
NextLoading.done();
});

View File

@ -52,7 +52,6 @@
</el-space>
</template> -->
</el-input>
<span v-if="state.ruleForm.id > 0">默认值{{ state.ruleForm.defaultValue }}</span>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
@ -83,7 +82,6 @@
<template #footer>
<span class="dialog-footer">
<el-button icon="ele-CircleCloseFilled" @click="cancel"> </el-button>
<el-button type="primary" icon="ele-CircleCheckFilled" v-if="state.ruleForm.id > 0" v-auth="'sysConfig/updateDefault'" @click="updateDefault">更新默认值</el-button>
<el-button type="primary" icon="ele-CircleCheckFilled" @click="submit"> </el-button>
</span>
</template>
@ -93,10 +91,10 @@
<script lang="ts" setup name="sysEditConfig">
import { reactive, ref } from 'vue';
import { ElMessage } from 'element-plus';
import { getAPI } from '/@/utils/axios-utils';
import { SysConfigApi } from '/@/api-services/api';
import { ConfigOutput } from '/@/api-services/models';
import { UpdateConfigInput } from '/@/api-services/models';
const props = defineProps({
title: String,
@ -105,7 +103,7 @@ const emits = defineEmits(['updateData']);
const ruleFormRef = ref();
const state = reactive({
isShowDialog: false,
ruleForm: {} as ConfigOutput,
ruleForm: {} as UpdateConfigInput,
});
//
@ -126,18 +124,6 @@ const cancel = () => {
state.isShowDialog = false;
};
//
const updateDefault = () => {
getAPI(SysConfigApi)
.apiSysConfigUpdateDefaultPost({
id: state.ruleForm.id,
defaultValue: state.ruleForm.value,
} as any)
.then((res: any) => {
if (res.data.code == 200) ElMessage.success('更新成功');
});
};
//
const submit = () => {
ruleFormRef.value.validate(async (valid: boolean) => {

View File

@ -124,13 +124,13 @@
</splitpanes>
<el-drawer :title="state.fileName" v-model="state.docxVisible" size="70%" destroy-on-close>
<vue-office-docx :src="state.docxUrl" style="height: calc(100vh - 37px)" @rendered="handleRendered" @error="handleError" />
<vue-office-docx v-loading="state.loading" :src="state.docxUrl" style="height: calc(100vh - 37px)" @rendered="handleRendered" @error="handleError" />
</el-drawer>
<el-drawer :title="state.fileName" v-model="state.xlsxVisible" size="70%" destroy-on-close>
<vue-office-excel :src="state.excelUrl" style="height: calc(100vh - 37px)" @rendered="handleRendered" @error="handleError" />
<vue-office-excel v-loading="state.loading" :src="state.excelUrl" style="height: calc(100vh - 37px)" @rendered="handleRendered" @error="handleError" />
</el-drawer>
<el-drawer :title="state.fileName" v-model="state.pdfVisible" size="70%" destroy-on-close>
<vue-office-pdf :src="state.pdfUrl" style="height: calc(100vh - 37px)" @rendered="handleRendered" @error="handleError" />
<vue-office-pdf v-loading="state.loading" :src="state.pdfUrl" style="height: calc(100vh - 37px)" @rendered="handleRendered" @error="handleError" />
</el-drawer>
<el-image-viewer v-if="state.showViewer" :url-list="state.previewList" :hideOnClickModal="true" @close="state.showViewer = false"></el-image-viewer>
<EditFile ref="editRef" title="编辑文件" @handleQuery="handleQuery" />
@ -169,6 +169,7 @@ const editRef = ref<InstanceType<typeof EditFile>>();
const fileTreeRef = ref<InstanceType<typeof FileTree>>();
const state = reactive({
loading: false,
queryParams: {
fileName: undefined,
filePath: undefined,
@ -287,7 +288,7 @@ const handleUpload = async () => {
const handleDownload = async (row: any) => {
// var res = await getAPI(SysFileApi).sysFileDownloadPost({ id: row.id });
var fileUrl = fetchFileUrl(row);
downloadByUrl({ url: fileUrl });
downloadByUrl({ url: fileUrl, fileName: row.fileName });
};
//
@ -330,6 +331,7 @@ const handleNodeChange = async (node: any) => {
// Pdf
const showPreviewDialog = async (row: any) => {
state.loading = true;
if (row.suffix == '.pdf') {
state.fileName = `${row.fileName}${row.suffix}`;
state.pdfUrl = fetchFileUrl(row);
@ -365,8 +367,14 @@ const handleEdit = (row: any) => {
};
//
const handleRendered = () => {};
const handleRendered = () => {
state.loading = false;
};
//
const handleError = () => {};
const handleError = () => {
ElMessage.error('预览失败');
state.loading = false;
state.docxVisible = false;
};
</script>