Merge pull request 'main' (#1) from Admin.NET/Admin.NET.Pro:main into main
Reviewed-on: http://101.43.53.74:3000/coolcalf/Admin.NET.Pro/pulls/1
This commit is contained in:
commit
7c0222e3fc
@ -17,27 +17,27 @@
|
|||||||
<PackageReference Include="AngleSharp" Version="1.1.2" />
|
<PackageReference Include="AngleSharp" Version="1.1.2" />
|
||||||
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
||||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.14.4" />
|
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.14.6" />
|
||||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.4.3" />
|
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.4.5" />
|
||||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.4.3" />
|
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.4.5" />
|
||||||
<PackageReference Include="Furion.Pure" Version="4.9.4.3" />
|
<PackageReference Include="Furion.Pure" Version="4.9.4.5" />
|
||||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||||
<PackageReference Include="IPTools.International" Version="1.6.0" />
|
<PackageReference Include="IPTools.International" Version="1.6.0" />
|
||||||
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.5.1" />
|
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.5.1" />
|
||||||
<PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.1" />
|
<PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.1" />
|
||||||
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.1" />
|
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.1" />
|
||||||
<PackageReference Include="MailKit" Version="4.7.0" />
|
<PackageReference Include="MailKit" Version="4.7.0" />
|
||||||
<PackageReference Include="NewLife.Redis" Version="5.7.2024.701" />
|
<PackageReference Include="NewLife.Redis" Version="5.7.2024.709" />
|
||||||
<PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" />
|
<PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" />
|
||||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
|
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
|
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.3.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.3.0" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.6.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.6.0" />
|
||||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.160" />
|
<PackageReference Include="SqlSugarCore" Version="5.1.4.162" />
|
||||||
<PackageReference Include="SSH.NET" Version="2024.1.0" />
|
<PackageReference Include="SSH.NET" Version="2024.1.0" />
|
||||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.3" />
|
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.3" />
|
||||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1042" />
|
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1045" />
|
||||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
|
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
|
||||||
<PackageReference Include="AspNet.Security.OAuth.Gitee" Version="6.0.15" />
|
<PackageReference Include="AspNet.Security.OAuth.Gitee" Version="6.0.15" />
|
||||||
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" />
|
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" />
|
||||||
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.6" />
|
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.8" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.31" />
|
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.31" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="6.0.31" />
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="6.0.31" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.31" />
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.31" />
|
||||||
@ -56,9 +56,9 @@
|
|||||||
<PackageReference Include="AspNet.Security.OAuth.Gitee" Version="8.1.0" />
|
<PackageReference Include="AspNet.Security.OAuth.Gitee" Version="8.1.0" />
|
||||||
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="8.1.0" />
|
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="8.1.0" />
|
||||||
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.7" />
|
<PackageReference Include="Lazy.Captcha.Core" Version="2.0.7" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.6" />
|
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.7" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.6" />
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.7" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.6" />
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.7" />
|
||||||
<PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.2.0" />
|
<PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.2.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@ -122,4 +122,10 @@ public partial class SysCodeGen : EntityBase
|
|||||||
[SugarColumn(ColumnDescription = "打印模版名称", Length = 32)]
|
[SugarColumn(ColumnDescription = "打印模版名称", Length = 32)]
|
||||||
[MaxLength(32)]
|
[MaxLength(32)]
|
||||||
public string? PrintName { get; set; }
|
public string? PrintName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用 Api Service
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "是否使用 Api Service")]
|
||||||
|
public bool IsApiService { get; set; } = false;
|
||||||
}
|
}
|
||||||
@ -19,33 +19,34 @@ public class SysBaseApiSeedData : ISqlSugarEntitySeedData<SysBaseApi>
|
|||||||
{
|
{
|
||||||
return new[]
|
return new[]
|
||||||
{
|
{
|
||||||
new SysBaseApi { Id = 1300000000001, Route = "sysAuth/login" },
|
new SysBaseApi { Id = 1300000000010, Route = "sysAuth/login" },
|
||||||
new SysBaseApi { Id = 1300000000002, Route = "sysAuth/unLockScreen" },
|
new SysBaseApi { Id = 1300000000020, Route = "sysAuth/unLockScreen" },
|
||||||
new SysBaseApi { Id = 1300000000003, Route = "sysAuth/userInfo" },
|
new SysBaseApi { Id = 1300000000030, Route = "sysAuth/userInfo" },
|
||||||
new SysBaseApi { Id = 1300000000004, Route = "sysAuth/refreshToken" },
|
new SysBaseApi { Id = 1300000000040, Route = "sysAuth/refreshToken" },
|
||||||
new SysBaseApi { Id = 1300000000005, Route = "sysAuth/loginConfig" },
|
new SysBaseApi { Id = 1300000000050, Route = "sysAuth/loginConfig" },
|
||||||
new SysBaseApi { Id = 1300000000006, Route = "sysAuth/watermarkConfig" },
|
new SysBaseApi { Id = 1300000000060, Route = "sysAuth/watermarkConfig" },
|
||||||
new SysBaseApi { Id = 1300000000007, Route = "sysAuth/captcha" },
|
new SysBaseApi { Id = 1300000000070, Route = "sysAuth/captcha" },
|
||||||
new SysBaseApi { Id = 1300000000008, Route = "sysMenu/loginMenuTree" },
|
new SysBaseApi { Id = 1300000000080, Route = "sysAuth/logout" },
|
||||||
new SysBaseApi { Id = 1300000000009, Route = "sysOAuth/signIn" },
|
new SysBaseApi { Id = 1300000000090, Route = "sysMenu/loginMenuTree" },
|
||||||
new SysBaseApi { Id = 1300000000010, Route = "sysOAuth/signInCallback" },
|
new SysBaseApi { Id = 1300000000100, Route = "sysOAuth/signIn" },
|
||||||
new SysBaseApi { Id = 1300000000011, Route = "sysOnlineUser/page" },
|
new SysBaseApi { Id = 1300000000110, Route = "sysOAuth/signInCallback" },
|
||||||
new SysBaseApi { Id = 1300000000012, Route = "sysOrg/list" },
|
new SysBaseApi { Id = 1300000000120, Route = "sysOnlineUser/page" },
|
||||||
new SysBaseApi { Id = 1300000000013, Route = "sysPos/list" },
|
new SysBaseApi { Id = 1300000000130, Route = "sysOrg/list" },
|
||||||
new SysBaseApi { Id = 1300000000014, Route = "sysRole/page" },
|
new SysBaseApi { Id = 1300000000140, Route = "sysPos/list" },
|
||||||
new SysBaseApi { Id = 1300000000015, Route = "sysRole/list" },
|
new SysBaseApi { Id = 1300000000150, Route = "sysRole/page" },
|
||||||
new SysBaseApi { Id = 1300000000016, Route = "sysFile/uploadAvatar" },
|
new SysBaseApi { Id = 1300000000160, Route = "sysRole/list" },
|
||||||
new SysBaseApi { Id = 1300000000017, Route = "sysFile/uploadSignature" },
|
new SysBaseApi { Id = 1300000000170, Route = "sysFile/uploadAvatar" },
|
||||||
new SysBaseApi { Id = 1300000000018, Route = "sysUser/baseInfo" },
|
new SysBaseApi { Id = 1300000000180, Route = "sysFile/uploadSignature" },
|
||||||
new SysBaseApi { Id = 1300000000019, Route = "sysUser/changePwd" },
|
new SysBaseApi { Id = 1300000000190, Route = "sysUser/baseInfo" },
|
||||||
new SysBaseApi { Id = 1300000000020, Route = "sysNotice/page" },
|
new SysBaseApi { Id = 1300000000200, Route = "sysUser/changePwd" },
|
||||||
new SysBaseApi { Id = 1300000000021, Route = "sysNotice/add" },
|
new SysBaseApi { Id = 1300000000210, Route = "sysNotice/page" },
|
||||||
new SysBaseApi { Id = 1300000000022, Route = "sysNotice/update" },
|
new SysBaseApi { Id = 1300000000220, Route = "sysNotice/add" },
|
||||||
new SysBaseApi { Id = 1300000000023, Route = "sysNotice/delete" },
|
new SysBaseApi { Id = 1300000000230, Route = "sysNotice/update" },
|
||||||
new SysBaseApi { Id = 1300000000024, Route = "sysNotice/public" },
|
new SysBaseApi { Id = 1300000000240, Route = "sysNotice/delete" },
|
||||||
new SysBaseApi { Id = 1300000000025, Route = "sysNotice/setRead" },
|
new SysBaseApi { Id = 1300000000250, Route = "sysNotice/public" },
|
||||||
new SysBaseApi { Id = 1300000000026, Route = "sysNotice/pageReceived" },
|
new SysBaseApi { Id = 1300000000260, Route = "sysNotice/setRead" },
|
||||||
new SysBaseApi { Id = 1300000000027, Route = "sysNotice/unReadList" },
|
new SysBaseApi { Id = 1300000000270, Route = "sysNotice/pageReceived" },
|
||||||
|
new SysBaseApi { Id = 1300000000280, Route = "sysNotice/unReadList" },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9,7 +9,7 @@ namespace Admin.NET.Core.Service;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统域登录信息配置输入参数
|
/// 系统域登录信息配置输入参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SysLdapInput : BasePageInput
|
public class PageSysLdapInput : BasePageInput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关键字查询
|
/// 关键字查询
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class SysLdapService : IDynamicApiController, ITransient
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("获取系统域登录配置分页列表")]
|
[DisplayName("获取系统域登录配置分页列表")]
|
||||||
public async Task<SqlSugarPagedList<SysLdap>> Page(SysLdapInput input)
|
public async Task<SqlSugarPagedList<SysLdap>> Page(PageSysLdapInput input)
|
||||||
{
|
{
|
||||||
return await _sysLdapRep.AsQueryable()
|
return await _sysLdapRep.AsQueryable()
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => u.Host.Contains(input.SearchKey.Trim()))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => u.Host.Contains(input.SearchKey.Trim()))
|
||||||
|
|||||||
@ -52,6 +52,8 @@ public class CustomViewEngine : ViewEngineModel
|
|||||||
|
|
||||||
public string PrintName { get; set; }
|
public string PrintName { get; set; }
|
||||||
|
|
||||||
|
public bool IsApiService { get; set; }
|
||||||
|
|
||||||
public List<CodeGenConfig> QueryWhetherList { get; set; }
|
public List<CodeGenConfig> QueryWhetherList { get; set; }
|
||||||
|
|
||||||
public List<CodeGenConfig> TableField { get; set; }
|
public List<CodeGenConfig> TableField { get; set; }
|
||||||
|
|||||||
@ -80,4 +80,9 @@ public class CodeGenOutput
|
|||||||
/// 打印模版名称
|
/// 打印模版名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PrintName { get; set; }
|
public string PrintName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用 Api Service
|
||||||
|
/// </summary>
|
||||||
|
public bool IsApiService { get; set; }
|
||||||
}
|
}
|
||||||
@ -9,7 +9,7 @@ namespace Admin.NET.Core.Service;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 代码生成参数类
|
/// 代码生成参数类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CodeGenInput : BasePageInput
|
public class PageCodeGenInput : BasePageInput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 作者姓名
|
/// 作者姓名
|
||||||
@ -100,9 +100,14 @@ public class CodeGenInput : BasePageInput
|
|||||||
/// 打印模版名称
|
/// 打印模版名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual string PrintName { get; set; }
|
public virtual string PrintName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用 Api Service
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool IsApiService { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AddCodeGenInput : CodeGenInput
|
public class AddCodeGenInput : PageCodeGenInput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据库表名
|
/// 数据库表名
|
||||||
@ -157,6 +162,11 @@ public class AddCodeGenInput : CodeGenInput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Required(ErrorMessage = "是否生成菜单不能为空")]
|
[Required(ErrorMessage = "是否生成菜单不能为空")]
|
||||||
public override bool GenerateMenu { get; set; }
|
public override bool GenerateMenu { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用 Api Service
|
||||||
|
/// </summary>
|
||||||
|
public override bool IsApiService { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeleteCodeGenInput
|
public class DeleteCodeGenInput
|
||||||
@ -168,7 +178,7 @@ public class DeleteCodeGenInput
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UpdateCodeGenInput : CodeGenInput
|
public class UpdateCodeGenInput : PageCodeGenInput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 代码生成器Id
|
/// 代码生成器Id
|
||||||
@ -37,11 +37,12 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("获取代码生成分页列表")]
|
[DisplayName("获取代码生成分页列表")]
|
||||||
public async Task<SqlSugarPagedList<SysCodeGen>> Page(CodeGenInput input)
|
public async Task<SqlSugarPagedList<SysCodeGen>> Page(PageCodeGenInput input)
|
||||||
{
|
{
|
||||||
return await _db.Queryable<SysCodeGen>()
|
return await _db.Queryable<SysCodeGen>()
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.TableName), u => u.TableName.Contains(input.TableName.Trim()))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TableName), u => u.TableName.Contains(input.TableName.Trim()))
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.BusName), u => u.BusName.Contains(input.BusName.Trim()))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.BusName), u => u.BusName.Contains(input.BusName.Trim()))
|
||||||
|
.OrderBy(u => u.Id, OrderByType.Desc)
|
||||||
.ToPagedListAsync(input.Page, input.PageSize);
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,6 +348,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
|||||||
IsUpload = joinTableList.Where(u => u.EffectType == "Upload").Any(),
|
IsUpload = joinTableList.Where(u => u.EffectType == "Upload").Any(),
|
||||||
PrintType = input.PrintType,
|
PrintType = input.PrintType,
|
||||||
PrintName = input.PrintName,
|
PrintName = input.PrintName,
|
||||||
|
IsApiService = input.IsApiService
|
||||||
};
|
};
|
||||||
// 模板目录
|
// 模板目录
|
||||||
var templatePathList = GetTemplatePathList(input);
|
var templatePathList = GetTemplatePathList(input);
|
||||||
@ -412,6 +414,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
|||||||
IsUpload = joinTableList.Where(u => u.EffectType == "Upload").Any(),
|
IsUpload = joinTableList.Where(u => u.EffectType == "Upload").Any(),
|
||||||
PrintType = input.PrintType,
|
PrintType = input.PrintType,
|
||||||
PrintName = input.PrintName,
|
PrintName = input.PrintName,
|
||||||
|
IsApiService = input.IsApiService
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取模板文件并替换
|
// 获取模板文件并替换
|
||||||
|
|||||||
@ -14,12 +14,15 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
private readonly SysCacheService _sysCacheService;
|
private readonly SysCacheService _sysCacheService;
|
||||||
private readonly SqlSugarRepository<SysConfig> _sysConfigRep;
|
private readonly SqlSugarRepository<SysConfig> _sysConfigRep;
|
||||||
|
private readonly UserManager _userManager;
|
||||||
|
|
||||||
public SysConfigService(SysCacheService sysCacheService,
|
public SysConfigService(SysCacheService sysCacheService,
|
||||||
SqlSugarRepository<SysConfig> sysConfigRep)
|
SqlSugarRepository<SysConfig> sysConfigRep,
|
||||||
|
UserManager userManager)
|
||||||
{
|
{
|
||||||
_sysCacheService = sysCacheService;
|
_sysCacheService = sysCacheService;
|
||||||
_sysConfigRep = sysConfigRep;
|
_sysConfigRep = sysConfigRep;
|
||||||
|
_userManager = userManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -31,7 +34,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigInput input)
|
public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigInput input)
|
||||||
{
|
{
|
||||||
return await _sysConfigRep.AsQueryable()
|
return await _sysConfigRep.AsQueryable()
|
||||||
.Where(u => u.GroupCode != "WebConfig") // 不显示 WebConfig 分组
|
.WhereIF(!_userManager.SuperAdmin, u => u.GroupCode != "WebConfig") // 若非超管,不显示 WebConfig 分组
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name?.Trim()), u => u.Name.Contains(input.Name))
|
.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.Code?.Trim()), u => u.Code.Contains(input.Code))
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.GroupCode?.Trim()), u => u.GroupCode.Equals(input.GroupCode))
|
||||||
|
|||||||
@ -9,7 +9,7 @@ namespace Admin.NET.Core.Service;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开放接口身份输入参数
|
/// 开放接口身份输入参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class OpenAccessInput : BasePageInput
|
public class PageOpenAccessInput : BasePageInput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 身份标识
|
/// 身份标识
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public class SysOpenAccessService : IDynamicApiController, ITransient
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("获取开放接口身份分页列表")]
|
[DisplayName("获取开放接口身份分页列表")]
|
||||||
public async Task<SqlSugarPagedList<OpenAccessOutput>> Page(OpenAccessInput input)
|
public async Task<SqlSugarPagedList<OpenAccessOutput>> Page(PageOpenAccessInput input)
|
||||||
{
|
{
|
||||||
return await _sysOpenAccessRep.AsQueryable()
|
return await _sysOpenAccessRep.AsQueryable()
|
||||||
.LeftJoin<SysUser>((u, a) => u.BindUserId == a.Id)
|
.LeftJoin<SysUser>((u, a) => u.BindUserId == a.Id)
|
||||||
|
|||||||
@ -169,16 +169,24 @@
|
|||||||
import { ref,onMounted, reactive } from "vue";
|
import { ref,onMounted, reactive } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import type { FormRules } from "element-plus";
|
import type { FormRules } from "element-plus";
|
||||||
|
@if (@Model.IsApiService) {
|
||||||
// 接口函数
|
// 接口函数
|
||||||
import { getAPI } from '/@@/utils/axios-utils';
|
@:import { getAPI } from '/@@/utils/axios-utils';
|
||||||
|
|
||||||
// 接口
|
// 接口
|
||||||
import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
@:import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
||||||
|
|
||||||
// 模型
|
// 模型
|
||||||
import { Update@(@Model.ClassName)Input } from '/@@/api-services/models';
|
@:import { Update@(@Model.ClassName)Input } from '/@@/api-services/models';
|
||||||
|
} else {
|
||||||
|
@:import { add@(@Model.ClassName), update@(@Model.ClassName), detail@(@Model.ClassName) } from "/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)";
|
||||||
|
|
||||||
|
if(@Model.TableField.Any(x=>x.EffectType == "Upload")){
|
||||||
|
@:import { Plus } from "@@element-plus/icons-vue";
|
||||||
|
@:import { UploadRequestOptions } from "element-plus";
|
||||||
|
@:import {@string.Join(",",Model.TableField.Where(x=>x.EffectType == "Upload").Select(x=>"upload"+x.PropertyName).ToList())} from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
||||||
@:import { getConstType } from "/@@/utils/constHelper";
|
@:import { getConstType } from "/@@/utils/constHelper";
|
||||||
@ -244,8 +252,11 @@
|
|||||||
// 改用detail获取最新数据来编辑
|
// 改用detail获取最新数据来编辑
|
||||||
let rowData = JSON.parse(JSON.stringify(row));
|
let rowData = JSON.parse(JSON.stringify(row));
|
||||||
if (rowData.id)
|
if (rowData.id)
|
||||||
//state.ruleForm = (await detail@(@Model.ClassName)(rowData.id)).data.result;
|
@if (@Model.IsApiService) {
|
||||||
state.ruleForm = (await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DetailGet(rowData.id)).data.result;
|
@:state.ruleForm = (await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DetailGet(rowData.id)).data.result;
|
||||||
|
} else {
|
||||||
|
@:state.ruleForm = (await detail@(@Model.ClassName)(rowData.id)).data.result;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
state.ruleForm = rowData;
|
state.ruleForm = rowData;
|
||||||
state.isShowDialog = true;
|
state.isShowDialog = true;
|
||||||
@ -268,11 +279,17 @@
|
|||||||
if (isValid) {
|
if (isValid) {
|
||||||
let values = state.ruleForm;
|
let values = state.ruleForm;
|
||||||
if (state.ruleForm.@(@pkFieldName) == undefined || state.ruleForm.@(@pkFieldName) == null || state.ruleForm.@(@pkFieldName) == "" || state.ruleForm.@(@pkFieldName) == 0) {
|
if (state.ruleForm.@(@pkFieldName) == undefined || state.ruleForm.@(@pkFieldName) == null || state.ruleForm.@(@pkFieldName) == "" || state.ruleForm.@(@pkFieldName) == 0) {
|
||||||
//await add@(@Model.ClassName)(values);
|
@if (@Model.IsApiService) {
|
||||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)AddPost(state.ruleForm);
|
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)AddPost(state.ruleForm);
|
||||||
|
} else {
|
||||||
|
@:await add@(@Model.ClassName)(values);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//await update@(@Model.ClassName)(values);
|
@if (@Model.IsApiService) {
|
||||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)UpdatePost(state.ruleForm);
|
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)UpdatePost(state.ruleForm);
|
||||||
|
} else {
|
||||||
|
@:await update@(@Model.ClassName)(values);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
closeDialog();
|
closeDialog();
|
||||||
} else {
|
} else {
|
||||||
@ -324,7 +341,11 @@
|
|||||||
if(column.WhetherAddUpdate=="N") continue;
|
if(column.WhetherAddUpdate=="N") continue;
|
||||||
if(@column.EffectType == "Upload"){
|
if(@column.EffectType == "Upload"){
|
||||||
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
|
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
|
||||||
|
@if (@Model.IsApiService) {
|
||||||
@:let list = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options);
|
@:let list = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options);
|
||||||
|
} else {
|
||||||
|
@:let list = await upload@(@column.PropertyName)(options);
|
||||||
|
}
|
||||||
@:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url;
|
@:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url;
|
||||||
@:};
|
@:};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,25 +19,30 @@
|
|||||||
}
|
}
|
||||||
<template>
|
<template>
|
||||||
<div class="@(@Model.LowerClassName)-container" v-loading="options.loading">
|
<div class="@(@Model.LowerClassName)-container" v-loading="options.loading">
|
||||||
<el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 0px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
<el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 10px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||||
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
|
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%" @@submit.prevent="handleQuery" >
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
@if(Model.QueryWhetherList.Count > 0){
|
@if(Model.QueryWhetherList.Count > 0){
|
||||||
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
|
<el-form-item label="关键字" prop="searchKey">
|
||||||
|
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
foreach (var column in Model.QueryWhetherList) {
|
foreach (var column in Model.QueryWhetherList) {
|
||||||
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
|
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||||
<el-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
} else if(@column.EffectType == "InputNumber") {
|
} else if(@column.EffectType == "InputNumber") {
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment">
|
<el-form-item label="@column.ColumnComment">
|
||||||
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" />
|
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
} else if(@column.EffectType == "fk") {
|
} else if(@column.EffectType == "fk") {
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment">
|
<el-form-item label="@column.ColumnComment">
|
||||||
<el-select filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)" clearable>
|
<el-select filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)" clearable>
|
||||||
<el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" />
|
<el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" />
|
||||||
@ -45,23 +50,23 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
} else if(@column.EffectType == "Select") {
|
} else if(@column.EffectType == "Select") {
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||||
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" >
|
||||||
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.code" :label="`${item.name} [${item.code}] ${item.value}`" />
|
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.code" :label="`${item.name} [${item.code}] ${item.value}`" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
} else if(@column.EffectType == "EnumSelector") {
|
} else if(@column.EffectType == "EnumSelector") {
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||||
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" >
|
||||||
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`${item.name} [${item.code}] ${item.value}`" />
|
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`${item.name} [${item.code}] ${item.value}`" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
} else if(@column.EffectType == "DatePicker") {
|
} else if(@column.EffectType == "DatePicker") {
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||||
@if(@column.QueryType == "~"){
|
@if(@column.QueryType == "~"){
|
||||||
@:<el-date-picker type="daterange" v-model="state.queryParams.@(@column.LowerPropertyName)Range" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" />
|
@:<el-date-picker type="daterange" v-model="state.queryParams.@(@column.LowerPropertyName)Range" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" />
|
||||||
@ -81,15 +86,17 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @@click="handleQuery(true)" v-auth="'@(@Model.LowerClassName):page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @@click="handleQuery" v-auth="'@(@Model.LowerClassName):page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @@click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @@click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
|
<el-button icon="ele-ZoomIn" @@click="changeAdvanceQueryUI" v-if="!state.showAdvanceQueryUI" style="margin-left: 5px"> 高级查询 </el-button>
|
||||||
|
<el-button icon="ele-ZoomOut" @@click="changeAdvanceQueryUI" v-if="state.showAdvanceQueryUI" style="margin-left: 5px"> 隐藏 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @@sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @@click="handleAdd" v-auth="'@(@Model.LowerClassName):add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @@click="handleAdd" v-auth="'@(@Model.LowerClassName):add'"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -149,7 +156,7 @@
|
|||||||
@:</template>
|
@:</template>
|
||||||
} else if(@column.EffectType == "DatePicker") {
|
} else if(@column.EffectType == "DatePicker") {
|
||||||
@:<template #row_@(@column.LowerPropertyName)="{ row }">
|
@:<template #row_@(@column.LowerPropertyName)="{ row }">
|
||||||
@:<span>{{ formatDate(new Date(row.@(@column.LowerPropertyName)), 'YYYY-mm-dd') }}</span>
|
@:<span>{{ formatDate(new Date(row.@(@column.LowerPropertyName)), 'YYYY-mm-dd HH:MM:SS') }}</span>
|
||||||
@:</template>
|
@:</template>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,15 +177,6 @@
|
|||||||
<el-button icon="ele-Delete" size="small" text type="danger" @@click="handleDelete(row)" v-auth="'@(@Model.LowerClassName):delete'" :disabled="row.status === 1" />
|
<el-button icon="ele-Delete" size="small" text type="danger" @@click="handleDelete(row)" v-auth="'@(@Model.LowerClassName):delete'" :disabled="row.status === 1" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -191,8 +189,10 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from "element-plus";
|
import { ElMessageBox, ElMessage } from "element-plus";
|
||||||
import { auth } from '/@@/utils/authFunction';
|
import { auth } from '/@@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
|
||||||
import { useVxeTable } from '/@@/hooks/vxeTableOptionsHook';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
|
import { useVxeTable } from '/@@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@@/utils/storage';
|
||||||
|
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
||||||
@:import { codeToName, getConstType } from "/@@/utils/constHelper";
|
@:import { codeToName, getConstType } from "/@@/utils/constHelper";
|
||||||
@ -218,14 +218,24 @@ import PrintDialog from '/@@/views/system/print/component/hiprint/preview.vue';
|
|||||||
import EditDialog from '/@@/views/@(@Model.PagePath)/@(@Model.LowerClassName)/component/editDialog.vue';
|
import EditDialog from '/@@/views/@(@Model.PagePath)/@(@Model.LowerClassName)/component/editDialog.vue';
|
||||||
import ModifyRecord from '/@@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
|
@if (@Model.IsApiService) {
|
||||||
// 接口函数
|
// 接口函数
|
||||||
import { getAPI } from '/@@/utils/axios-utils';
|
@:import { getAPI } from '/@@/utils/axios-utils';
|
||||||
|
|
||||||
// 接口
|
// 接口
|
||||||
import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
@:import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
||||||
|
|
||||||
// 模型
|
// 模型
|
||||||
import { @(@Model.ClassName), @(@Model.ClassName)Input, @(@Model.ClassName)Output } from '/@@/api-services/models';
|
@:import { @(@Model.ClassName), @(@Model.ClassName)Input, @(@Model.ClassName)Output } from '/@@/api-services/models';
|
||||||
|
|
||||||
|
} else {
|
||||||
|
@:import { page@(@Model.ClassName), delete@(@Model.ClassName) } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
|
||||||
|
foreach (var column in Model.QueryWhetherList){
|
||||||
|
if(@column.EffectType == "fk"){
|
||||||
|
@:import { get@(@column.FkEntityName)@(@column.PropertyName)Dropdown } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 子窗口对象
|
// 子窗口对象
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
@ -234,108 +244,112 @@ const editDialogRef = ref<InstanceType<typeof EditDialog>>();
|
|||||||
|
|
||||||
// 变量
|
// 变量
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
showAdvanceQueryUI: false,
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
searchKey: undefined,
|
||||||
@if(Model.QueryWhetherList.Count > 0) {
|
@if(Model.QueryWhetherList.Count > 0) {
|
||||||
@foreach (var column in Model.QueryWhetherList) {
|
@foreach (var column in Model.QueryWhetherList) {
|
||||||
@:@(@column.LowerPropertyName): undefined,
|
@:@(@column.LowerPropertyName): undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:@(@Model.LowerClassName)';
|
||||||
|
|
||||||
|
// 改变高级查询的控件显示状态
|
||||||
|
const changeAdvanceQueryUI = () => {
|
||||||
|
state.showAdvanceQueryUI = !state.showAdvanceQueryUI;
|
||||||
|
};
|
||||||
|
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<@(@Model.ClassName)>({
|
const options = useVxeTable<@(@Model.ClassName)>(
|
||||||
id: '@(@Model.ClassName)',
|
{
|
||||||
name: '@(@Model.BusName)',
|
id: '@(@Model.ClassName)',
|
||||||
columns: [
|
name: '@(@Model.BusName)',
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
columns: [
|
||||||
@foreach (var column in Model.TableField) {
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
var whethersortable =column.WhetherSortable == "Y" ? "sortable: true" : "sortable: false";
|
@foreach (var column in Model.TableField) {
|
||||||
if(@column.WhetherTable == "Y") {
|
var whethersortable =column.WhetherSortable == "Y" ? "sortable: true" : "sortable: false";
|
||||||
if(@column.EffectType == "Upload" || @column.EffectType == "fk" || @column.EffectType == "ApiTreeSelect" || @column.EffectType == "Switch" || @column.EffectType == "ConstSelector") {
|
if(@column.WhetherTable == "Y") {
|
||||||
if(@column.EffectType == "Upload") {
|
if(@column.EffectType == "Upload" || @column.EffectType == "fk" || @column.EffectType == "ApiTreeSelect" || @column.EffectType == "Switch" || @column.EffectType == "ConstSelector") {
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
if(@column.EffectType == "Upload") {
|
||||||
} else if(@column.EffectType == "fk") {
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
} else if(@column.EffectType == "fk") {
|
||||||
} else if(@column.EffectType == "ApiTreeSelect") {
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
} else if(@column.EffectType == "ApiTreeSelect") {
|
||||||
} else if(@column.EffectType == "Switch") {
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
} else if(@column.EffectType == "Switch") {
|
||||||
} else if(@column.EffectType == "ConstSelector") {
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
} else if(@column.EffectType == "ConstSelector") {
|
||||||
}
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||||
} else if(@column.EffectType == "Select") {
|
}
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
} else if(@column.EffectType == "Select") {
|
||||||
} else if(@column.EffectType == "EnumSelector") {
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
} else if(@column.EffectType == "EnumSelector") {
|
||||||
} else if(@column.EffectType == "DatePicker") {
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
} else if(@column.EffectType == "DatePicker") {
|
||||||
} else {
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' }, @whethersortable },
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', @whethersortable},
|
} else {
|
||||||
}
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', @whethersortable},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
}
|
||||||
{ title: '操作', fixed: 'right', width: 180, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 180, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('@(@Model.LowerClassName):export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
// 行设置
|
||||||
|
rowConfig: { height: 80 },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as @(@Model.ClassName)Input;
|
||||||
if (reset) state.tableParams.page = 1;
|
@if (@Model.IsApiService) {
|
||||||
var res = await fetchData(null);
|
@:return getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)PagePost(params);
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
} else {
|
||||||
state.tableParams.total = res.data.result?.total;
|
@:return page@(@Model.ClassName)(params);
|
||||||
options.loading = false;
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取数据
|
// 查询操作
|
||||||
const fetchData = async (tableParams: any) => {
|
const handleQuery = async (reset = false) => {
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
await xGrid.value?.commitProxy('query');
|
||||||
return getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)PagePost(params);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
|
state.queryParams.searchKey = undefined,
|
||||||
@if(Model.QueryWhetherList.Count > 0) {
|
@if(Model.QueryWhetherList.Count > 0) {
|
||||||
@foreach (var column in Model.QueryWhetherList) {
|
@foreach (var column in Model.QueryWhetherList) {
|
||||||
@:state.queryParams.@(@column.LowerPropertyName) = undefined,
|
@:state.queryParams.@(@column.LowerPropertyName) = undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -354,7 +368,11 @@ const handleEdit = (row: any) => {
|
|||||||
const handlePrint = async (row: any) => {
|
const handlePrint = async (row: any) => {
|
||||||
state.title = '打印@(@Model.BusName)';
|
state.title = '打印@(@Model.BusName)';
|
||||||
@if(@Model.PrintType == "custom"){
|
@if(@Model.PrintType == "custom"){
|
||||||
|
if (@Model.IsApiService) {
|
||||||
@:var res = await getAPI(SysPrintApi).apiSysPrintPrintNameGet('@Model.PrintName');
|
@:var res = await getAPI(SysPrintApi).apiSysPrintPrintNameGet('@Model.PrintName');
|
||||||
|
} else {
|
||||||
|
@:var res = await getPrint@(@Model.ClassName)(row);
|
||||||
|
}
|
||||||
@:var printTemplate = res.data.result as SysPrint;
|
@:var printTemplate = res.data.result as SysPrint;
|
||||||
@:var template = JSON.parse(printTemplate.template);
|
@:var template = JSON.parse(printTemplate.template);
|
||||||
@:var width = template.panels[0].width;
|
@:var width = template.panels[0].width;
|
||||||
@ -375,13 +393,31 @@ const handleDelete = (row: any) => {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DeletePost({ id: row.id });
|
@if (@Model.IsApiService) {
|
||||||
|
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DeletePost({ id: row.id });
|
||||||
|
} else {
|
||||||
|
@:await delete@(@Model.ClassName)(row);
|
||||||
|
}
|
||||||
handleQuery();
|
handleQuery();
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<@(@Model.ClassName)> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
@foreach (var column in Model.QueryWhetherList) {
|
@foreach (var column in Model.QueryWhetherList) {
|
||||||
@if(@column.EffectType == "fk") {
|
@if(@column.EffectType == "fk") {
|
||||||
@:const @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList = ref<any>([]);
|
@:const @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList = ref<any>([]);
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Rezero.Api" Version="1.7.8" />
|
<PackageReference Include="Rezero.Api" Version="1.7.9" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ if exist %apiServicesPath% (
|
|||||||
|
|
||||||
echo ================================ 开始生成 api-services ================================
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%%20Groups/swagger.json -l typescript-axios -o %apiServicesPath%
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/Default/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
@rem 删除不必要的文件和文件夹
|
@rem 删除不必要的文件和文件夹
|
||||||
rd /s /q %apiServicesPath%.swagger-codegen
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
|||||||
@ -14,7 +14,7 @@ fi
|
|||||||
|
|
||||||
echo "================================ 开始生成 api-services ================================"
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/Default/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
rm -rf "${apiServicesPath}".swagger-codegen
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
rm -f "${apiServicesPath}".gitignore
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
|||||||
27
Web/api_build/build_all.bat
Normal file
27
Web/api_build/build_all.bat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@echo off
|
||||||
|
CHCP 65001
|
||||||
|
|
||||||
|
set dir=%~dp0
|
||||||
|
|
||||||
|
set apiServicesPath=%dir%..\src\api-services\
|
||||||
|
|
||||||
|
if exist %apiServicesPath% (
|
||||||
|
echo ================================ 删除目录 api-services ================================
|
||||||
|
rd /s /q %apiServicesPath%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
|
@rem 删除不必要的文件和文件夹
|
||||||
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
del /q %apiServicesPath%.gitignore
|
||||||
|
del /q %apiServicesPath%.npmignore
|
||||||
|
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||||
|
del /q %apiServicesPath%git_push.sh
|
||||||
|
del /q %apiServicesPath%package.json
|
||||||
|
del /q %apiServicesPath%README.md
|
||||||
|
del /q %apiServicesPath%tsconfig.json
|
||||||
|
|
||||||
|
echo ================================ 生成结束 ================================
|
||||||
28
Web/api_build/build_all.sh
Normal file
28
Web/api_build/build_all.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
currPath=$(pwd)
|
||||||
|
parentPath=$(dirname "$currPath")
|
||||||
|
apiServicesPath=${parentPath}/src/api-services/
|
||||||
|
|
||||||
|
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||||
|
|
||||||
|
# 判断目录是否存在
|
||||||
|
if test -d "$apiServicesPath"; then
|
||||||
|
echo "================================ 删除目录 api-services ================================"
|
||||||
|
rm -rf "${apiServicesPath}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
rm -f "${apiServicesPath}".npmignore
|
||||||
|
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||||
|
rm -f "${apiServicesPath}"git_push.sh
|
||||||
|
rm -f "${apiServicesPath}"package.json
|
||||||
|
rm -f "${apiServicesPath}"README.md
|
||||||
|
rm -f "${apiServicesPath}"tsconfig.json
|
||||||
|
|
||||||
|
echo "================================ 生成结束 ================================"
|
||||||
27
Web/api_build/build_approvalFlow.bat
Normal file
27
Web/api_build/build_approvalFlow.bat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@echo off
|
||||||
|
CHCP 65001
|
||||||
|
|
||||||
|
set dir=%~dp0
|
||||||
|
|
||||||
|
set apiServicesPath=%dir%..\src\api-services\_approvalFlow
|
||||||
|
|
||||||
|
if exist %apiServicesPath% (
|
||||||
|
echo ================================ 删除目录 api-services ================================
|
||||||
|
rd /s /q %apiServicesPath%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/ApprovalFlow/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
|
@rem 删除不必要的文件和文件夹
|
||||||
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
del /q %apiServicesPath%.gitignore
|
||||||
|
del /q %apiServicesPath%.npmignore
|
||||||
|
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||||
|
del /q %apiServicesPath%git_push.sh
|
||||||
|
del /q %apiServicesPath%package.json
|
||||||
|
del /q %apiServicesPath%README.md
|
||||||
|
del /q %apiServicesPath%tsconfig.json
|
||||||
|
|
||||||
|
echo ================================ 生成结束 ================================
|
||||||
28
Web/api_build/build_approvalFlow.sh
Normal file
28
Web/api_build/build_approvalFlow.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
currPath=$(pwd)
|
||||||
|
parentPath=$(dirname "$currPath")
|
||||||
|
apiServicesPath=${parentPath}/src/api-services/_approvalFlow
|
||||||
|
|
||||||
|
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||||
|
|
||||||
|
# 判断目录是否存在
|
||||||
|
if test -d "$apiServicesPath"; then
|
||||||
|
echo "================================ 删除目录 api-services ================================"
|
||||||
|
rm -rf "${apiServicesPath}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/ApprovalFlow/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
rm -f "${apiServicesPath}".npmignore
|
||||||
|
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||||
|
rm -f "${apiServicesPath}"git_push.sh
|
||||||
|
rm -f "${apiServicesPath}"package.json
|
||||||
|
rm -f "${apiServicesPath}"README.md
|
||||||
|
rm -f "${apiServicesPath}"tsconfig.json
|
||||||
|
|
||||||
|
echo "================================ 生成结束 ================================"
|
||||||
27
Web/api_build/build_dingTalk.bat
Normal file
27
Web/api_build/build_dingTalk.bat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@echo off
|
||||||
|
CHCP 65001
|
||||||
|
|
||||||
|
set dir=%~dp0
|
||||||
|
|
||||||
|
set apiServicesPath=%dir%..\src\api-services\_goView
|
||||||
|
|
||||||
|
if exist %apiServicesPath% (
|
||||||
|
echo ================================ 删除目录 api-services ================================
|
||||||
|
rd /s /q %apiServicesPath%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/GoView/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
|
@rem 删除不必要的文件和文件夹
|
||||||
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
del /q %apiServicesPath%.gitignore
|
||||||
|
del /q %apiServicesPath%.npmignore
|
||||||
|
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||||
|
del /q %apiServicesPath%git_push.sh
|
||||||
|
del /q %apiServicesPath%package.json
|
||||||
|
del /q %apiServicesPath%README.md
|
||||||
|
del /q %apiServicesPath%tsconfig.json
|
||||||
|
|
||||||
|
echo ================================ 生成结束 ================================
|
||||||
28
Web/api_build/build_dingTalk.sh
Normal file
28
Web/api_build/build_dingTalk.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
currPath=$(pwd)
|
||||||
|
parentPath=$(dirname "$currPath")
|
||||||
|
apiServicesPath=${parentPath}/src/api-services/_goView
|
||||||
|
|
||||||
|
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||||
|
|
||||||
|
# 判断目录是否存在
|
||||||
|
if test -d "$apiServicesPath"; then
|
||||||
|
echo "================================ 删除目录 api-services ================================"
|
||||||
|
rm -rf "${apiServicesPath}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
rm -f "${apiServicesPath}".npmignore
|
||||||
|
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||||
|
rm -f "${apiServicesPath}"git_push.sh
|
||||||
|
rm -f "${apiServicesPath}"package.json
|
||||||
|
rm -f "${apiServicesPath}"README.md
|
||||||
|
rm -f "${apiServicesPath}"tsconfig.json
|
||||||
|
|
||||||
|
echo "================================ 生成结束 ================================"
|
||||||
27
Web/api_build/build_goView.bat
Normal file
27
Web/api_build/build_goView.bat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@echo off
|
||||||
|
CHCP 65001
|
||||||
|
|
||||||
|
set dir=%~dp0
|
||||||
|
|
||||||
|
set apiServicesPath=%dir%..\src\api-services\_goView
|
||||||
|
|
||||||
|
if exist %apiServicesPath% (
|
||||||
|
echo ================================ 删除目录 api-services ================================
|
||||||
|
rd /s /q %apiServicesPath%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/GoView/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
|
@rem 删除不必要的文件和文件夹
|
||||||
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
del /q %apiServicesPath%.gitignore
|
||||||
|
del /q %apiServicesPath%.npmignore
|
||||||
|
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||||
|
del /q %apiServicesPath%git_push.sh
|
||||||
|
del /q %apiServicesPath%package.json
|
||||||
|
del /q %apiServicesPath%README.md
|
||||||
|
del /q %apiServicesPath%tsconfig.json
|
||||||
|
|
||||||
|
echo ================================ 生成结束 ================================
|
||||||
28
Web/api_build/build_goView.sh
Normal file
28
Web/api_build/build_goView.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
currPath=$(pwd)
|
||||||
|
parentPath=$(dirname "$currPath")
|
||||||
|
apiServicesPath=${parentPath}/src/api-services/_dingTalk
|
||||||
|
|
||||||
|
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||||
|
|
||||||
|
# 判断目录是否存在
|
||||||
|
if test -d "$apiServicesPath"; then
|
||||||
|
echo "================================ 删除目录 api-services ================================"
|
||||||
|
rm -rf "${apiServicesPath}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/DingTalk/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
rm -f "${apiServicesPath}".npmignore
|
||||||
|
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||||
|
rm -f "${apiServicesPath}"git_push.sh
|
||||||
|
rm -f "${apiServicesPath}"package.json
|
||||||
|
rm -f "${apiServicesPath}"README.md
|
||||||
|
rm -f "${apiServicesPath}"tsconfig.json
|
||||||
|
|
||||||
|
echo "================================ 生成结束 ================================"
|
||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "admin.net.pro",
|
"name": "admin.net.pro",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2.4.33",
|
"version": "2.4.33",
|
||||||
"lastBuildTime": "2024.07.09",
|
"lastBuildTime": "2024.07.12",
|
||||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||||
"author": "zuohuaijun",
|
"author": "zuohuaijun",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -16,7 +16,7 @@
|
|||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"@logicflow/core": "^1.2.27",
|
"@logicflow/core": "^1.2.27",
|
||||||
"@logicflow/extension": "^1.2.27",
|
"@logicflow/extension": "^1.2.27",
|
||||||
"@microsoft/signalr": "^8.0.0",
|
"@microsoft/signalr": "^8.0.7",
|
||||||
"@vue-office/docx": "^1.6.2",
|
"@vue-office/docx": "^1.6.2",
|
||||||
"@vue-office/excel": "^1.7.8",
|
"@vue-office/excel": "^1.7.8",
|
||||||
"@vue-office/pdf": "^2.0.2",
|
"@vue-office/pdf": "^2.0.2",
|
||||||
@ -49,10 +49,10 @@
|
|||||||
"print-js": "^1.6.0",
|
"print-js": "^1.6.0",
|
||||||
"push.js": "^1.0.12",
|
"push.js": "^1.0.12",
|
||||||
"qrcodejs2-fixes": "^0.0.2",
|
"qrcodejs2-fixes": "^0.0.2",
|
||||||
"qs": "^6.12.2",
|
"qs": "^6.12.3",
|
||||||
"relation-graph": "^2.2.2",
|
"relation-graph": "^2.2.2",
|
||||||
"screenfull": "^6.0.2",
|
"screenfull": "^6.0.2",
|
||||||
"sm-crypto-v2": "^1.9.0",
|
"sm-crypto-v2": "^1.9.1",
|
||||||
"sortablejs": "^1.15.2",
|
"sortablejs": "^1.15.2",
|
||||||
"splitpanes": "^3.1.5",
|
"splitpanes": "^3.1.5",
|
||||||
"vcrontab-3": "^3.3.22",
|
"vcrontab-3": "^3.3.22",
|
||||||
@ -68,8 +68,8 @@
|
|||||||
"vue-signature-pad": "^3.0.2",
|
"vue-signature-pad": "^3.0.2",
|
||||||
"vue3-tree-org": "^4.2.2",
|
"vue3-tree-org": "^4.2.2",
|
||||||
"vuedraggable": "4.0.3",
|
"vuedraggable": "4.0.3",
|
||||||
"vxe-pc-ui": "^4.0.51",
|
"vxe-pc-ui": "^4.0.61",
|
||||||
"vxe-table": "^4.7.45",
|
"vxe-table": "^4.7.48",
|
||||||
"vxe-table-plugin-element": "^4.0.4",
|
"vxe-table-plugin-element": "^4.0.4",
|
||||||
"vxe-table-plugin-export-xlsx": "^4.0.5",
|
"vxe-table-plugin-export-xlsx": "^4.0.5",
|
||||||
"xe-utils": "^3.5.28",
|
"xe-utils": "^3.5.28",
|
||||||
@ -93,8 +93,8 @@
|
|||||||
"less": "^4.2.0",
|
"less": "^4.2.0",
|
||||||
"prettier": "^3.3.2",
|
"prettier": "^3.3.2",
|
||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^5.12.0",
|
||||||
"sass": "^1.77.6",
|
"sass": "^1.77.7",
|
||||||
"terser": "^5.31.1",
|
"terser": "^5.31.2",
|
||||||
"typescript": "^5.5.3",
|
"typescript": "^5.5.3",
|
||||||
"vite": "^5.3.3",
|
"vite": "^5.3.3",
|
||||||
"vite-plugin-cdn-import": "^1.0.1",
|
"vite-plugin-cdn-import": "^1.0.1",
|
||||||
|
|||||||
@ -26,8 +26,8 @@ import { AdminResultListTableOutput } from '../models';
|
|||||||
import { AdminResultObject } from '../models';
|
import { AdminResultObject } from '../models';
|
||||||
import { AdminResultSqlSugarPagedListSysCodeGen } from '../models';
|
import { AdminResultSqlSugarPagedListSysCodeGen } from '../models';
|
||||||
import { AdminResultSysCodeGen } from '../models';
|
import { AdminResultSysCodeGen } from '../models';
|
||||||
import { CodeGenInput } from '../models';
|
|
||||||
import { DeleteCodeGenInput } from '../models';
|
import { DeleteCodeGenInput } from '../models';
|
||||||
|
import { PageCodeGenInput } from '../models';
|
||||||
import { SysCodeGen } from '../models';
|
import { SysCodeGen } from '../models';
|
||||||
import { UpdateCodeGenInput } from '../models';
|
import { UpdateCodeGenInput } from '../models';
|
||||||
/**
|
/**
|
||||||
@ -328,11 +328,11 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取代码生成分页列表 🔖
|
* @summary 获取代码生成分页列表 🔖
|
||||||
* @param {CodeGenInput} [body]
|
* @param {PageCodeGenInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
apiSysCodeGenPagePost: async (body?: CodeGenInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
apiSysCodeGenPagePost: async (body?: PageCodeGenInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/api/sysCodeGen/page`;
|
const localVarPath = `/api/sysCodeGen/page`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||||
@ -661,11 +661,11 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取代码生成分页列表 🔖
|
* @summary 获取代码生成分页列表 🔖
|
||||||
* @param {CodeGenInput} [body]
|
* @param {PageCodeGenInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysCodeGenPagePost(body?: CodeGenInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>>> {
|
async apiSysCodeGenPagePost(body?: PageCodeGenInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>>> {
|
||||||
const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenPagePost(body, options);
|
const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenPagePost(body, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
@ -799,11 +799,11 @@ export const SysCodeGenApiFactory = function (configuration?: Configuration, bas
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取代码生成分页列表 🔖
|
* @summary 获取代码生成分页列表 🔖
|
||||||
* @param {CodeGenInput} [body]
|
* @param {PageCodeGenInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysCodeGenPagePost(body?: CodeGenInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>> {
|
async apiSysCodeGenPagePost(body?: PageCodeGenInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>> {
|
||||||
return SysCodeGenApiFp(configuration).apiSysCodeGenPagePost(body, options).then((request) => request(axios, basePath));
|
return SysCodeGenApiFp(configuration).apiSysCodeGenPagePost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -924,12 +924,12 @@ export class SysCodeGenApi extends BaseAPI {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取代码生成分页列表 🔖
|
* @summary 获取代码生成分页列表 🔖
|
||||||
* @param {CodeGenInput} [body]
|
* @param {PageCodeGenInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysCodeGenApi
|
* @memberof SysCodeGenApi
|
||||||
*/
|
*/
|
||||||
public async apiSysCodeGenPagePost(body?: CodeGenInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>> {
|
public async apiSysCodeGenPagePost(body?: PageCodeGenInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysCodeGen>> {
|
||||||
return SysCodeGenApiFp(this.configuration).apiSysCodeGenPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysCodeGenApiFp(this.configuration).apiSysCodeGenPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -23,8 +23,8 @@ import { AdminResultListSysLdap } from '../models';
|
|||||||
import { AdminResultSqlSugarPagedListSysLdap } from '../models';
|
import { AdminResultSqlSugarPagedListSysLdap } from '../models';
|
||||||
import { AdminResultSysLdap } from '../models';
|
import { AdminResultSysLdap } from '../models';
|
||||||
import { DeleteSysLdapInput } from '../models';
|
import { DeleteSysLdapInput } from '../models';
|
||||||
|
import { PageSysLdapInput } from '../models';
|
||||||
import { SyncSysLdapInput } from '../models';
|
import { SyncSysLdapInput } from '../models';
|
||||||
import { SysLdapInput } from '../models';
|
|
||||||
import { UpdateSysLdapInput } from '../models';
|
import { UpdateSysLdapInput } from '../models';
|
||||||
/**
|
/**
|
||||||
* SysLdapApi - axios parameter creator
|
* SysLdapApi - axios parameter creator
|
||||||
@ -226,11 +226,11 @@ export const SysLdapApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取系统域登录配置分页列表 🔖
|
* @summary 获取系统域登录配置分页列表 🔖
|
||||||
* @param {SysLdapInput} [body]
|
* @param {PageSysLdapInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
apiSysLdapPagePost: async (body?: SysLdapInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
apiSysLdapPagePost: async (body?: PageSysLdapInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/api/sysLdap/page`;
|
const localVarPath = `/api/sysLdap/page`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||||
@ -482,11 +482,11 @@ export const SysLdapApiFp = function(configuration?: Configuration) {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取系统域登录配置分页列表 🔖
|
* @summary 获取系统域登录配置分页列表 🔖
|
||||||
* @param {SysLdapInput} [body]
|
* @param {PageSysLdapInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysLdapPagePost(body?: SysLdapInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>>> {
|
async apiSysLdapPagePost(body?: PageSysLdapInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>>> {
|
||||||
const localVarAxiosArgs = await SysLdapApiAxiosParamCreator(configuration).apiSysLdapPagePost(body, options);
|
const localVarAxiosArgs = await SysLdapApiAxiosParamCreator(configuration).apiSysLdapPagePost(body, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
@ -586,11 +586,11 @@ export const SysLdapApiFactory = function (configuration?: Configuration, basePa
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取系统域登录配置分页列表 🔖
|
* @summary 获取系统域登录配置分页列表 🔖
|
||||||
* @param {SysLdapInput} [body]
|
* @param {PageSysLdapInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysLdapPagePost(body?: SysLdapInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>> {
|
async apiSysLdapPagePost(body?: PageSysLdapInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>> {
|
||||||
return SysLdapApiFp(configuration).apiSysLdapPagePost(body, options).then((request) => request(axios, basePath));
|
return SysLdapApiFp(configuration).apiSysLdapPagePost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -679,12 +679,12 @@ export class SysLdapApi extends BaseAPI {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取系统域登录配置分页列表 🔖
|
* @summary 获取系统域登录配置分页列表 🔖
|
||||||
* @param {SysLdapInput} [body]
|
* @param {PageSysLdapInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysLdapApi
|
* @memberof SysLdapApi
|
||||||
*/
|
*/
|
||||||
public async apiSysLdapPagePost(body?: SysLdapInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>> {
|
public async apiSysLdapPagePost(body?: PageSysLdapInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysLdap>> {
|
||||||
return SysLdapApiFp(this.configuration).apiSysLdapPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysLdapApiFp(this.configuration).apiSysLdapPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import { AdminResultSqlSugarPagedListOpenAccessOutput } from '../models';
|
|||||||
import { AdminResultString } from '../models';
|
import { AdminResultString } from '../models';
|
||||||
import { DeleteOpenAccessInput } from '../models';
|
import { DeleteOpenAccessInput } from '../models';
|
||||||
import { GenerateSignatureInput } from '../models';
|
import { GenerateSignatureInput } from '../models';
|
||||||
import { OpenAccessInput } from '../models';
|
import { PageOpenAccessInput } from '../models';
|
||||||
import { UpdateOpenAccessInput } from '../models';
|
import { UpdateOpenAccessInput } from '../models';
|
||||||
/**
|
/**
|
||||||
* SysOpenAccessApi - axios parameter creator
|
* SysOpenAccessApi - axios parameter creator
|
||||||
@ -177,11 +177,11 @@ export const SysOpenAccessApiAxiosParamCreator = function (configuration?: Confi
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取开放接口身份分页列表 🔖
|
* @summary 获取开放接口身份分页列表 🔖
|
||||||
* @param {OpenAccessInput} [body]
|
* @param {PageOpenAccessInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
apiSysOpenAccessPagePost: async (body?: OpenAccessInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
apiSysOpenAccessPagePost: async (body?: PageOpenAccessInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/api/sysOpenAccess/page`;
|
const localVarPath = `/api/sysOpenAccess/page`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||||
@ -367,11 +367,11 @@ export const SysOpenAccessApiFp = function(configuration?: Configuration) {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取开放接口身份分页列表 🔖
|
* @summary 获取开放接口身份分页列表 🔖
|
||||||
* @param {OpenAccessInput} [body]
|
* @param {PageOpenAccessInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysOpenAccessPagePost(body?: OpenAccessInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>>> {
|
async apiSysOpenAccessPagePost(body?: PageOpenAccessInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>>> {
|
||||||
const localVarAxiosArgs = await SysOpenAccessApiAxiosParamCreator(configuration).apiSysOpenAccessPagePost(body, options);
|
const localVarAxiosArgs = await SysOpenAccessApiAxiosParamCreator(configuration).apiSysOpenAccessPagePost(body, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
@ -447,11 +447,11 @@ export const SysOpenAccessApiFactory = function (configuration?: Configuration,
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取开放接口身份分页列表 🔖
|
* @summary 获取开放接口身份分页列表 🔖
|
||||||
* @param {OpenAccessInput} [body]
|
* @param {PageOpenAccessInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysOpenAccessPagePost(body?: OpenAccessInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>> {
|
async apiSysOpenAccessPagePost(body?: PageOpenAccessInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>> {
|
||||||
return SysOpenAccessApiFp(configuration).apiSysOpenAccessPagePost(body, options).then((request) => request(axios, basePath));
|
return SysOpenAccessApiFp(configuration).apiSysOpenAccessPagePost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -519,12 +519,12 @@ export class SysOpenAccessApi extends BaseAPI {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取开放接口身份分页列表 🔖
|
* @summary 获取开放接口身份分页列表 🔖
|
||||||
* @param {OpenAccessInput} [body]
|
* @param {PageOpenAccessInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysOpenAccessApi
|
* @memberof SysOpenAccessApi
|
||||||
*/
|
*/
|
||||||
public async apiSysOpenAccessPagePost(body?: OpenAccessInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>> {
|
public async apiSysOpenAccessPagePost(body?: PageOpenAccessInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListOpenAccessOutput>> {
|
||||||
return SysOpenAccessApiFp(this.configuration).apiSysOpenAccessPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysOpenAccessApiFp(this.configuration).apiSysOpenAccessPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -17,9 +17,14 @@ import { Configuration } from '../configuration';
|
|||||||
// Some imports not used depending on template conditions
|
// Some imports not used depending on template conditions
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
||||||
|
import { AdminResultCreatePayTransactionOutput } from '../models';
|
||||||
|
import { AdminResultGetRefundDomesticRefundByOutRefundNumberResponse } from '../models';
|
||||||
import { AdminResultObject } from '../models';
|
import { AdminResultObject } from '../models';
|
||||||
|
import { AdminResultSqlSugarPagedListSysWechatPay } from '../models';
|
||||||
import { AdminResultSysWechatPay } from '../models';
|
import { AdminResultSysWechatPay } from '../models';
|
||||||
import { AdminResultWechatPayOutput } from '../models';
|
import { AdminResultWechatPayOutput } from '../models';
|
||||||
|
import { PageSysWechatPayInput } from '../models';
|
||||||
|
import { RefundRequestInput } from '../models';
|
||||||
import { WechatPayParaInput } from '../models';
|
import { WechatPayParaInput } from '../models';
|
||||||
import { WechatPayTransactionInput } from '../models';
|
import { WechatPayTransactionInput } from '../models';
|
||||||
/**
|
/**
|
||||||
@ -76,6 +81,54 @@ export const SysWechatPayApiAxiosParamCreator = function (configuration?: Config
|
|||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 获取支付记录列表(分页)
|
||||||
|
* @param {PageSysWechatPayInput} [body] PageSysWechatPayInput
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
apiSysWechatPayPagePost: async (body?: PageSysWechatPayInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/api/sysWechatPay/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 微信支付成功回调(商户直连) 🔖
|
* @summary 微信支付成功回调(商户直连) 🔖
|
||||||
@ -259,6 +312,104 @@ export const SysWechatPayApiAxiosParamCreator = function (configuration?: Config
|
|||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 微信支付订单号查询(校正) https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}
|
||||||
|
* @param {string} transactionId
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
apiSysWechatPayPayTransactionByIdTransactionIdGet: async (transactionId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'transactionId' is not null or undefined
|
||||||
|
if (transactionId === null || transactionId === undefined) {
|
||||||
|
throw new RequiredError('transactionId','Required parameter transactionId was null or undefined when calling apiSysWechatPayPayTransactionByIdTransactionIdGet.');
|
||||||
|
}
|
||||||
|
const localVarPath = `/api/sysWechatPay/payTransactionById/{transactionId}`
|
||||||
|
.replace(`{${"transactionId"}}`, encodeURIComponent(String(transactionId)));
|
||||||
|
// 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 商户订单号查询(校正) https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}
|
||||||
|
* @param {string} outTradeNumber
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet: async (outTradeNumber: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'outTradeNumber' is not null or undefined
|
||||||
|
if (outTradeNumber === null || outTradeNumber === undefined) {
|
||||||
|
throw new RequiredError('outTradeNumber','Required parameter outTradeNumber was null or undefined when calling apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet.');
|
||||||
|
}
|
||||||
|
const localVarPath = `/api/sysWechatPay/payTransactionByOutTradeNumber/{outTradeNumber}`
|
||||||
|
.replace(`{${"outTradeNumber"}}`, encodeURIComponent(String(outTradeNumber)));
|
||||||
|
// 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 微信支付统一下单获取Id(商户直连) 🔖
|
* @summary 微信支付统一下单获取Id(商户直连) 🔖
|
||||||
@ -302,6 +453,103 @@ export const SysWechatPayApiAxiosParamCreator = function (configuration?: Config
|
|||||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 查询单笔退款(通过商户退款单号) https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html
|
||||||
|
* @param {string} outRefundNumber
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet: async (outRefundNumber: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'outRefundNumber' is not null or undefined
|
||||||
|
if (outRefundNumber === null || outRefundNumber === undefined) {
|
||||||
|
throw new RequiredError('outRefundNumber','Required parameter outRefundNumber was null or undefined when calling apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet.');
|
||||||
|
}
|
||||||
|
const localVarPath = `/api/sysWechatPay/refundByOutRefundNumber/{outRefundNumber}`
|
||||||
|
.replace(`{${"outRefundNumber"}}`, encodeURIComponent(String(outRefundNumber)));
|
||||||
|
// 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 退款申请 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
||||||
|
* @param {RefundRequestInput} [body]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
apiSysWechatPayRefundPost: async (body?: RefundRequestInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/api/sysWechatPay/refund`;
|
||||||
|
// 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 {
|
return {
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
@ -330,6 +578,20 @@ export const SysWechatPayApiFp = function(configuration?: Configuration) {
|
|||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 获取支付记录列表(分页)
|
||||||
|
* @param {PageSysWechatPayInput} [body] PageSysWechatPayInput
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayPagePost(body?: PageSysWechatPayInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSqlSugarPagedListSysWechatPay>>> {
|
||||||
|
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPagePost(body, options);
|
||||||
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
|
return axios.request(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 微信支付成功回调(商户直连) 🔖
|
* @summary 微信支付成功回调(商户直连) 🔖
|
||||||
@ -377,13 +639,41 @@ export const SysWechatPayApiFp = function(configuration?: Configuration) {
|
|||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
|
async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>>> {
|
||||||
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayPartnerTransactionPost(body, options);
|
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayPartnerTransactionPost(body, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 微信支付订单号查询(校正) https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}
|
||||||
|
* @param {string} transactionId
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultWechatPayOutput>>> {
|
||||||
|
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId, options);
|
||||||
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
|
return axios.request(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 商户订单号查询(校正) https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}
|
||||||
|
* @param {string} outTradeNumber
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultWechatPayOutput>>> {
|
||||||
|
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber, options);
|
||||||
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
|
return axios.request(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 微信支付统一下单获取Id(商户直连) 🔖
|
* @summary 微信支付统一下单获取Id(商户直连) 🔖
|
||||||
@ -391,13 +681,41 @@ export const SysWechatPayApiFp = function(configuration?: Configuration) {
|
|||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
|
async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>>> {
|
||||||
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayTransactionPost(body, options);
|
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayPayTransactionPost(body, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 查询单笔退款(通过商户退款单号) https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html
|
||||||
|
* @param {string} outRefundNumber
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultGetRefundDomesticRefundByOutRefundNumberResponse>>> {
|
||||||
|
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber, options);
|
||||||
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
|
return axios.request(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 退款申请 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
||||||
|
* @param {RefundRequestInput} [body]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayRefundPost(body?: RefundRequestInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||||
|
const localVarAxiosArgs = await SysWechatPayApiAxiosParamCreator(configuration).apiSysWechatPayRefundPost(body, options);
|
||||||
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
|
return axios.request(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -417,6 +735,16 @@ export const SysWechatPayApiFactory = function (configuration?: Configuration, b
|
|||||||
async apiSysWechatPayGenerateParametersForJsapiPayPost(body?: WechatPayParaInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
|
async apiSysWechatPayGenerateParametersForJsapiPayPost(body?: WechatPayParaInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
|
||||||
return SysWechatPayApiFp(configuration).apiSysWechatPayGenerateParametersForJsapiPayPost(body, options).then((request) => request(axios, basePath));
|
return SysWechatPayApiFp(configuration).apiSysWechatPayGenerateParametersForJsapiPayPost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 获取支付记录列表(分页)
|
||||||
|
* @param {PageSysWechatPayInput} [body] PageSysWechatPayInput
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayPagePost(body?: PageSysWechatPayInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysWechatPay>> {
|
||||||
|
return SysWechatPayApiFp(configuration).apiSysWechatPayPagePost(body, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 微信支付成功回调(商户直连) 🔖
|
* @summary 微信支付成功回调(商户直连) 🔖
|
||||||
@ -452,9 +780,29 @@ export const SysWechatPayApiFactory = function (configuration?: Configuration, b
|
|||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
|
async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>> {
|
||||||
return SysWechatPayApiFp(configuration).apiSysWechatPayPayPartnerTransactionPost(body, options).then((request) => request(axios, basePath));
|
return SysWechatPayApiFp(configuration).apiSysWechatPayPayPartnerTransactionPost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 微信支付订单号查询(校正) https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}
|
||||||
|
* @param {string} transactionId
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultWechatPayOutput>> {
|
||||||
|
return SysWechatPayApiFp(configuration).apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 商户订单号查询(校正) https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}
|
||||||
|
* @param {string} outTradeNumber
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultWechatPayOutput>> {
|
||||||
|
return SysWechatPayApiFp(configuration).apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 微信支付统一下单获取Id(商户直连) 🔖
|
* @summary 微信支付统一下单获取Id(商户直连) 🔖
|
||||||
@ -462,9 +810,29 @@ export const SysWechatPayApiFactory = function (configuration?: Configuration, b
|
|||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
|
async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>> {
|
||||||
return SysWechatPayApiFp(configuration).apiSysWechatPayPayTransactionPost(body, options).then((request) => request(axios, basePath));
|
return SysWechatPayApiFp(configuration).apiSysWechatPayPayTransactionPost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 查询单笔退款(通过商户退款单号) https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html
|
||||||
|
* @param {string} outRefundNumber
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultGetRefundDomesticRefundByOutRefundNumberResponse>> {
|
||||||
|
return SysWechatPayApiFp(configuration).apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 退款申请 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
||||||
|
* @param {RefundRequestInput} [body]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysWechatPayRefundPost(body?: RefundRequestInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||||
|
return SysWechatPayApiFp(configuration).apiSysWechatPayRefundPost(body, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -486,6 +854,17 @@ export class SysWechatPayApi extends BaseAPI {
|
|||||||
public async apiSysWechatPayGenerateParametersForJsapiPayPost(body?: WechatPayParaInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
|
public async apiSysWechatPayGenerateParametersForJsapiPayPost(body?: WechatPayParaInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
|
||||||
return SysWechatPayApiFp(this.configuration).apiSysWechatPayGenerateParametersForJsapiPayPost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayGenerateParametersForJsapiPayPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 获取支付记录列表(分页)
|
||||||
|
* @param {PageSysWechatPayInput} [body] PageSysWechatPayInput
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof SysWechatPayApi
|
||||||
|
*/
|
||||||
|
public async apiSysWechatPayPagePost(body?: PageSysWechatPayInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysWechatPay>> {
|
||||||
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPagePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 微信支付成功回调(商户直连) 🔖
|
* @summary 微信支付成功回调(商户直连) 🔖
|
||||||
@ -525,9 +904,31 @@ export class SysWechatPayApi extends BaseAPI {
|
|||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysWechatPayApi
|
* @memberof SysWechatPayApi
|
||||||
*/
|
*/
|
||||||
public async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
|
public async apiSysWechatPayPayPartnerTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>> {
|
||||||
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayPartnerTransactionPost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayPartnerTransactionPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 微信支付订单号查询(校正) https://api.mch.weixin.qq.com/v3/pay/transactions/id/{transaction_id}
|
||||||
|
* @param {string} transactionId
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof SysWechatPayApi
|
||||||
|
*/
|
||||||
|
public async apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultWechatPayOutput>> {
|
||||||
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayTransactionByIdTransactionIdGet(transactionId, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 商户订单号查询(校正) https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/{out_trade_no}
|
||||||
|
* @param {string} outTradeNumber
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof SysWechatPayApi
|
||||||
|
*/
|
||||||
|
public async apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultWechatPayOutput>> {
|
||||||
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayTransactionByOutTradeNumberOutTradeNumberGet(outTradeNumber, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 微信支付统一下单获取Id(商户直连) 🔖
|
* @summary 微信支付统一下单获取Id(商户直连) 🔖
|
||||||
@ -536,7 +937,29 @@ export class SysWechatPayApi extends BaseAPI {
|
|||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysWechatPayApi
|
* @memberof SysWechatPayApi
|
||||||
*/
|
*/
|
||||||
public async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
|
public async apiSysWechatPayPayTransactionPost(body?: WechatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultCreatePayTransactionOutput>> {
|
||||||
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayTransactionPost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayPayTransactionPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 查询单笔退款(通过商户退款单号) https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/query-by-out-refund-no.html
|
||||||
|
* @param {string} outRefundNumber
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof SysWechatPayApi
|
||||||
|
*/
|
||||||
|
public async apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultGetRefundDomesticRefundByOutRefundNumberResponse>> {
|
||||||
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayRefundByOutRefundNumberOutRefundNumberGet(outRefundNumber, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 退款申请 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
||||||
|
* @param {RefundRequestInput} [body]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof SysWechatPayApi
|
||||||
|
*/
|
||||||
|
public async apiSysWechatPayRefundPost(body?: RefundRequestInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||||
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayRefundPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -203,4 +203,12 @@ export interface AddCodeGenInput {
|
|||||||
* @memberof AddCodeGenInput
|
* @memberof AddCodeGenInput
|
||||||
*/
|
*/
|
||||||
generateMenu: boolean;
|
generateMenu: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否使用 Api Service
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof AddCodeGenInput
|
||||||
|
*/
|
||||||
|
isApiService?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { SysUser } from './sys-user';
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -92,6 +93,12 @@ export interface AddOpenAccessInput {
|
|||||||
*/
|
*/
|
||||||
bindTenantId?: number;
|
bindTenantId?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {SysUser}
|
||||||
|
* @memberof AddOpenAccessInput
|
||||||
|
*/
|
||||||
|
bindUser?: SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份标识
|
* 身份标识
|
||||||
*
|
*
|
||||||
|
|||||||
@ -0,0 +1,69 @@
|
|||||||
|
/* 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 { CreatePayTransactionOutput } from './create-pay-transaction-output';
|
||||||
|
/**
|
||||||
|
* 全局返回结果
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface AdminResultCreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
export interface AdminResultCreatePayTransactionOutput {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态码
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof AdminResultCreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
code?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型success、warning、error
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AdminResultCreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
type?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误信息
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AdminResultCreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
message?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {CreatePayTransactionOutput}
|
||||||
|
* @memberof AdminResultCreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
result?: CreatePayTransactionOutput;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附加数据
|
||||||
|
*
|
||||||
|
* @type {any}
|
||||||
|
* @memberof AdminResultCreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
extras?: any | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof AdminResultCreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
time?: Date;
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
/* 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 { GetRefundDomesticRefundByOutRefundNumberResponse } from './get-refund-domestic-refund-by-out-refund-number-response';
|
||||||
|
/**
|
||||||
|
* 全局返回结果
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
export interface AdminResultGetRefundDomesticRefundByOutRefundNumberResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态码
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
code?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型success、warning、error
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
type?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误信息
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
message?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {GetRefundDomesticRefundByOutRefundNumberResponse}
|
||||||
|
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
result?: GetRefundDomesticRefundByOutRefundNumberResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附加数据
|
||||||
|
*
|
||||||
|
* @type {any}
|
||||||
|
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
extras?: any | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof AdminResultGetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
time?: Date;
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
/* 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 { SqlSugarPagedListSysWechatPay } from './sql-sugar-paged-list-sys-wechat-pay';
|
||||||
|
/**
|
||||||
|
* 全局返回结果
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface AdminResultSqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
export interface AdminResultSqlSugarPagedListSysWechatPay {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态码
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof AdminResultSqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
code?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型success、warning、error
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AdminResultSqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
type?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误信息
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AdminResultSqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
message?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {SqlSugarPagedListSysWechatPay}
|
||||||
|
* @memberof AdminResultSqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
result?: SqlSugarPagedListSysWechatPay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附加数据
|
||||||
|
*
|
||||||
|
* @type {any}
|
||||||
|
* @memberof AdminResultSqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
extras?: any | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof AdminResultSqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
time?: Date;
|
||||||
|
}
|
||||||
83
Web/src/api-services/models/amount.ts
Normal file
83
Web/src/api-services/models/amount.ts
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/* 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 { From } from './from';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Amount
|
||||||
|
*/
|
||||||
|
export interface Amount {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
total?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
refund?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
currency?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
payerTotal?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
payerRefund?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
settlementTotal?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
settlementRefund?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
discountRefund?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Array<From>}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
from?: Array<From> | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Amount
|
||||||
|
*/
|
||||||
|
refundFee?: number | null;
|
||||||
|
}
|
||||||
34
Web/src/api-services/models/create-pay-transaction-output.ts
Normal file
34
Web/src/api-services/models/create-pay-transaction-output.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* 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 CreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
export interface CreatePayTransactionOutput {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
prepayId?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CreatePayTransactionOutput
|
||||||
|
*/
|
||||||
|
outTradeNumber?: string | null;
|
||||||
|
}
|
||||||
@ -42,6 +42,8 @@ export enum DbType {
|
|||||||
NUMBER_21 = 21,
|
NUMBER_21 = 21,
|
||||||
NUMBER_22 = 22,
|
NUMBER_22 = 22,
|
||||||
NUMBER_23 = 23,
|
NUMBER_23 = 23,
|
||||||
|
NUMBER_24 = 24,
|
||||||
|
NUMBER_25 = 25,
|
||||||
NUMBER_900 = 900
|
NUMBER_900 = 900
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
Web/src/api-services/models/from.ts
Normal file
34
Web/src/api-services/models/from.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* 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 From
|
||||||
|
*/
|
||||||
|
export interface From {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof From
|
||||||
|
*/
|
||||||
|
amount?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof From
|
||||||
|
*/
|
||||||
|
account?: string | null;
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
/* 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 { Amount } from './amount';
|
||||||
|
import { Promotion } from './promotion';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
export interface GetRefundDomesticRefundByOutRefundNumberResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
code?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
message?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {{ [key: string]: any; }}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
detail?: { [key: string]: any; } | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
refundId?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
outRefundNo?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
transactionId?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
outTradeNo?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
channel?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
userReceivedAccount?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
fundsAccount?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
status?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
successTime?: Date | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
createTime?: Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Amount}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
amount?: Amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Array<Promotion>}
|
||||||
|
* @memberof GetRefundDomesticRefundByOutRefundNumberResponse
|
||||||
|
*/
|
||||||
|
promotionDetail?: Array<Promotion> | null;
|
||||||
|
}
|
||||||
58
Web/src/api-services/models/goods-detail.ts
Normal file
58
Web/src/api-services/models/goods-detail.ts
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/* 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 GoodsDetail
|
||||||
|
*/
|
||||||
|
export interface GoodsDetail {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GoodsDetail
|
||||||
|
*/
|
||||||
|
merchantGoodsId?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GoodsDetail
|
||||||
|
*/
|
||||||
|
wechatpayGoodsId?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof GoodsDetail
|
||||||
|
*/
|
||||||
|
goodsName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof GoodsDetail
|
||||||
|
*/
|
||||||
|
unitPrice?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof GoodsDetail
|
||||||
|
*/
|
||||||
|
refundAmount?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof GoodsDetail
|
||||||
|
*/
|
||||||
|
refundQuantity?: number;
|
||||||
|
}
|
||||||
@ -19,9 +19,11 @@ export * from './add-sys-ldap-input';
|
|||||||
export * from './add-tenant-input';
|
export * from './add-tenant-input';
|
||||||
export * from './add-user-input';
|
export * from './add-user-input';
|
||||||
export * from './admin-result-boolean';
|
export * from './admin-result-boolean';
|
||||||
|
export * from './admin-result-create-pay-transaction-output';
|
||||||
export * from './admin-result-data-set';
|
export * from './admin-result-data-set';
|
||||||
export * from './admin-result-data-table';
|
export * from './admin-result-data-table';
|
||||||
export * from './admin-result-dictionary-string-string';
|
export * from './admin-result-dictionary-string-string';
|
||||||
|
export * from './admin-result-get-refund-domestic-refund-by-out-refund-number-response';
|
||||||
export * from './admin-result-iaction-result';
|
export * from './admin-result-iaction-result';
|
||||||
export * from './admin-result-int32';
|
export * from './admin-result-int32';
|
||||||
export * from './admin-result-int64';
|
export * from './admin-result-int64';
|
||||||
@ -82,6 +84,7 @@ export * from './admin-result-sql-sugar-paged-list-sys-online-user';
|
|||||||
export * from './admin-result-sql-sugar-paged-list-sys-plugin';
|
export * from './admin-result-sql-sugar-paged-list-sys-plugin';
|
||||||
export * from './admin-result-sql-sugar-paged-list-sys-print';
|
export * from './admin-result-sql-sugar-paged-list-sys-print';
|
||||||
export * from './admin-result-sql-sugar-paged-list-sys-region';
|
export * from './admin-result-sql-sugar-paged-list-sys-region';
|
||||||
|
export * from './admin-result-sql-sugar-paged-list-sys-wechat-pay';
|
||||||
export * from './admin-result-sql-sugar-paged-list-tenant-output';
|
export * from './admin-result-sql-sugar-paged-list-tenant-output';
|
||||||
export * from './admin-result-sql-sugar-paged-list-user-output';
|
export * from './admin-result-sql-sugar-paged-list-user-output';
|
||||||
export * from './admin-result-string';
|
export * from './admin-result-string';
|
||||||
@ -101,6 +104,7 @@ export * from './admin-result-visual-db-table';
|
|||||||
export * from './admin-result-wechat-pay-output';
|
export * from './admin-result-wechat-pay-output';
|
||||||
export * from './admin-result-wx-open-id-output';
|
export * from './admin-result-wx-open-id-output';
|
||||||
export * from './admin-result-wx-phone-output';
|
export * from './admin-result-wx-phone-output';
|
||||||
|
export * from './amount';
|
||||||
export * from './api-output';
|
export * from './api-output';
|
||||||
export * from './assembly';
|
export * from './assembly';
|
||||||
export * from './base-api-input';
|
export * from './base-api-input';
|
||||||
@ -114,13 +118,13 @@ export * from './card-type-enum';
|
|||||||
export * from './change-pwd-input';
|
export * from './change-pwd-input';
|
||||||
export * from './cluster-status';
|
export * from './cluster-status';
|
||||||
export * from './code-gen-config';
|
export * from './code-gen-config';
|
||||||
export * from './code-gen-input';
|
|
||||||
export * from './column-ouput';
|
export * from './column-ouput';
|
||||||
export * from './column-relation';
|
export * from './column-relation';
|
||||||
export * from './compare-info';
|
export * from './compare-info';
|
||||||
export * from './const-output';
|
export * from './const-output';
|
||||||
export * from './constructor-info';
|
export * from './constructor-info';
|
||||||
export * from './create-entity-input';
|
export * from './create-entity-input';
|
||||||
|
export * from './create-pay-transaction-output';
|
||||||
export * from './create-seed-data-input';
|
export * from './create-seed-data-input';
|
||||||
export * from './culture-info';
|
export * from './culture-info';
|
||||||
export * from './culture-level-enum';
|
export * from './culture-level-enum';
|
||||||
@ -179,10 +183,13 @@ export * from './field-attributes';
|
|||||||
export * from './field-info';
|
export * from './field-info';
|
||||||
export * from './file-input';
|
export * from './file-input';
|
||||||
export * from './file-output';
|
export * from './file-output';
|
||||||
|
export * from './from';
|
||||||
export * from './gen-auth-url-input';
|
export * from './gen-auth-url-input';
|
||||||
export * from './gender-enum';
|
export * from './gender-enum';
|
||||||
export * from './generate-signature-input';
|
export * from './generate-signature-input';
|
||||||
export * from './generic-parameter-attributes';
|
export * from './generic-parameter-attributes';
|
||||||
|
export * from './get-refund-domestic-refund-by-out-refund-number-response';
|
||||||
|
export * from './goods-detail';
|
||||||
export * from './http-method-enum';
|
export * from './http-method-enum';
|
||||||
export * from './iaction-result';
|
export * from './iaction-result';
|
||||||
export * from './icomponent';
|
export * from './icomponent';
|
||||||
@ -225,8 +232,8 @@ export * from './notice-user-status-enum';
|
|||||||
export * from './number-format-info';
|
export * from './number-format-info';
|
||||||
export * from './oauth-user-input';
|
export * from './oauth-user-input';
|
||||||
export * from './oauth-user-output';
|
export * from './oauth-user-output';
|
||||||
export * from './open-access-input';
|
|
||||||
export * from './open-access-output';
|
export * from './open-access-output';
|
||||||
|
export * from './page-code-gen-input';
|
||||||
export * from './page-config-input';
|
export * from './page-config-input';
|
||||||
export * from './page-dict-data-input';
|
export * from './page-dict-data-input';
|
||||||
export * from './page-dict-type-input';
|
export * from './page-dict-type-input';
|
||||||
@ -236,6 +243,7 @@ export * from './page-job-trigger-record-input';
|
|||||||
export * from './page-log-input';
|
export * from './page-log-input';
|
||||||
export * from './page-notice-input';
|
export * from './page-notice-input';
|
||||||
export * from './page-online-user-input';
|
export * from './page-online-user-input';
|
||||||
|
export * from './page-open-access-input';
|
||||||
export * from './page-plugin-input';
|
export * from './page-plugin-input';
|
||||||
export * from './page-pos-input';
|
export * from './page-pos-input';
|
||||||
export * from './page-pos-output';
|
export * from './page-pos-output';
|
||||||
@ -243,6 +251,8 @@ export * from './page-print-input';
|
|||||||
export * from './page-region-input';
|
export * from './page-region-input';
|
||||||
export * from './page-role-input';
|
export * from './page-role-input';
|
||||||
export * from './page-role-output';
|
export * from './page-role-output';
|
||||||
|
export * from './page-sys-ldap-input';
|
||||||
|
export * from './page-sys-wechat-pay-input';
|
||||||
export * from './page-tenant-input';
|
export * from './page-tenant-input';
|
||||||
export * from './page-user-input';
|
export * from './page-user-input';
|
||||||
export * from './parameter-attributes';
|
export * from './parameter-attributes';
|
||||||
@ -250,8 +260,10 @@ export * from './parameter-info';
|
|||||||
export * from './platform-type-enum';
|
export * from './platform-type-enum';
|
||||||
export * from './pos-output';
|
export * from './pos-output';
|
||||||
export * from './print-type-enum';
|
export * from './print-type-enum';
|
||||||
|
export * from './promotion';
|
||||||
export * from './property-attributes';
|
export * from './property-attributes';
|
||||||
export * from './property-info';
|
export * from './property-info';
|
||||||
|
export * from './refund-request-input';
|
||||||
export * from './reset-pwd-user-input';
|
export * from './reset-pwd-user-input';
|
||||||
export * from './role-api-input';
|
export * from './role-api-input';
|
||||||
export * from './role-input';
|
export * from './role-input';
|
||||||
@ -290,6 +302,7 @@ export * from './sql-sugar-paged-list-sys-online-user';
|
|||||||
export * from './sql-sugar-paged-list-sys-plugin';
|
export * from './sql-sugar-paged-list-sys-plugin';
|
||||||
export * from './sql-sugar-paged-list-sys-print';
|
export * from './sql-sugar-paged-list-sys-print';
|
||||||
export * from './sql-sugar-paged-list-sys-region';
|
export * from './sql-sugar-paged-list-sys-region';
|
||||||
|
export * from './sql-sugar-paged-list-sys-wechat-pay';
|
||||||
export * from './sql-sugar-paged-list-tenant-output';
|
export * from './sql-sugar-paged-list-tenant-output';
|
||||||
export * from './sql-sugar-paged-list-user-output';
|
export * from './sql-sugar-paged-list-user-output';
|
||||||
export * from './status-enum';
|
export * from './status-enum';
|
||||||
@ -311,7 +324,6 @@ export * from './sys-job-detail';
|
|||||||
export * from './sys-job-trigger';
|
export * from './sys-job-trigger';
|
||||||
export * from './sys-job-trigger-record';
|
export * from './sys-job-trigger-record';
|
||||||
export * from './sys-ldap';
|
export * from './sys-ldap';
|
||||||
export * from './sys-ldap-input';
|
|
||||||
export * from './sys-log-diff';
|
export * from './sys-log-diff';
|
||||||
export * from './sys-log-ex';
|
export * from './sys-log-ex';
|
||||||
export * from './sys-log-op';
|
export * from './sys-log-op';
|
||||||
|
|||||||
@ -30,12 +30,6 @@ export interface MemberInfo {
|
|||||||
*/
|
*/
|
||||||
memberType?: MemberTypes;
|
memberType?: MemberTypes;
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {string}
|
|
||||||
* @memberof MemberInfo
|
|
||||||
*/
|
|
||||||
name?: string | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Type}
|
* @type {Type}
|
||||||
* @memberof MemberInfo
|
* @memberof MemberInfo
|
||||||
@ -48,6 +42,12 @@ export interface MemberInfo {
|
|||||||
*/
|
*/
|
||||||
reflectedType?: Type;
|
reflectedType?: Type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof MemberInfo
|
||||||
|
*/
|
||||||
|
name?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Module}
|
* @type {Module}
|
||||||
* @memberof MemberInfo
|
* @memberof MemberInfo
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { SysUser } from './sys-user';
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -116,6 +117,12 @@ export interface OpenAccessOutput {
|
|||||||
*/
|
*/
|
||||||
bindUserId?: number;
|
bindUserId?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {SysUser}
|
||||||
|
* @memberof OpenAccessOutput
|
||||||
|
*/
|
||||||
|
bindUser?: SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定用户账号
|
* 绑定用户账号
|
||||||
*
|
*
|
||||||
|
|||||||
@ -16,15 +16,15 @@
|
|||||||
* 代码生成参数类
|
* 代码生成参数类
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
* @interface CodeGenInput
|
* @interface PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
export interface CodeGenInput {
|
export interface PageCodeGenInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前页码
|
* 当前页码
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
page?: number;
|
page?: number;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ export interface CodeGenInput {
|
|||||||
* 页码容量
|
* 页码容量
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ export interface CodeGenInput {
|
|||||||
* 排序字段
|
* 排序字段
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
field?: string | null;
|
field?: string | null;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ export interface CodeGenInput {
|
|||||||
* 排序方向
|
* 排序方向
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
order?: string | null;
|
order?: string | null;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ export interface CodeGenInput {
|
|||||||
* 降序排序
|
* 降序排序
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
descStr?: string | null;
|
descStr?: string | null;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ export interface CodeGenInput {
|
|||||||
* 作者姓名
|
* 作者姓名
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
authorName?: string | null;
|
authorName?: string | null;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ export interface CodeGenInput {
|
|||||||
* 类名
|
* 类名
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
className?: string | null;
|
className?: string | null;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ export interface CodeGenInput {
|
|||||||
* 是否移除表前缀
|
* 是否移除表前缀
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
tablePrefix?: string | null;
|
tablePrefix?: string | null;
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ export interface CodeGenInput {
|
|||||||
* 库定位器名
|
* 库定位器名
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
configId?: string | null;
|
configId?: string | null;
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ export interface CodeGenInput {
|
|||||||
* 数据库名(保留字段)
|
* 数据库名(保留字段)
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
dbName?: string | null;
|
dbName?: string | null;
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ export interface CodeGenInput {
|
|||||||
* 数据库类型
|
* 数据库类型
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
dbType?: string | null;
|
dbType?: string | null;
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ export interface CodeGenInput {
|
|||||||
* 数据库链接
|
* 数据库链接
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
connectionString?: string | null;
|
connectionString?: string | null;
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ export interface CodeGenInput {
|
|||||||
* 生成方式
|
* 生成方式
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
generateType?: string | null;
|
generateType?: string | null;
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ export interface CodeGenInput {
|
|||||||
* 数据库表名
|
* 数据库表名
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
tableName?: string | null;
|
tableName?: string | null;
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ export interface CodeGenInput {
|
|||||||
* 命名空间
|
* 命名空间
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
nameSpace?: string | null;
|
nameSpace?: string | null;
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ export interface CodeGenInput {
|
|||||||
* 业务名(业务代码包名称)
|
* 业务名(业务代码包名称)
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
busName?: string | null;
|
busName?: string | null;
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ export interface CodeGenInput {
|
|||||||
* 功能名(数据库表名称)
|
* 功能名(数据库表名称)
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
tableComment?: string | null;
|
tableComment?: string | null;
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ export interface CodeGenInput {
|
|||||||
* 菜单应用分类(应用编码)
|
* 菜单应用分类(应用编码)
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
menuApplication?: string | null;
|
menuApplication?: string | null;
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ export interface CodeGenInput {
|
|||||||
* 是否生成菜单
|
* 是否生成菜单
|
||||||
*
|
*
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
generateMenu?: boolean;
|
generateMenu?: boolean;
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ export interface CodeGenInput {
|
|||||||
* 菜单父级
|
* 菜单父级
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
menuPid?: number | null;
|
menuPid?: number | null;
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ export interface CodeGenInput {
|
|||||||
* 页面目录
|
* 页面目录
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
pagePath?: string | null;
|
pagePath?: string | null;
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ export interface CodeGenInput {
|
|||||||
* 支持打印类型
|
* 支持打印类型
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
printType?: string | null;
|
printType?: string | null;
|
||||||
|
|
||||||
@ -200,7 +200,15 @@ export interface CodeGenInput {
|
|||||||
* 打印模版名称
|
* 打印模版名称
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof CodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
printName?: string | null;
|
printName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否使用 Api Service
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof PageCodeGenInput
|
||||||
|
*/
|
||||||
|
isApiService?: boolean;
|
||||||
}
|
}
|
||||||
@ -16,15 +16,15 @@
|
|||||||
* 开放接口身份输入参数
|
* 开放接口身份输入参数
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
* @interface OpenAccessInput
|
* @interface PageOpenAccessInput
|
||||||
*/
|
*/
|
||||||
export interface OpenAccessInput {
|
export interface PageOpenAccessInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前页码
|
* 当前页码
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof OpenAccessInput
|
* @memberof PageOpenAccessInput
|
||||||
*/
|
*/
|
||||||
page?: number;
|
page?: number;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ export interface OpenAccessInput {
|
|||||||
* 页码容量
|
* 页码容量
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof OpenAccessInput
|
* @memberof PageOpenAccessInput
|
||||||
*/
|
*/
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ export interface OpenAccessInput {
|
|||||||
* 排序字段
|
* 排序字段
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof OpenAccessInput
|
* @memberof PageOpenAccessInput
|
||||||
*/
|
*/
|
||||||
field?: string | null;
|
field?: string | null;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ export interface OpenAccessInput {
|
|||||||
* 排序方向
|
* 排序方向
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof OpenAccessInput
|
* @memberof PageOpenAccessInput
|
||||||
*/
|
*/
|
||||||
order?: string | null;
|
order?: string | null;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ export interface OpenAccessInput {
|
|||||||
* 降序排序
|
* 降序排序
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof OpenAccessInput
|
* @memberof PageOpenAccessInput
|
||||||
*/
|
*/
|
||||||
descStr?: string | null;
|
descStr?: string | null;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ export interface OpenAccessInput {
|
|||||||
* 身份标识
|
* 身份标识
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof OpenAccessInput
|
* @memberof PageOpenAccessInput
|
||||||
*/
|
*/
|
||||||
accessKey?: string | null;
|
accessKey?: string | null;
|
||||||
}
|
}
|
||||||
@ -16,15 +16,15 @@
|
|||||||
* 系统域登录信息配置输入参数
|
* 系统域登录信息配置输入参数
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
* @interface SysLdapInput
|
* @interface PageSysLdapInput
|
||||||
*/
|
*/
|
||||||
export interface SysLdapInput {
|
export interface PageSysLdapInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前页码
|
* 当前页码
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof SysLdapInput
|
* @memberof PageSysLdapInput
|
||||||
*/
|
*/
|
||||||
page?: number;
|
page?: number;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ export interface SysLdapInput {
|
|||||||
* 页码容量
|
* 页码容量
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof SysLdapInput
|
* @memberof PageSysLdapInput
|
||||||
*/
|
*/
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ export interface SysLdapInput {
|
|||||||
* 排序字段
|
* 排序字段
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof SysLdapInput
|
* @memberof PageSysLdapInput
|
||||||
*/
|
*/
|
||||||
field?: string | null;
|
field?: string | null;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ export interface SysLdapInput {
|
|||||||
* 排序方向
|
* 排序方向
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof SysLdapInput
|
* @memberof PageSysLdapInput
|
||||||
*/
|
*/
|
||||||
order?: string | null;
|
order?: string | null;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ export interface SysLdapInput {
|
|||||||
* 降序排序
|
* 降序排序
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof SysLdapInput
|
* @memberof PageSysLdapInput
|
||||||
*/
|
*/
|
||||||
descStr?: string | null;
|
descStr?: string | null;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ export interface SysLdapInput {
|
|||||||
* 关键字查询
|
* 关键字查询
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof SysLdapInput
|
* @memberof PageSysLdapInput
|
||||||
*/
|
*/
|
||||||
searchKey?: string | null;
|
searchKey?: string | null;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ export interface SysLdapInput {
|
|||||||
* 主机
|
* 主机
|
||||||
*
|
*
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @memberof SysLdapInput
|
* @memberof PageSysLdapInput
|
||||||
*/
|
*/
|
||||||
host?: string | null;
|
host?: string | null;
|
||||||
}
|
}
|
||||||
102
Web/src/api-services/models/page-sys-wechat-pay-input.ts
Normal file
102
Web/src/api-services/models/page-sys-wechat-pay-input.ts
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
/* 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 PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
export interface PageSysWechatPayInput {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前页码
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
page?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页码容量
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
pageSize?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序字段
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
field?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序方向
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
order?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 降序排序
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
descStr?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* order_id
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
orderId?: number | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* order_status
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
orderStatus?: number | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* out_trade_number
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
outTradeNumber?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* success_time范围
|
||||||
|
*
|
||||||
|
* @type {Array<Date>}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
successTimeRange?: Array<Date> | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* expire_time范围
|
||||||
|
*
|
||||||
|
* @type {Array<Date>}
|
||||||
|
* @memberof PageSysWechatPayInput
|
||||||
|
*/
|
||||||
|
expireTimeRange?: Array<Date> | null;
|
||||||
|
}
|
||||||
59
Web/src/api-services/models/promotion.ts
Normal file
59
Web/src/api-services/models/promotion.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/* 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 { GoodsDetail } from './goods-detail';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Promotion
|
||||||
|
*/
|
||||||
|
export interface Promotion {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Promotion
|
||||||
|
*/
|
||||||
|
promotionId?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Promotion
|
||||||
|
*/
|
||||||
|
scope?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Promotion
|
||||||
|
*/
|
||||||
|
type?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Promotion
|
||||||
|
*/
|
||||||
|
amount?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Promotion
|
||||||
|
*/
|
||||||
|
refundAmount?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Array<GoodsDetail>}
|
||||||
|
* @memberof Promotion
|
||||||
|
*/
|
||||||
|
goodsDetail?: Array<GoodsDetail> | null;
|
||||||
|
}
|
||||||
126
Web/src/api-services/models/refund-request-input.ts
Normal file
126
Web/src/api-services/models/refund-request-input.ts
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
/* 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 RefundRequestInput
|
||||||
|
*/
|
||||||
|
export interface RefundRequestInput {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户订单号(原支付交易对应的付款单号)
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
outTradeNumber?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原订单金额(分)
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
total?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款金额(分)
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
refund?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款原因
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
reason?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户订单号
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
orderId?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
orderStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户商品编码
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
merchantGoodsId?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户商品名称
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
goodsName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户商品单价
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
unitPrice?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户商品退款金额
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
refundAmount?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户商品退货数量
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
refundQuantity?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附加数据
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
attachment?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RefundRequestInput
|
||||||
|
*/
|
||||||
|
remark?: string | null;
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
/* 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 { SysWechatPay } from './sys-wechat-pay';
|
||||||
|
/**
|
||||||
|
* 分页泛型集合
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface SqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
export interface SqlSugarPagedListSysWechatPay {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页码
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
page?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页容量
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
pageSize?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总条数
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
total?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总页数
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
totalPages?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前页集合
|
||||||
|
*
|
||||||
|
* @type {Array<SysWechatPay>}
|
||||||
|
* @memberof SqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
items?: Array<SysWechatPay> | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有上一页
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof SqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
hasPrevPage?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有下一页
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof SqlSugarPagedListSysWechatPay
|
||||||
|
*/
|
||||||
|
hasNextPage?: boolean;
|
||||||
|
}
|
||||||
@ -211,4 +211,12 @@ export interface SysCodeGen {
|
|||||||
* @memberof SysCodeGen
|
* @memberof SysCodeGen
|
||||||
*/
|
*/
|
||||||
printName?: string | null;
|
printName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否使用 Api Service
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof SysCodeGen
|
||||||
|
*/
|
||||||
|
isApiService?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,6 +84,22 @@ export interface SysWechatPay {
|
|||||||
*/
|
*/
|
||||||
isDelete?: boolean;
|
isDelete?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户订单号
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SysWechatPay
|
||||||
|
*/
|
||||||
|
orderId?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SysWechatPay
|
||||||
|
*/
|
||||||
|
orderStatus?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信商户号
|
* 微信商户号
|
||||||
*
|
*
|
||||||
|
|||||||
@ -204,6 +204,14 @@ export interface UpdateCodeGenInput {
|
|||||||
*/
|
*/
|
||||||
printName?: string | null;
|
printName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否使用 Api Service
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof UpdateCodeGenInput
|
||||||
|
*/
|
||||||
|
isApiService?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代码生成器Id
|
* 代码生成器Id
|
||||||
*
|
*
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { SysUser } from './sys-user';
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -92,6 +93,12 @@ export interface UpdateOpenAccessInput {
|
|||||||
*/
|
*/
|
||||||
bindTenantId?: number;
|
bindTenantId?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {SysUser}
|
||||||
|
* @memberof UpdateOpenAccessInput
|
||||||
|
*/
|
||||||
|
bindUser?: SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份标识
|
* 身份标识
|
||||||
*
|
*
|
||||||
|
|||||||
@ -28,6 +28,30 @@ export interface WechatPayOutput {
|
|||||||
*/
|
*/
|
||||||
openId?: string | null;
|
openId?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户(支付交易)单号,微信唯一
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof WechatPayOutput
|
||||||
|
*/
|
||||||
|
outTradeNumber?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户(商品交易)订单号
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof WechatPayOutput
|
||||||
|
*/
|
||||||
|
orderId?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof WechatPayOutput
|
||||||
|
*/
|
||||||
|
orderStatus?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单金额
|
* 订单金额
|
||||||
*
|
*
|
||||||
@ -51,4 +75,36 @@ export interface WechatPayOutput {
|
|||||||
* @memberof WechatPayOutput
|
* @memberof WechatPayOutput
|
||||||
*/
|
*/
|
||||||
goodsTag?: string | null;
|
goodsTag?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付发起时间
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof WechatPayOutput
|
||||||
|
*/
|
||||||
|
createTime?: Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付完成时间
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof WechatPayOutput
|
||||||
|
*/
|
||||||
|
successTime?: Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易状态(支付成功后,微信返回)
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof WechatPayOutput
|
||||||
|
*/
|
||||||
|
tradeState?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易状态描述(支付成功后,微信返回)
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof WechatPayOutput
|
||||||
|
*/
|
||||||
|
tradeStateDescription?: string | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,4 +59,20 @@ export interface WechatPayTransactionInput {
|
|||||||
* @memberof WechatPayTransactionInput
|
* @memberof WechatPayTransactionInput
|
||||||
*/
|
*/
|
||||||
goodsTag?: string | null;
|
goodsTag?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户订单号
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof WechatPayTransactionInput
|
||||||
|
*/
|
||||||
|
orderId?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的商户订单付款状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof WechatPayTransactionInput
|
||||||
|
*/
|
||||||
|
orderStatus?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,10 +8,10 @@ import 'vxe-table-plugin-element/dist/style.css';
|
|||||||
// Vxe UI 组件库
|
// Vxe UI 组件库
|
||||||
import VxeUI, { VxeComponentSizeType } from 'vxe-pc-ui';
|
import VxeUI, { VxeComponentSizeType } from 'vxe-pc-ui';
|
||||||
import ExcelJS from 'exceljs';
|
import ExcelJS from 'exceljs';
|
||||||
import { Local } from '../utils/storage';
|
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||||
|
const vxeSize: VxeComponentSizeType = useThemeConfig().themeConfig.globalComponentSize == 'small' ? 'mini' : useThemeConfig().themeConfig.globalComponentSize == 'default' ? 'small' : 'medium';
|
||||||
|
|
||||||
export const setupVXETable = (app: App) => {
|
export const setupVXETable = (app: App) => {
|
||||||
let vxeSize = getVxeTableSize();
|
|
||||||
// 加载插件
|
// 加载插件
|
||||||
VxeUITable.use(VXETablePluginElement);
|
VxeUITable.use(VXETablePluginElement);
|
||||||
VxeUITable.use(VXETablePluginExportXLSX, { ExcelJS: ExcelJS });
|
VxeUITable.use(VXETablePluginExportXLSX, { ExcelJS: ExcelJS });
|
||||||
@ -109,18 +109,3 @@ export const setupVXETable = (app: App) => {
|
|||||||
// app.config.globalProperties.$XSaveFile = VxeUI.saveFile
|
// app.config.globalProperties.$XSaveFile = VxeUI.saveFile
|
||||||
// app.config.globalProperties.$XReadFile = VxeUI.readFile
|
// app.config.globalProperties.$XReadFile = VxeUI.readFile
|
||||||
};
|
};
|
||||||
|
|
||||||
// 从全局主题里面获取组件大小模式
|
|
||||||
function getVxeTableSize() {
|
|
||||||
let vxeSize: VxeComponentSizeType = 'mini';
|
|
||||||
|
|
||||||
let themeConfig = Local.get('themeConfig');
|
|
||||||
if (themeConfig == null || themeConfig == undefined) return vxeSize;
|
|
||||||
|
|
||||||
let size = themeConfig.globalComponentSize;
|
|
||||||
if (size == 'large') vxeSize = 'medium';
|
|
||||||
else if (size == 'default') vxeSize = 'small';
|
|
||||||
else if (size == 'small') vxeSize = 'mini';
|
|
||||||
|
|
||||||
return vxeSize;
|
|
||||||
}
|
|
||||||
|
|||||||
84
Web/src/hooks/useVxeTableOptionsHook.ts
Normal file
84
Web/src/hooks/useVxeTableOptionsHook.ts
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import { dayjs } from 'element-plus';
|
||||||
|
import { reactive } from 'vue';
|
||||||
|
import { VxeGridProps, VxeGridPropTypes, VxeComponentSizeType } from 'vxe-table';
|
||||||
|
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||||
|
import { merge } from 'lodash-es';
|
||||||
|
|
||||||
|
const vxeSize: VxeComponentSizeType = useThemeConfig().themeConfig.globalComponentSize == 'small' ? 'mini' : useThemeConfig().themeConfig.globalComponentSize == 'default' ? 'small' : 'medium';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} id 表格唯一标识,为空时自动随机产生;
|
||||||
|
* @param {String} id name:表格名称,与导出文件名有关;
|
||||||
|
* @param {VxeGridPropTypes.Columns<any>} columns 列配置;
|
||||||
|
*/
|
||||||
|
interface iVxeOption {
|
||||||
|
id?: string;
|
||||||
|
name?: string;
|
||||||
|
columns: VxeGridPropTypes.Columns<any>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vxe表格参数化Hook
|
||||||
|
* @param {iVxeOption} opt 参数
|
||||||
|
* @param {VxeGridProps<RowVO>} extras 要覆盖的参数
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const useVxeTable = <T>(opt: iVxeOption, extras?: VxeGridProps<T>) => {
|
||||||
|
// 默认参数
|
||||||
|
opt = Object.assign({ enableExport: true, remoteExport: false }, opt);
|
||||||
|
// 创建tableId,表格id固定才可以记录调整列宽,再次刷新仍有效。
|
||||||
|
opt.id = opt.id ? opt.id : String(new Date().getTime());
|
||||||
|
// console.log(opt);
|
||||||
|
const options = reactive<VxeGridProps>({
|
||||||
|
id: opt.id,
|
||||||
|
height: 'auto',
|
||||||
|
autoResize: true,
|
||||||
|
size: vxeSize,
|
||||||
|
loading: false,
|
||||||
|
align: 'center', // 自动监听父元素的变化去重新计算表格(对于父元素可能存在动态变化、显示隐藏的容器中、列宽异常等场景中的可能会用到)
|
||||||
|
// data: [] as Array<T>,
|
||||||
|
columns: opt.columns,
|
||||||
|
toolbarConfig: {
|
||||||
|
size: vxeSize,
|
||||||
|
slots: { buttons: 'toolbar_buttons', tools: 'toolbar_tools' },
|
||||||
|
refresh: {
|
||||||
|
code: 'query',
|
||||||
|
},
|
||||||
|
export: true,
|
||||||
|
print: true,
|
||||||
|
zoom: true,
|
||||||
|
custom: true,
|
||||||
|
},
|
||||||
|
checkboxConfig: { range: true },
|
||||||
|
sortConfig: { trigger: 'cell', remote: true },
|
||||||
|
exportConfig: {
|
||||||
|
remote: false, // 设置使用服务端导出
|
||||||
|
filename: `${opt.name}导出_${dayjs().format('YYMMDDHHmmss')}`,
|
||||||
|
},
|
||||||
|
pagerConfig: {
|
||||||
|
enabled: true,
|
||||||
|
size: vxeSize,
|
||||||
|
pageSize: 20,
|
||||||
|
}, // 分页
|
||||||
|
printConfig: { sheetName: '' },
|
||||||
|
proxyConfig: {
|
||||||
|
enabled: true,
|
||||||
|
autoLoad: false,
|
||||||
|
sort: true,
|
||||||
|
props: {
|
||||||
|
list: 'data.result', // 不分页时
|
||||||
|
result: 'data.result.items', // 分页时
|
||||||
|
total: 'data.result.total',
|
||||||
|
message: 'data.message',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
customConfig: {
|
||||||
|
storage: {
|
||||||
|
// 是否启用 localStorage 本地保存,会将列操作状态保留在本地(需要有 id)
|
||||||
|
visible: true, // 启用显示/隐藏列状态
|
||||||
|
resizable: true, // 启用列宽状态
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return extras ? merge(options, extras) : options;
|
||||||
|
};
|
||||||
@ -79,8 +79,9 @@ const onColumnsAsideMenuClick = async (v: RouteItem) => {
|
|||||||
if (route.path.startsWith(redirect)) mittBus.emit('setSendColumnsChildren', setSendChildren(redirect));
|
if (route.path.startsWith(redirect)) mittBus.emit('setSendColumnsChildren', setSendChildren(redirect));
|
||||||
else router.push(redirect);
|
else router.push(redirect);
|
||||||
} else {
|
} else {
|
||||||
if (!v.children) {
|
if (!v.children || v.children?.length === 0) {
|
||||||
router.push(path);
|
router.push(path);
|
||||||
|
onColumnsAsideDown(v.k);
|
||||||
} else {
|
} else {
|
||||||
// 显示子级菜单
|
// 显示子级菜单
|
||||||
const resData: MittMenu = setSendChildren(path);
|
const resData: MittMenu = setSendChildren(path);
|
||||||
@ -92,7 +93,7 @@ const onColumnsAsideMenuClick = async (v: RouteItem) => {
|
|||||||
|
|
||||||
// 一个路由设置自动收起菜单
|
// 一个路由设置自动收起菜单
|
||||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I6HW7H
|
// https://gitee.com/lyt-top/vue-next-admin/issues/I6HW7H
|
||||||
if (!v.children) themeConfig.value.isCollapse = true;
|
if (!v.children || v.children?.length === 0) themeConfig.value.isCollapse = true;
|
||||||
else if (v.children.length > 1) themeConfig.value.isCollapse = false;
|
else if (v.children.length > 1) themeConfig.value.isCollapse = false;
|
||||||
};
|
};
|
||||||
// 鼠标移入时,显示当前的子级菜单
|
// 鼠标移入时,显示当前的子级菜单
|
||||||
|
|||||||
@ -132,14 +132,16 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
|
|
||||||
// 根据字典类型和代码取字典项
|
// 根据字典类型和代码取字典项
|
||||||
getDictItemByCode(typePCode: string, val: string) {
|
getDictItemByCode(typePCode: string, val: string) {
|
||||||
val = val.toString();
|
if (val != undefined) {
|
||||||
if (val) {
|
val = val.toString();
|
||||||
const _val = val.toString();
|
if (val) {
|
||||||
const ds = this.getDictDatasByCode(typePCode);
|
const _val = val.toString();
|
||||||
for (let index = 0; index < ds.length; index++) {
|
const ds = this.getDictDatasByCode(typePCode);
|
||||||
const element = ds[index];
|
for (let index = 0; index < ds.length; index++) {
|
||||||
if (element.code == _val) {
|
const element = ds[index];
|
||||||
return element;
|
if (element.code == _val) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -376,13 +376,13 @@
|
|||||||
/* Table 表格 element plus 2.2.0 版本
|
/* Table 表格 element plus 2.2.0 版本
|
||||||
------------------------------- */
|
------------------------------- */
|
||||||
.el-table {
|
.el-table {
|
||||||
|
// 表头背景色
|
||||||
|
--el-table-header-bg-color: var(--next-bg-main-color);
|
||||||
|
|
||||||
.el-button.is-text {
|
.el-button.is-text {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表头背景色
|
|
||||||
--el-table-header-bg-color: var(--next-bg-main-color);
|
|
||||||
|
|
||||||
// 表头字体颜色
|
// 表头字体颜色
|
||||||
thead {
|
thead {
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
|
|||||||
@ -36,10 +36,11 @@
|
|||||||
.vxe-cell {
|
.vxe-cell {
|
||||||
padding-left: 5px !important;
|
padding-left: 5px !important;
|
||||||
padding-right: 5px !important;
|
padding-right: 5px !important;
|
||||||
|
user-select: text !important;
|
||||||
|
|
||||||
.el-button {
|
.el-button {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
user-select: text !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-pager.size--mini {
|
.vxe-pager.size--mini {
|
||||||
|
|||||||
@ -5,8 +5,8 @@
|
|||||||
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Postcard /> </el-icon>简介(About)
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Postcard /> </el-icon>简介(About)
|
||||||
</h4>
|
</h4>
|
||||||
<span class="text">
|
<span class="text">
|
||||||
基于 .NET6 (Furion/SqlSugar) 实现的通用权限开发框架,前端采用
|
🔥基于 .NET 6/8 (Furion/SqlSugar) 实现的通用权限开发框架,前端采用
|
||||||
Vue3+Element-plus+Vite5,整合众多优秀技术和框架,模块插件式开发。集成多租户、缓存、数据校验、鉴权、事件总线、动态API、通讯、远程请求、任务调度、打印等众多黑科技。代码结构简单清晰,注释详尽,易于上手与二次开发,即便是复杂业务逻辑也能迅速实现,真正实现“开箱即用”。
|
Vue3/Element-plus,代码简洁、易扩展。整合最新技术,模块插件式开发,前后端分离,开箱即用。集成多租户、缓存、数据校验、鉴权、事件总线、动态API、通讯、远程请求、任务调度、打印等众多黑科技。让开发更简单、更通用、更流行!
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -283,6 +283,8 @@ defineExpose({ saveTokenAndInitRoutes });
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.dialog-header {
|
.dialog-header {
|
||||||
:deep(.el-dialog) {
|
:deep(.el-dialog) {
|
||||||
|
width: unset !important;
|
||||||
|
|
||||||
.el-dialog__header {
|
.el-dialog__header {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -294,8 +296,6 @@ defineExpose({ saveTokenAndInitRoutes });
|
|||||||
.v-modal {
|
.v-modal {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
width: unset !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
Web/src/views/system/cache/index.vue
vendored
4
Web/src/views/system/cache/index.vue
vendored
@ -61,7 +61,7 @@ const state = reactive({
|
|||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询操作
|
||||||
@ -109,7 +109,7 @@ const delCache = () => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysCacheApi).apiSysCacheDeleteKeyPost(currentNode.value.id);
|
await getAPI(SysCacheApi).apiSysCacheDeleteKeyPost(currentNode.value.id);
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
state.cacheValue = undefined;
|
state.cacheValue = undefined;
|
||||||
state.cacheKey = undefined;
|
state.cacheKey = undefined;
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
|
|||||||
@ -54,6 +54,14 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="生成表" prop="tableName" :rules="[{ required: true, message: '生成表不能为空', trigger: 'blur' }]">
|
<el-form-item label="生成表" prop="tableName" :rules="[{ required: true, message: '生成表不能为空', trigger: 'blur' }]">
|
||||||
|
<template v-slot:label>
|
||||||
|
<div>
|
||||||
|
生成表
|
||||||
|
<el-tooltip raw-content content="如果是刚刚在前端生成的实体,请重启后台服务后再进行代码生成。" placement="top">
|
||||||
|
<SvgIcon name="fa fa-question-circle-o" :size="16" style="vertical-align: middle" />
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<el-select v-model="state.ruleForm.tableName" @change="tableChanged" value-key="value" filterable clearable class="w100">
|
<el-select v-model="state.ruleForm.tableName" @change="tableChanged" value-key="value" filterable clearable class="w100">
|
||||||
<el-option v-for="item in state.tableData" :key="item.entityName" :label="item.entityName + ' ( ' + item.tableName + ' ) [' + item.tableComment + ']'" :value="item" />
|
<el-option v-for="item in state.tableData" :key="item.entityName" :label="item.entityName + ' ( ' + item.tableName + ' ) [' + item.tableComment + ']'" :value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -121,6 +129,14 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
|
<el-form-item label="接口模式" prop="isApiService">
|
||||||
|
<el-radio-group v-model="state.ruleForm.isApiService">
|
||||||
|
<el-radio :value="true">使用API Service</el-radio>
|
||||||
|
<el-radio :value="false">不使用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="支持打印" prop="printType">
|
<el-form-item label="支持打印" prop="printType">
|
||||||
<el-select v-model="state.ruleForm.printType" filterable class="w100" @change="printTypeChanged">
|
<el-select v-model="state.ruleForm.printType" filterable class="w100" @change="printTypeChanged">
|
||||||
|
|||||||
@ -109,6 +109,7 @@ const state = reactive({
|
|||||||
allEnumSelector: [] as any,
|
allEnumSelector: [] as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
var res = await getAPI(SysDictDataApi).apiSysDictDataDataListCodeGet('code_gen_effect_type');
|
var res = await getAPI(SysDictDataApi).apiSysDictDataDataListCodeGet('code_gen_effect_type');
|
||||||
state.effectTypeList = res.data.result;
|
state.effectTypeList = res.data.result;
|
||||||
@ -140,6 +141,7 @@ onUnmounted(() => {
|
|||||||
mittBus.off('submitRefresh', () => {});
|
mittBus.off('submitRefresh', () => {});
|
||||||
mittBus.off('submitRefreshFk', () => {});
|
mittBus.off('submitRefreshFk', () => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 控件类型改变
|
// 控件类型改变
|
||||||
const effectTypeChange = (data: any, index: number) => {
|
const effectTypeChange = (data: any, index: number) => {
|
||||||
let value = data.effectType;
|
let value = data.effectType;
|
||||||
@ -190,8 +192,8 @@ function effectTypeEnable(data: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const openDialog = (addRow: any) => {
|
const openDialog = async (addRow: any) => {
|
||||||
handleQuery(addRow);
|
await handleQuery(addRow);
|
||||||
state.isShowDialog = true;
|
state.isShowDialog = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="业务名" prop="busName">
|
<el-form-item label="业务名" prop="busName">
|
||||||
<el-input placeholder="业务名" clearable @keyup.enter="handleQuery" v-model="state.queryParams.busName" @keyup.enter.native="handleQuery(true)" />
|
<el-input placeholder="业务名" clearable @keyup.enter="handleQuery" v-model="state.queryParams.busName" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="数据库表名" prop="tableName">
|
<el-form-item label="数据库表名" prop="tableName">
|
||||||
<el-input placeholder="数据库表名" clearable @keyup.enter="handleQuery" v-model="state.queryParams.tableName" @keyup.enter.native="handleQuery(true)" />
|
<el-input placeholder="数据库表名" clearable @keyup.enter="handleQuery" v-model="state.queryParams.tableName" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -62,15 +62,6 @@
|
|||||||
<el-button icon="ele-Cpu" text type="primary" @click="handleGenerate(row)">生成</el-button>
|
<el-button icon="ele-Cpu" text type="primary" @click="handleGenerate(row)">生成</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -84,8 +75,9 @@
|
|||||||
import { onMounted, reactive, ref, defineAsyncComponent } from 'vue';
|
import { onMounted, reactive, ref, defineAsyncComponent } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
import { downloadByUrl } from '/@/utils/download';
|
import { downloadByUrl } from '/@/utils/download';
|
||||||
|
|
||||||
import EditCodeGenDialog from './component/editCodeGenDialog.vue';
|
import EditCodeGenDialog from './component/editCodeGenDialog.vue';
|
||||||
@ -93,7 +85,7 @@ import CodeConfigDialog from './component/genConfigDialog.vue';
|
|||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysCodeGenApi } from '/@/api-services/api';
|
import { SysCodeGenApi } from '/@/api-services/api';
|
||||||
import { SysCodeGen } from '/@/api-services/models';
|
import { SysCodeGen, PageCodeGenInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const PreviewDialog = defineAsyncComponent(() => import('./component/previewDialog.vue'));
|
const PreviewDialog = defineAsyncComponent(() => import('./component/previewDialog.vue'));
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
@ -110,90 +102,78 @@ const state = reactive({
|
|||||||
tableName: undefined,
|
tableName: undefined,
|
||||||
busName: undefined,
|
busName: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'id', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
applicationNamespaces: [] as Array<string>,
|
applicationNamespaces: [] as Array<string>,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysCodeGen';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysCodeGen>({
|
const options = useVxeTable<SysCodeGen>(
|
||||||
id: 'sysCodeGen',
|
{
|
||||||
name: '代码生成',
|
id: 'sysCodeGen',
|
||||||
columns: [
|
name: '代码生成',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'configId', title: '库定位器', minWidth: 200, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'tableName', title: '表名称', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'configId', title: '库定位器', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'busName', title: '业务名', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'tableName', title: '表名称', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'nameSpace', title: '命名空间', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'busName', title: '业务名', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'authorName', title: '作者姓名', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'nameSpace', title: '命名空间', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'generateType', title: '生成方式', minWidth: 140, showOverflow: 'tooltip', slots: { default: 'row_generateType' } },
|
{ field: 'authorName', title: '作者姓名', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 280, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: 'generateType', title: '生成方式', minWidth: 140, showOverflow: 'tooltip', slots: { default: 'row_generateType' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 280, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysCodeGen:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
|
|
||||||
|
// 获取命名空间集合
|
||||||
let res = await getAPI(SysCodeGenApi).apiSysCodeGenApplicationNamespacesGet();
|
let res = await getAPI(SysCodeGenApi).apiSysCodeGenApplicationNamespacesGet();
|
||||||
state.applicationNamespaces = res.data.result as Array<string>;
|
state.applicationNamespaces = res.data.result as Array<string>;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageCodeGenInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysCodeGenApi).apiSysCodeGenPagePost(params);
|
return getAPI(SysCodeGenApi).apiSysCodeGenPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.busName = undefined;
|
state.queryParams.busName = undefined;
|
||||||
state.queryParams.tableName = undefined;
|
state.queryParams.tableName = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
const handleConfig = (row: any) => {
|
|
||||||
CodeConfigRef.value?.openDialog(row);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
state.title = '增加';
|
state.title = '增加代码生成';
|
||||||
EditCodeGenRef.value?.openDialog({
|
EditCodeGenRef.value?.openDialog({
|
||||||
authorName: 'Admin.NET',
|
authorName: 'Admin.NET',
|
||||||
generateType: '200',
|
generateType: '200',
|
||||||
@ -207,7 +187,7 @@ const handleAdd = () => {
|
|||||||
|
|
||||||
// 打开编辑页面
|
// 打开编辑页面
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
state.title = '编辑';
|
state.title = '编辑代码生成';
|
||||||
EditCodeGenRef.value?.openDialog(row);
|
EditCodeGenRef.value?.openDialog(row);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -220,12 +200,31 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysCodeGenApi).apiSysCodeGenDeletePost([{ id: row.id }]);
|
await getAPI(SysCodeGenApi).apiSysCodeGenDeletePost([{ id: row.id }]);
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
ElMessage.success('操作成功');
|
ElMessage.success('操作成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysCodeGen> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// 打开配置
|
||||||
|
const handleConfig = (row: any) => {
|
||||||
|
CodeConfigRef.value?.openDialog(row);
|
||||||
|
};
|
||||||
|
|
||||||
// 开始生成代码
|
// 开始生成代码
|
||||||
const handleGenerate = (row: any) => {
|
const handleGenerate = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定要生成吗?`, '提示', {
|
ElMessageBox.confirm(`确定要生成吗?`, '提示', {
|
||||||
@ -236,7 +235,7 @@ const handleGenerate = (row: any) => {
|
|||||||
.then(async () => {
|
.then(async () => {
|
||||||
var res = await getAPI(SysCodeGenApi).apiSysCodeGenRunLocalPost(row);
|
var res = await getAPI(SysCodeGenApi).apiSysCodeGenRunLocalPost(row);
|
||||||
if (res.data.result != null && res.data.result.url != null) downloadByUrl({ url: res.data.result.url });
|
if (res.data.result != null && res.data.result.url != null) downloadByUrl({ url: res.data.result.url });
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
ElMessage.success('操作成功');
|
ElMessage.success('操作成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="配置名称" prop="name">
|
<el-form-item label="配置名称" prop="name">
|
||||||
<el-input v-model="state.queryParams.name" placeholder="配置名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.name" placeholder="配置名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="配置编码" prop="code">
|
<el-form-item label="配置编码" prop="code">
|
||||||
<el-input v-model="state.queryParams.code" placeholder="配置编码" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.code" placeholder="配置编码" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysConfig:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysConfig:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange" @checkbox-all="handleSelectChange" @checkbox-change="handleSelectChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysConfig:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysConfig:add'"> 新增 </el-button>
|
||||||
<!-- <el-button v-if="state.selectList.length > 0" type="danger" icon="ele-Delete" @click="handleBacthDelete" > 批量删除 </el-button> -->
|
<!-- <el-button v-if="state.selectList.length > 0" type="danger" icon="ele-Delete" @click="handleBacthDelete" > 批量删除 </el-button> -->
|
||||||
@ -60,15 +60,6 @@
|
|||||||
<el-button icon="ele-Delete" text type="danger" v-auth="'sysConfig:delete'" :disabled="row.sysFlag === 1" @click="handleDelete(row)"> </el-button>
|
<el-button icon="ele-Delete" text type="danger" v-auth="'sysConfig:delete'" :disabled="row.sysFlag === 1" @click="handleDelete(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -79,16 +70,16 @@
|
|||||||
<script lang="ts" setup name="sysConfig">
|
<script lang="ts" setup name="sysConfig">
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditConfig from '/@/views/system/config/component/editConfig.vue';
|
import EditConfig from '/@/views/system/config/component/editConfig.vue';
|
||||||
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysConfigApi } from '/@/api-services/api';
|
import { SysConfigApi } from '/@/api-services/api';
|
||||||
import { SysConfig } from '/@/api-services/models';
|
import { SysConfig, PageConfigInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editConfigRef = ref<InstanceType<typeof EditConfig>>();
|
const editConfigRef = ref<InstanceType<typeof EditConfig>>();
|
||||||
@ -98,13 +89,9 @@ const state = reactive({
|
|||||||
code: undefined,
|
code: undefined,
|
||||||
groupCode: undefined,
|
groupCode: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'orderNo', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
@ -112,76 +99,65 @@ const state = reactive({
|
|||||||
selectList: [] as SysConfig[],
|
selectList: [] as SysConfig[],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysConfig';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysConfig>({
|
const options = useVxeTable<SysConfig>(
|
||||||
id: 'sysConfig',
|
{
|
||||||
name: '参数配置',
|
id: 'sysConfig',
|
||||||
columns: [
|
name: '参数配置',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'name', title: '配置名称', minWidth: 200, showOverflow: 'tooltip', sortable: true },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'code', title: '配置编码', minWidth: 200, showOverflow: 'tooltip', sortable: true },
|
{ field: 'name', title: '配置名称', minWidth: 200, showOverflow: 'tooltip', sortable: true },
|
||||||
{ field: 'value', title: '属性值', minWidth: 150, showOverflow: 'tooltip', sortable: true },
|
{ field: 'code', title: '配置编码', minWidth: 200, showOverflow: 'tooltip', sortable: true },
|
||||||
{ field: 'sysFlag', title: '内置参数', width: 80, showOverflow: 'tooltip', sortable: true, slots: { default: 'row_sysFlag' } },
|
{ field: 'value', title: '属性值', minWidth: 150, showOverflow: 'tooltip', sortable: true },
|
||||||
{ field: 'groupCode', title: '分组编码', minWidth: 120, showOverflow: 'tooltip', sortable: true },
|
{ field: 'sysFlag', title: '内置参数', width: 80, showOverflow: 'tooltip', sortable: true, slots: { default: 'row_sysFlag' } },
|
||||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip', sortable: true },
|
{ field: 'groupCode', title: '分组编码', minWidth: 120, showOverflow: 'tooltip', sortable: true },
|
||||||
{ field: 'remark', title: '备注', minWidth: 300, showOverflow: 'tooltip', sortable: true },
|
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip', sortable: true },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'remark', title: '备注', minWidth: 300, showOverflow: 'tooltip', sortable: true },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysConfig:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await handleQuery();
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
fetchGroupData();
|
await fetchGroupData();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageConfigInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
state.selectList = [];
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysConfigApi).apiSysConfigPagePost(params);
|
return getAPI(SysConfigApi).apiSysConfigPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchGroupData = async () => {
|
// 查询操作
|
||||||
const res = await getAPI(SysConfigApi).apiSysConfigGroupListGet();
|
const handleQuery = async () => {
|
||||||
state.groupList = res.data.result ?? [];
|
// 调用vxe-grid的commitProxy(query)方法,触发表格重新加载数据
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.code = undefined;
|
state.queryParams.code = undefined;
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
state.queryParams.groupCode = undefined;
|
state.queryParams.groupCode = undefined;
|
||||||
handleQuery(true);
|
// 调用vxe-grid的commitProxy(reload)方法,触发表格重新加载数据
|
||||||
};
|
await xGrid.value?.commitProxy('reload');
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -196,12 +172,6 @@ const handleEdit = (row: any) => {
|
|||||||
editConfigRef.value?.openDialog(row);
|
editConfigRef.value?.openDialog(row);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更新数据
|
|
||||||
const updateData = async () => {
|
|
||||||
await handleQuery();
|
|
||||||
fetchGroupData();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const handleDelete = (row: any) => {
|
const handleDelete = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定删除配置:【${row.name}】?`, '提示', {
|
ElMessageBox.confirm(`确定删除配置:【${row.name}】?`, '提示', {
|
||||||
@ -217,24 +187,46 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelectChange = () => {
|
// 表格事件
|
||||||
state.selectList = xGrid.value?.getCheckboxRecords() ?? [];
|
const gridEvents: VxeGridListeners<SysConfig> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 批量删除
|
// 获取分组
|
||||||
const handleBacthDelete = () => {
|
const fetchGroupData = async () => {
|
||||||
if (state.selectList.length == 0) return false;
|
const res = await getAPI(SysConfigApi).apiSysConfigGroupListGet();
|
||||||
ElMessageBox.confirm(`确定批量删除【${state.selectList[0].name}】等${state.selectList.length}个配置?`, '提示', {
|
state.groupList = res.data.result ?? [];
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const ids = state.selectList.map((item: any) => item.id);
|
|
||||||
var res = await getAPI(SysConfigApi).apiSysConfigBatchDeletePost(ids);
|
|
||||||
handleQuery();
|
|
||||||
ElMessage.success('删除成功');
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 更新数据
|
||||||
|
const updateData = async () => {
|
||||||
|
await handleQuery();
|
||||||
|
fetchGroupData();
|
||||||
|
};
|
||||||
|
|
||||||
|
// // 批量删除
|
||||||
|
// const handleBacthDelete = () => {
|
||||||
|
// if (state.selectList.length == 0) return false;
|
||||||
|
// ElMessageBox.confirm(`确定批量删除【${state.selectList[0].name}】等${state.selectList.length}个配置?`, '提示', {
|
||||||
|
// confirmButtonText: '确定',
|
||||||
|
// cancelButtonText: '取消',
|
||||||
|
// type: 'warning',
|
||||||
|
// })
|
||||||
|
// .then(async () => {
|
||||||
|
// const ids = state.selectList.map((item: any) => item.id);
|
||||||
|
// var res = await getAPI(SysConfigApi).apiSysConfigBatchDeletePost(ids);
|
||||||
|
// handleQuery();
|
||||||
|
// ElMessage.success('删除成功');
|
||||||
|
// })
|
||||||
|
// .catch(() => {});
|
||||||
|
// };
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<el-button-group style="padding-left: 12px; padding-right: 12px">
|
<el-button-group style="padding-left: 12px; padding-right: 12px">
|
||||||
<el-button icon="ele-Plus" @click="showAddColumn"> 增加列 </el-button>
|
<el-button icon="ele-Plus" @click="showAddColumn"> 增加列 </el-button>
|
||||||
<el-button icon="ele-Plus" @click="showGenDialog"> 生成实体 </el-button>
|
<el-button icon="ele-Plus" @click="showGenDialog"> 生成实体 </el-button>
|
||||||
<el-popover placement="bottom" title="温馨提示" :width="200" trigger="hover" content="如果是刚刚生成的实体,请重启服务后再生成种子">
|
<el-popover placement="bottom" title="🔔提示" :width="220" trigger="hover" content="如果是刚刚生成的实体,请重启后台服务后再生成种子。">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button icon="ele-Plus" @click="showGenSeedDataDialog"> 生成种子 </el-button>
|
<el-button icon="ele-Plus" @click="showGenSeedDataDialog"> 生成种子 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -81,7 +81,7 @@ import { onMounted, reactive, ref } from 'vue';
|
|||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { VxeGridInstance } from 'vxe-table';
|
import { VxeGridInstance } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
|
||||||
import EditTable from '/@/views/system/database/component/editTable.vue';
|
import EditTable from '/@/views/system/database/component/editTable.vue';
|
||||||
import EditColumn from '/@/views/system/database/component/editColumn.vue';
|
import EditColumn from '/@/views/system/database/component/editColumn.vue';
|
||||||
@ -118,54 +118,58 @@ const state = reactive({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<DbColumnOutput>({
|
const options = useVxeTable<DbColumnOutput>(
|
||||||
id: 'sysDatabase',
|
{
|
||||||
name: '库表信息',
|
id: 'sysDatabase',
|
||||||
columns: [
|
name: '库表信息',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 50, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'dbColumnName', title: '字段名', minWidth: 200, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 50, fixed: 'left' },
|
||||||
{ field: 'dataType', title: '数据类型', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'dbColumnName', title: '字段名', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'isPrimarykey', title: '主键', minWidth: 70, slots: { default: 'row_isPrimarykey' } },
|
{ field: 'dataType', title: '数据类型', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'isIdentity', title: '自增', minWidth: 70, slots: { default: 'row_isIdentity' } },
|
{ field: 'isPrimarykey', title: '主键', minWidth: 70, slots: { default: 'row_isPrimarykey' } },
|
||||||
{ field: 'isNullable', title: '可空', minWidth: 70, slots: { default: 'row_isNullable' } },
|
{ field: 'isIdentity', title: '自增', minWidth: 70, slots: { default: 'row_isIdentity' } },
|
||||||
{ field: 'length', title: '长度', minWidth: 80, showOverflow: 'tooltip' },
|
{ field: 'isNullable', title: '可空', minWidth: 70, slots: { default: 'row_isNullable' } },
|
||||||
{ field: 'decimalDigits', title: '精度', minWidth: 80, showOverflow: 'tooltip' },
|
{ field: 'length', title: '长度', minWidth: 80, showOverflow: 'tooltip' },
|
||||||
{ field: 'defaultValue', title: '默认值', minWidth: 80, showOverflow: 'tooltip' },
|
{ field: 'decimalDigits', title: '精度', minWidth: 80, showOverflow: 'tooltip' },
|
||||||
{ field: 'columnDescription', title: '描述', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'defaultValue', title: '默认值', minWidth: 80, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: 'columnDescription', title: '描述', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: true,
|
],
|
||||||
searchCallback: () => handleQueryColumn(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: () => handleQueryColumnApi() } },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { enabled: false },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: true },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
options.loading = true;
|
options.loading = true;
|
||||||
var res = await getAPI(SysDatabaseApi).apiSysDatabaseListGet();
|
let res = await getAPI(SysDatabaseApi).apiSysDatabaseListGet();
|
||||||
state.dbData = res.data.result;
|
state.dbData = res.data.result;
|
||||||
options.loading = false;
|
|
||||||
let appNamesRes = await getAPI(SysCodeGenApi).apiSysCodeGenApplicationNamespacesGet();
|
let appNamesRes = await getAPI(SysCodeGenApi).apiSysCodeGenApplicationNamespacesGet();
|
||||||
state.appNamespaces = appNamesRes.data.result as Array<string>;
|
state.appNamespaces = appNamesRes.data.result as Array<string>;
|
||||||
|
options.loading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询列api
|
||||||
const handleQueryColumn = async () => {
|
const handleQueryColumnApi = async () => {
|
||||||
if (state.tableName == '' || typeof state.tableName == 'undefined') {
|
if (state.tableName == '' || typeof state.tableName == 'undefined') {
|
||||||
await xGrid.value?.loadData([]);
|
|
||||||
options.loading = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
options.loading = true;
|
return getAPI(SysDatabaseApi).apiSysDatabaseColumnListTableNameConfigIdGet(state.tableName, state.configId);
|
||||||
var res = await fetchData();
|
|
||||||
await xGrid.value?.loadData(res.data.result ?? []);
|
|
||||||
options.loading = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取数据
|
// 查询列操作
|
||||||
const fetchData = async (tableParams?: any) => {
|
const handleQueryColumn = async () => {
|
||||||
return getAPI(SysDatabaseApi).apiSysDatabaseColumnListTableNameConfigIdGet(state.tableName, state.configId);
|
await xGrid.value?.commitProxy('query');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 增加表
|
// 增加表
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sys-dictData-container">
|
<div class="sys-dictData-container">
|
||||||
<el-dialog v-model="state.visible" draggable overflow destroy-on-close width="700px">
|
<el-dialog v-model="state.visible" draggable :close-on-click-modal="false" width="700px">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="color: #fff">
|
<div style="color: #fff">
|
||||||
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="名称" prop="name" :rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]">
|
<el-form-item label="名称">
|
||||||
<el-input v-model="state.ruleForm.name" placeholder="名称" clearable />
|
<el-input v-model="state.ruleForm.name" placeholder="名称" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sys-dictType-container">
|
<div class="sys-dictType-container">
|
||||||
<el-dialog v-model="state.visible" draggable overflow destroy-on-close width="700px">
|
<el-dialog v-model="state.visible" draggable :close-on-click-modal="false" width="700px">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="color: #fff">
|
<div style="color: #fff">
|
||||||
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sys-dict-container" v-loading="options.loading">
|
<div class="sys-dict-container" v-loading="optionsDictType.loading">
|
||||||
<el-row :gutter="8" style="width: 100%; height: 100%; flex: 1">
|
<el-row :gutter="8" style="width: 100%; height: 100%; flex: 1">
|
||||||
<el-col :span="12" :xs="24" class="full-height">
|
<el-col :span="12" :xs="24" class="full-height">
|
||||||
<el-card shadow="hover" :body-style="{ padding: '5px 5px 0 5px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
<el-card shadow="hover" :body-style="{ padding: '5px 5px 0 5px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||||
<el-form :model="state.queryParams" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
|
<el-form :model="state.queryParamsDictType" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
||||||
<el-form-item label="字典名称" prop="name">
|
<el-form-item label="字典名称" prop="name">
|
||||||
<el-input v-model="state.queryParams.name" placeholder="字典名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParamsDictType.name" placeholder="字典名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
||||||
<el-form-item label="字典编码" prop="code">
|
<el-form-item label="字典编码" prop="code">
|
||||||
<el-input v-model="state.queryParams.code" placeholder="字典编码" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParamsDictType.code" placeholder="字典编码" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -21,15 +21,15 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysDictType:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysDictType:page'" :loading="optionsDictType.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="optionsDictType.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange" @cell-click="handleDictData">
|
<vxe-grid ref="xGridDictType" class="xGrid-style" v-bind="optionsDictType" v-on="gridEventsDictType" @cell-click="handleDictData">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-icon size="16" style="margin-right: 3px; margin-top: 2px; display: inline; vertical-align: middle"><ele-Collection /></el-icon>字典
|
<el-icon size="16" style="margin-right: 3px; margin-top: 2px; display: inline; vertical-align: middle"><ele-Collection /></el-icon>字典
|
||||||
<el-button type="primary" style="margin-left: 10px" icon="ele-Plus" @click="handleAdd" v-auth="'sysDictType:add'"> 新增 </el-button>
|
<el-button type="primary" style="margin-left: 10px" icon="ele-Plus" @click="handleAdd" v-auth="'sysDictType:add'"> 新增 </el-button>
|
||||||
@ -50,34 +50,25 @@
|
|||||||
<el-button icon="ele-Edit" text type="primary" v-auth="'sysDictType:update'" @click="handleEdit(row)"> </el-button>
|
<el-button icon="ele-Edit" text type="primary" v-auth="'sysDictType:update'" @click="handleEdit(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button icon="ele-Delete" text type="danger" v-auth="'sysDictType:delete'" @click="handleDelete(row)"> </el-button>
|
<el-button icon="ele-Delete" text type="danger" v-auth="'sysDictType:delete'" @click="handleDeleteDictType(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12" :xs="24" class="full-height">
|
<el-col :span="12" :xs="24" class="full-height">
|
||||||
<el-card shadow="hover" :body-style="{ padding: '5px 5px 0 5px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
<el-card shadow="hover" :body-style="{ padding: '5px 5px 0 5px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||||
<el-form :model="state.queryDictParams" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
|
<el-form :model="state.queryParamsDictData" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
||||||
<el-form-item label="字典值" prop="value">
|
<el-form-item label="字典值" prop="value">
|
||||||
<el-input v-model="state.queryDictParams.value" placeholder="字典值" clearable @keyup.enter.native="handleDictQuery(true)" />
|
<el-input v-model="state.queryParamsDictData.value" placeholder="字典值" clearable @keyup.enter.native="handleQueryDictData" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
||||||
<el-form-item label="编码" prop="code">
|
<el-form-item label="编码" prop="code">
|
||||||
<el-input v-model="state.queryDictParams.code" placeholder="编码" clearable @keyup.enter.native="handleDictQuery(true)" />
|
<el-input v-model="state.queryParamsDictData.code" placeholder="编码" clearable @keyup.enter.native="handleQueryDictData" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -86,18 +77,18 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleDictQuery(true)" v-auth="'sysDictType:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQueryDictData" v-auth="'sysDictType:page'" :loading="optionsDictData.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetDictQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQueryDictData" :loading="optionsDictData.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xDictGrid" class="xGrid-style" v-bind="dictOptions" @sort-change="dictSortChange">
|
<vxe-grid ref="xGridDictData" class="xGrid-style" v-bind="optionsDictData" v-on="gridEventsDictData">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-icon size="16" style="margin-right: 3px; margin-top: 2px; display: inline; vertical-align: middle"><ele-Collection /></el-icon>字典值
|
<el-icon size="16" style="margin-right: 3px; margin-top: 2px; display: inline; vertical-align: middle"><ele-Collection /></el-icon>字典值
|
||||||
<el-button type="primary" style="margin-left: 10px" icon="ele-Plus" @click="handleDictAdd" v-auth="'sysDictType:add'"> 新增 </el-button>
|
<el-button type="primary" style="margin-left: 10px" icon="ele-Plus" @click="handleAddDictData" v-auth="'sysDictType:add'"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar_tools> </template>
|
<template #toolbar_tools> </template>
|
||||||
<template #empty>
|
<template #empty>
|
||||||
@ -119,28 +110,19 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #row_buttons="{ row }">
|
<template #row_buttons="{ row }">
|
||||||
<el-tooltip content="编辑" placement="top">
|
<el-tooltip content="编辑" placement="top">
|
||||||
<el-button icon="ele-Edit" text type="primary" v-auth="'sysDictType:update'" @click="handleDictEdit(row)"> </el-button>
|
<el-button icon="ele-Edit" text type="primary" v-auth="'sysDictType:update'" @click="handleEditDictData(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button icon="ele-Delete" text type="danger" v-auth="'sysDictType:delete'" @click="handleDictDelete(row)"> </el-button>
|
<el-button icon="ele-Delete" text type="danger" v-auth="'sysDictType:delete'" @click="handleDeleteDictData(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="dictOptions.loading"
|
|
||||||
v-model:current-page="state.tableDictParams.page"
|
|
||||||
v-model:page-size="state.tableDictParams.pageSize"
|
|
||||||
:total="state.tableDictParams.total"
|
|
||||||
@page-change="dictPageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<EditDictType ref="editRef" :title="state.title" @handleQuery="handleQuery(false)" @handleUpdate="updateDictSession" />
|
<EditDictType ref="editRefDictType" :title="state.title" @handleQuery="handleQuery" @handleUpdate="updateDictSession" />
|
||||||
<EditDcitData ref="editDictRef" :title="state.title" @handleQuery="handleDictQuery(false)" @handleUpdate="updateDictSession" />
|
<EditDcitData ref="editRefDictData" :title="state.title" @handleQuery="handleQueryDictData" @handleUpdate="updateDictSession" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -148,8 +130,9 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
import { useUserInfo } from '/@/stores/userInfo';
|
import { useUserInfo } from '/@/stores/userInfo';
|
||||||
|
|
||||||
import EditDictType from '/@/views/system/dict/component/editDictType.vue';
|
import EditDictType from '/@/views/system/dict/component/editDictType.vue';
|
||||||
@ -158,45 +141,39 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
|||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysDictTypeApi, SysDictDataApi } from '/@/api-services/api';
|
import { SysDictTypeApi, SysDictDataApi } from '/@/api-services/api';
|
||||||
import { SysDictType, SysDictData } from '/@/api-services/models';
|
import { SysDictType, PageDictTypeInput, SysDictData, PageDictDataInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGridDictType = ref<VxeGridInstance>();
|
||||||
const xDictGrid = ref<VxeGridInstance>();
|
const xGridDictData = ref<VxeGridInstance>();
|
||||||
const editRef = ref<InstanceType<typeof EditDictType>>();
|
const editRefDictType = ref<InstanceType<typeof EditDictType>>();
|
||||||
const editDictRef = ref<InstanceType<typeof EditDcitData>>();
|
const editRefDictData = ref<InstanceType<typeof EditDcitData>>();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
queryParams: {
|
queryParamsDictType: {
|
||||||
name: undefined,
|
name: undefined,
|
||||||
code: undefined,
|
code: undefined,
|
||||||
},
|
},
|
||||||
queryDictParams: {
|
queryParamsDictData: {
|
||||||
dictTypeId: undefined,
|
dictTypeId: undefined,
|
||||||
value: undefined,
|
value: undefined,
|
||||||
code: undefined,
|
code: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParamDictType: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'orderNo', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
tableDictParams: {
|
localPageParamDictData: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'orderNo', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysDictType';
|
||||||
// 表格参数配置-字典类型
|
// 表格参数配置-字典类型
|
||||||
const options = useVxeTable<SysDictType>(
|
const optionsDictType = useVxeTable<SysDictType>(
|
||||||
{
|
{
|
||||||
id: 'sysDict',
|
id: 'sysDictType',
|
||||||
name: '字典信息',
|
name: '字典信息',
|
||||||
columns: [
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
@ -207,75 +184,67 @@ const options = useVxeTable<SysDictType>(
|
|||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
],
|
],
|
||||||
enableExport: auth('sysDictType:export'),
|
|
||||||
searchCallback: () => handleQuery(),
|
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
|
||||||
},
|
},
|
||||||
{ rowConfig: { isCurrent: true, isHover: true }, checkboxConfig: { range: true, highlight: false } }
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParamDictType.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParamDictType.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
// 行配置
|
||||||
|
rowConfig: { isCurrent: true, isHover: true },
|
||||||
|
checkboxConfig: { range: true, highlight: false },
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParamDictType = Local.get(localPageParamKey) || state.localPageParamDictType;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParamsDictType, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageDictTypeInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
return getAPI(SysDictTypeApi).apiSysDictTypePagePost(params);
|
||||||
var res = await fetchData(null);
|
|
||||||
await xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取数据
|
// 查询操作
|
||||||
const fetchData = async (tableParams: any) => {
|
const handleQuery = async () => {
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
await xGridDictType.value?.commitProxy('query');
|
||||||
return getAPI(SysDictTypeApi).apiSysDictTypePagePost(params);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = async () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.code = undefined;
|
state.queryParamsDictType.code = undefined;
|
||||||
state.queryParams.name = undefined;
|
state.queryParamsDictType.name = undefined;
|
||||||
await handleQuery(true);
|
await xGridDictType.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = async ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
await handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = async (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
await handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
state.title = '添加字典';
|
state.title = '添加字典';
|
||||||
editRef.value?.openDialog({ status: 1, orderNo: 100 });
|
editRefDictType.value?.openDialog({ status: 1, orderNo: 100 });
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开编辑页面
|
// 打开编辑页面
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
state.title = '编辑字典';
|
state.title = '编辑字典';
|
||||||
editRef.value?.openDialog(row);
|
editRefDictType.value?.openDialog(row);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 点击表格,加载字典值表格数据
|
// 点击字典类型,加载其字典值数据
|
||||||
const handleDictData = async (scope: any) => {
|
const handleDictData = async (scope: any) => {
|
||||||
state.queryDictParams.dictTypeId = scope.row.id;
|
state.queryParamsDictData.dictTypeId = scope.row.id;
|
||||||
await handleDictQuery(true);
|
await handleQueryDictData();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除
|
// 删除字典
|
||||||
const handleDelete = (row: any) => {
|
const handleDeleteDictType = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定删除字典:【${row.name}】?`, '提示', {
|
ElMessageBox.confirm(`确定删除字典:【${row.name}】?`, '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@ -283,19 +252,32 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysDictTypeApi).apiSysDictTypeDeletePost({ id: row.id });
|
await getAPI(SysDictTypeApi).apiSysDictTypeDeletePost({ id: row.id });
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
updateDictSession();
|
await updateDictSession();
|
||||||
xDictGrid.value?.loadData([]);
|
xGridDictData.value?.loadData([]);
|
||||||
state.tableDictParams.total = 0;
|
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEventsDictType: VxeGridListeners<SysDictType> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParamDictType.pageSize = pageSize;
|
||||||
|
// Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParamDictType.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
// Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 表格参数配置-字典值
|
// 表格参数配置-字典值
|
||||||
const dictOptions = useVxeTable<SysDictData>(
|
const optionsDictData = useVxeTable<SysDictData>(
|
||||||
{
|
{
|
||||||
id: 'dictInfo',
|
id: 'sysDictData',
|
||||||
name: '字典值信息',
|
name: '字典值信息',
|
||||||
columns: [
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
@ -308,53 +290,62 @@ const dictOptions = useVxeTable<SysDictData>(
|
|||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
],
|
],
|
||||||
enableExport: auth('sysDictType:export'),
|
|
||||||
searchCallback: () => handleDictQuery(),
|
|
||||||
queryAllCallback: () => fetchDictData({ pageSize: 99999 }),
|
|
||||||
},
|
},
|
||||||
{ loading: false, rowConfig: { isCurrent: true, isHover: true }, checkboxConfig: { range: true, highlight: false } }
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryDictDataApi(page, sort) } },
|
||||||
|
// // 排序配置
|
||||||
|
// sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// // 分页配置
|
||||||
|
// pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
// 等待
|
||||||
|
loading: false,
|
||||||
|
// 行配置
|
||||||
|
rowConfig: { isCurrent: true, isHover: true },
|
||||||
|
// 多选配置
|
||||||
|
checkboxConfig: { range: true, highlight: false },
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleDictQuery = async (reset = false) => {
|
const handleQueryDictDataApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
dictOptions.loading = true;
|
const params = Object.assign(state.queryParamsDictData, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageDictDataInput;
|
||||||
if (reset) state.tableDictParams.page = 1;
|
|
||||||
var res = await fetchDictData(null);
|
|
||||||
xDictGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableDictParams.total = res.data.result?.total;
|
|
||||||
dictOptions.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchDictData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryDictParams, state.tableDictParams, tableParams);
|
|
||||||
return getAPI(SysDictDataApi).apiSysDictDataPagePost(params);
|
return getAPI(SysDictDataApi).apiSysDictDataPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 查询操作
|
||||||
const resetDictQuery = async () => {
|
const handleQueryDictData = async () => {
|
||||||
state.queryDictParams.value = undefined;
|
await xGridDictData.value?.commitProxy('query');
|
||||||
state.queryDictParams.code = undefined;
|
|
||||||
await handleDictQuery(true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDictAdd = () => {
|
// 重置操作
|
||||||
if (!state.queryDictParams.dictTypeId) {
|
const resetQueryDictData = async () => {
|
||||||
|
state.queryParamsDictData.value = undefined;
|
||||||
|
state.queryParamsDictData.code = undefined;
|
||||||
|
await xGridDictData.value?.commitProxy('reload');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 添加字典值
|
||||||
|
const handleAddDictData = () => {
|
||||||
|
if (!state.queryParamsDictData.dictTypeId) {
|
||||||
ElMessage.warning('请选择字典');
|
ElMessage.warning('请选择字典');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.title = '添加字典值';
|
state.title = '添加字典值';
|
||||||
editDictRef.value?.openDialog({ status: 1, orderNo: 100, dictTypeId: state.queryDictParams.dictTypeId });
|
editRefDictData.value?.openDialog({ status: 1, orderNo: 100, dictTypeId: state.queryParamsDictData.dictTypeId });
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开编辑页面
|
// 打开编辑页面
|
||||||
const handleDictEdit = (row: any) => {
|
const handleEditDictData = (row: any) => {
|
||||||
state.title = '编辑字典值';
|
state.title = '编辑字典值';
|
||||||
editDictRef.value?.openDialog(row);
|
editRefDictData.value?.openDialog(row);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 删除
|
// 删除字典值
|
||||||
const handleDictDelete = (row: any) => {
|
const handleDeleteDictData = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定删除字典值:【${row.value}】?`, '提示', {
|
ElMessageBox.confirm(`确定删除字典值:【${row.value}】?`, '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@ -362,25 +353,25 @@ const handleDictDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysDictDataApi).apiSysDictDataDeletePost({ id: row.id });
|
await getAPI(SysDictDataApi).apiSysDictDataDeletePost({ id: row.id });
|
||||||
handleDictQuery();
|
await handleQueryDictData();
|
||||||
updateDictSession();
|
await updateDictSession();
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 改变字典值页码序号或页面容量
|
// 表格事件
|
||||||
const dictPageChange: VxePagerEvents.PageChange = async ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
const gridEventsDictData: VxeGridListeners<SysDictData> = {
|
||||||
state.tableDictParams.page = currentPage;
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
state.tableDictParams.pageSize = pageSize;
|
async pageChange({ pageSize }) {
|
||||||
await handleDictQuery();
|
state.localPageParamDictData.pageSize = pageSize;
|
||||||
};
|
// Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
// 字典值列排序
|
// 当排序条件发生变化时会触发该事件
|
||||||
const dictSortChange = async (options: any) => {
|
async sortChange({ field, order }) {
|
||||||
state.tableDictParams.field = options.field;
|
state.localPageParamDictData.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
state.tableDictParams.order = options.order;
|
// Local.set(localPageParamKey, state.localPageParam);
|
||||||
await handleDictQuery();
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更新前端字典缓存
|
// 更新前端字典缓存
|
||||||
|
|||||||
@ -5,17 +5,17 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="文件名称" prop="fileName">
|
<el-form-item label="文件名称" prop="fileName">
|
||||||
<el-input v-model="state.queryParams.fileName" placeholder="文件名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.fileName" placeholder="文件名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="开始时间" prop="name">
|
<el-form-item label="开始时间" prop="name">
|
||||||
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" />
|
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" class="w100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="结束时间" prop="code">
|
<el-form-item label="结束时间" prop="code">
|
||||||
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" value-format="YYYY-MM-DD HH:mm:ss" />
|
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" value-format="YYYY-MM-DD HH:mm:ss" class="w100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysFile:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysFile:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="showUpload" v-auth="'sysFile:uploadFile'"> 上传 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="showUpload" v-auth="'sysFile:uploadFile'"> 上传 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -72,15 +72,6 @@
|
|||||||
<el-button icon="ele-Download" size="small" text type="primary" @click="handleDownload(row)" v-auth="'sysFile:downloadFile'" />
|
<el-button icon="ele-Download" size="small" text type="primary" @click="handleDownload(row)" v-auth="'sysFile:downloadFile'" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -133,8 +124,9 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage, UploadInstance } from 'element-plus';
|
import { ElMessageBox, ElMessage, UploadInstance } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
import { downloadByUrl } from '/@/utils/download';
|
import { downloadByUrl } from '/@/utils/download';
|
||||||
import VueOfficeDocx from '@vue-office/docx';
|
import VueOfficeDocx from '@vue-office/docx';
|
||||||
import VueOfficeExcel from '@vue-office/excel';
|
import VueOfficeExcel from '@vue-office/excel';
|
||||||
@ -142,11 +134,11 @@ import VueOfficePdf from '@vue-office/pdf';
|
|||||||
import '@vue-office/docx/lib/index.css';
|
import '@vue-office/docx/lib/index.css';
|
||||||
import '@vue-office/excel/lib/index.css';
|
import '@vue-office/excel/lib/index.css';
|
||||||
|
|
||||||
import EditFile from '/@/views/system/file/component/editSysfile.vue';
|
import EditFile from '/@/views/system/file/component/editFile.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysFileApi } from '/@/api-services/api';
|
import { SysFileApi } from '/@/api-services/api';
|
||||||
import { SysFile } from '/@/api-services/models';
|
import { SysFile, PageFileInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
// const baseUrl = window.__env__.VITE_API_URL;
|
// const baseUrl = window.__env__.VITE_API_URL;
|
||||||
@ -158,13 +150,9 @@ const state = reactive({
|
|||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime: undefined,
|
endTime: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
diaglogEditFile: false,
|
diaglogEditFile: false,
|
||||||
@ -181,6 +169,8 @@ const state = reactive({
|
|||||||
previewList: [] as string[],
|
previewList: [] as string[],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysFile';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysFile>(
|
const options = useVxeTable<SysFile>(
|
||||||
{
|
{
|
||||||
@ -204,11 +194,20 @@ const options = useVxeTable<SysFile>(
|
|||||||
{ field: 'remark', title: '备注', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'remark', title: '备注', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 150, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ title: '操作', fixed: 'right', width: 150, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
],
|
],
|
||||||
enableExport: auth('sysFile:export'),
|
|
||||||
searchCallback: () => handleQuery(),
|
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
|
||||||
},
|
},
|
||||||
{ rowConfig: { height: 80 } }
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
// 行设置
|
||||||
|
rowConfig: { height: 80 },
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
@ -216,42 +215,23 @@ onMounted(async () => {
|
|||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageFileInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysFileApi).apiSysFilePagePost(params);
|
return getAPI(SysFileApi).apiSysFilePagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.fileName = undefined;
|
state.queryParams.fileName = undefined;
|
||||||
state.queryParams.startTime = undefined;
|
state.queryParams.startTime = undefined;
|
||||||
state.queryParams.endTime = undefined;
|
state.queryParams.endTime = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开上传页面
|
// 打开上传页面
|
||||||
@ -296,6 +276,20 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysFile> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 打开Pdf预览页面
|
// 打开Pdf预览页面
|
||||||
const showPreviewDialog = async (row: any) => {
|
const showPreviewDialog = async (row: any) => {
|
||||||
if (row.suffix == '.pdf') {
|
if (row.suffix == '.pdf') {
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="关键字">
|
<el-form-item label="关键字">
|
||||||
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysLdap:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysLdap:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
<el-button icon="ele-Filter" type="primary" :loading="options.loading" @click="state.visible = true" v-auth="'sysLdap:page'" style="margin-left: 12px"> 高级查询</el-button>
|
<el-button icon="ele-Filter" type="primary" :loading="options.loading" @click="state.visible = true" v-auth="'sysLdap:page'" style="margin-left: 12px"> 高级查询</el-button>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb8">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb8">
|
||||||
<el-form-item label="主机">
|
<el-form-item label="主机">
|
||||||
<el-input v-model="state.queryParams.host" clearable placeholder="请输入主机" @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.host" clearable placeholder="请输入主机" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -44,14 +44,14 @@
|
|||||||
<div class="filter-dialog-footer">
|
<div class="filter-dialog-footer">
|
||||||
<el-text type="danger"></el-text>
|
<el-text type="danger"></el-text>
|
||||||
<el-button icon="ele-Close" type="info" :loading="options.loading" @click="state.visible = false">关闭</el-button>
|
<el-button icon="ele-Close" type="info" :loading="options.loading" @click="state.visible = false">关闭</el-button>
|
||||||
<el-button icon="ele-Search" type="primary" :loading="options.loading" @click="handleQuery(true)">查询</el-button>
|
<el-button icon="ele-Search" type="primary" :loading="options.loading" @click="handleQuery">查询</el-button>
|
||||||
<el-button icon="ele-RefreshRight" type="primary" :loading="options.loading" @click="resetQueryFliter">重置</el-button>
|
<el-button icon="ele-RefreshRight" type="primary" :loading="options.loading" @click="resetQueryFliter">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysLdap:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysLdap:add'"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -75,15 +75,6 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button icon="ele-Refresh" text type="danger" v-auth="'sysLdap:syncUser'" @click="handleSync(row)">同步域账户</el-button>
|
<el-button icon="ele-Refresh" text type="danger" v-auth="'sysLdap:syncUser'" @click="handleSync(row)">同步域账户</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -96,14 +87,15 @@
|
|||||||
import { defineAsyncComponent, ref, reactive, onMounted } from 'vue';
|
import { defineAsyncComponent, ref, reactive, onMounted } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth, auths } from '/@/utils/authFunction';
|
import { auth, auths } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysLdapApi } from '/@/api-services';
|
import { SysLdapApi } from '/@/api-services';
|
||||||
import { SysLdap } from '/@/api-services/models';
|
import { SysLdap, PageSysLdapInput } from '/@/api-services/models';
|
||||||
|
|
||||||
// 异步引用组件
|
// 异步引用组件
|
||||||
const PrintDialog = defineAsyncComponent(() => import('/@/views/system/print/component/hiprint/preview.vue'));
|
const PrintDialog = defineAsyncComponent(() => import('/@/views/system/print/component/hiprint/preview.vue'));
|
||||||
@ -117,84 +109,74 @@ const state = reactive({
|
|||||||
searchKey: '',
|
searchKey: '',
|
||||||
host: '',
|
host: '',
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysLdap';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysLdap>({
|
const options = useVxeTable<SysLdap>(
|
||||||
id: 'sysLdap',
|
{
|
||||||
name: '系统域登录信息配置',
|
id: 'sysLdap',
|
||||||
columns: [
|
name: '系统域登录信息配置',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'host', title: '主机', minWidth: 120, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'port', title: '端口', minWidth: 90, showOverflow: 'tooltip' },
|
{ field: 'host', title: '主机', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'baseDn', title: '用户搜索基准', minWidth: 140, showOverflow: 'tooltip' },
|
{ field: 'port', title: '端口', minWidth: 90, showOverflow: 'tooltip' },
|
||||||
{ field: 'bindDn', title: '绑定DN', minWidth: 140, showOverflow: 'tooltip' },
|
{ field: 'baseDn', title: '用户搜索基准', minWidth: 140, showOverflow: 'tooltip' },
|
||||||
{ field: 'authFilter', title: '用户过滤规则', minWidth: 140, showOverflow: 'tooltip' },
|
{ field: 'bindDn', title: '绑定DN', minWidth: 140, showOverflow: 'tooltip' },
|
||||||
{ field: 'version', title: 'Ldap版本', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'authFilter', title: '用户过滤规则', minWidth: 140, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'version', title: 'Ldap版本', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ title: '操作', fixed: 'right', width: 200, showOverflow: true, slots: { default: 'row_buttons' }, visible: auths(['sysLdap:update', 'sysLdap:delete', 'sysLdap:syncUser']) },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 200, showOverflow: true, slots: { default: 'row_buttons' }, visible: auths(['sysLdap:update', 'sysLdap:delete', 'sysLdap:syncUser']) },
|
||||||
searchCallback: () => handleQuery(),
|
],
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
},
|
||||||
});
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
if (!auth('sysLdap:page')) return;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageSysLdapInput;
|
||||||
options.loading = true;
|
return getAPI(SysLdapApi).apiSysLdapPagePost(params);
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取数据
|
// 查询操作
|
||||||
const fetchData = async (tableParams: any) => {
|
const handleQuery = async () => {
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
await xGrid.value?.commitProxy('query');
|
||||||
return getAPI(SysLdapApi).apiSysLdapPagePost(params);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = async () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.searchKey = '';
|
state.queryParams.searchKey = '';
|
||||||
await handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置高级查询
|
// 重置高级查询
|
||||||
const resetQueryFliter = async () => {
|
const resetQueryFliter = async () => {
|
||||||
state.queryParams.host = '';
|
state.queryParams.host = '';
|
||||||
await handleQuery(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = async ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
await handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = async (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -225,6 +207,20 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysLdap> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 同步域账户
|
// 同步域账户
|
||||||
const handleSync = (row: any) => {
|
const handleSync = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定要删除域登录信息配置:【${row.host}】?`, '提示', {
|
ElMessageBox.confirm(`确定要删除域登录信息配置:【${row.host}】?`, '提示', {
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysDifflog:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysDifflog:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysDifflog:clear'"> 清空 </el-button>
|
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysDifflog:clear'"> 清空 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -39,15 +39,6 @@
|
|||||||
<template #empty>
|
<template #empty>
|
||||||
<el-empty :image-size="200" />
|
<el-empty :image-size="200" />
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
@ -58,12 +49,13 @@ import { onMounted, reactive, ref } from 'vue';
|
|||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
|
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysLogDiffApi } from '/@/api-services/api';
|
import { SysLogDiffApi } from '/@/api-services/api';
|
||||||
import { SysLogDiff } from '/@/api-services/models';
|
import { SysLogDiff, PageLogInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const shortcuts = useDateTimeShortCust();
|
const shortcuts = useDateTimeShortCust();
|
||||||
@ -72,66 +64,82 @@ const state = reactive({
|
|||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime: undefined,
|
endTime: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'id', order: 'desc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'desc', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysDiffLog';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysLogDiff>({
|
const options = useVxeTable<SysLogDiff>(
|
||||||
id: 'sysDiffLog',
|
{
|
||||||
name: '差异日志',
|
id: 'sysDiffLog',
|
||||||
columns: [
|
name: '差异日志',
|
||||||
// { type: 'checkbox', width: 40 },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40 },
|
||||||
{ field: 'diffType', title: '差异操作', minWidth: 150, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'sql', title: 'Sql语句', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'diffType', title: '差异操作', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'parameters', title: '参数', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'sql', title: 'Sql语句', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'elapsed', title: '耗时(ms)', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'parameters', title: '参数', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'message', title: '日志消息', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'elapsed', title: '耗时(ms)', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'beforeData', title: '操作前记录', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'message', title: '日志消息', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'afterData', title: '操作后记录', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'beforeData', title: '操作前记录', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'businessData', title: '业务对象', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'afterData', title: '操作后记录', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'createTime', title: '操作时间', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'businessData', title: '业务对象', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
],
|
{ field: 'createTime', title: '操作时间', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
enableExport: auth('sysDifflog:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageLogInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
if (state.queryParams.startTime == null) state.queryParams.startTime = undefined;
|
|
||||||
if (state.queryParams.endTime == null) state.queryParams.endTime = undefined;
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysLogDiffApi).apiSysLogDiffPagePost(params);
|
return getAPI(SysLogDiffApi).apiSysLogDiffPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.startTime = undefined;
|
state.queryParams.startTime = undefined;
|
||||||
state.queryParams.endTime = undefined;
|
state.queryParams.endTime = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysLogDiff> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 清空日志
|
// 清空日志
|
||||||
@ -142,18 +150,4 @@ const handleClear = async () => {
|
|||||||
ElMessage.success('清空成功');
|
ElMessage.success('清空成功');
|
||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -15,12 +15,12 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="显示名称" prop="displayTitle">
|
<el-form-item label="显示名称" prop="displayTitle">
|
||||||
<el-input v-model="state.queryParams.displayTitle" clearable placeholder="显示名称" @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.displayTitle" clearable placeholder="显示名称" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="操作人" prop="realName">
|
<el-form-item label="操作人" prop="realName">
|
||||||
<el-input v-model="state.queryParams.realName" clearable placeholder="操作人" @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.realName" clearable placeholder="操作人" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysExlog:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysExlog:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @cell-dblclick="handleView" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents" @cell-dblclick="handleView">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysExlog:clear'"> 清空 </el-button>
|
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysExlog:clear'"> 清空 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -61,15 +61,6 @@
|
|||||||
<template #row_buttons="{ row }">
|
<template #row_buttons="{ row }">
|
||||||
<el-button icon="ele-InfoFilled" text type="primary" @click="handleView({ row })">详情</el-button>
|
<el-button icon="ele-InfoFilled" text type="primary" @click="handleView({ row })">详情</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -106,15 +97,16 @@ import { onMounted, reactive, ref } from 'vue';
|
|||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
|
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
import VueJsonPretty from 'vue-json-pretty';
|
import VueJsonPretty from 'vue-json-pretty';
|
||||||
import 'vue-json-pretty/lib/styles.css';
|
import 'vue-json-pretty/lib/styles.css';
|
||||||
import { StringToObj } from '/@/utils/json-utils';
|
import { StringToObj } from '/@/utils/json-utils';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysLogExApi } from '/@/api-services/api';
|
import { SysLogExApi } from '/@/api-services/api';
|
||||||
import { SysLogEx } from '/@/api-services/models';
|
import { SysLogEx, PageLogInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const shortcuts = useDateTimeShortCust();
|
const shortcuts = useDateTimeShortCust();
|
||||||
@ -125,13 +117,9 @@ const state = reactive({
|
|||||||
displayTitle: '',
|
displayTitle: '',
|
||||||
realName: '',
|
realName: '',
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'id', order: 'desc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'desc', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
detail: {
|
detail: {
|
||||||
@ -143,70 +131,90 @@ const state = reactive({
|
|||||||
activeTab: 'message',
|
activeTab: 'message',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysExLog';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysLogEx>({
|
const options = useVxeTable<SysLogEx>(
|
||||||
id: 'sysExLog',
|
{
|
||||||
name: '异常日志',
|
id: 'sysExLog',
|
||||||
columns: [
|
name: '异常日志',
|
||||||
// { type: 'checkbox', width: 40 },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40 },
|
||||||
{ field: 'controllerName', title: '模块名称', minWidth: 100, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'displayTitle', title: '显示名称', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'controllerName', title: '模块名称', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'actionName', title: '方法名称', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'displayTitle', title: '显示名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'httpMethod', title: '请求方式', minWidth: 90, showOverflow: 'tooltip' },
|
{ field: 'actionName', title: '方法名称', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'requestUrl', title: '请求地址', minWidth: 300, showOverflow: 'tooltip' },
|
{ field: 'httpMethod', title: '请求方式', minWidth: 90, showOverflow: 'tooltip' },
|
||||||
{ field: 'logLevel', title: '级别', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_logLevel' } },
|
{ field: 'requestUrl', title: '请求地址', minWidth: 300, showOverflow: 'tooltip' },
|
||||||
{ field: 'eventId', title: '事件Id', minWidth: 80, showOverflow: 'tooltip' },
|
{ field: 'logLevel', title: '级别', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_logLevel' } },
|
||||||
{ field: 'threadId', title: '线程Id', minWidth: 90, showOverflow: 'tooltip' },
|
{ field: 'eventId', title: '事件Id', minWidth: 80, showOverflow: 'tooltip' },
|
||||||
{ field: 'traceId', title: '请求跟踪Id', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'threadId', title: '线程Id', minWidth: 90, showOverflow: 'tooltip' },
|
||||||
{ field: 'account', title: '账号名称', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'traceId', title: '请求跟踪Id', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'realName', title: '真实姓名', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'account', title: '账号名称', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'remoteIp', title: 'IP地址', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'realName', title: '真实姓名', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'location', title: '登录地点', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'remoteIp', title: 'IP地址', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'longitude', title: '经度', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'location', title: '登录地点', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'latitude', title: '纬度', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'longitude', title: '经度', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'browser', title: '浏览器', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'latitude', title: '纬度', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'os', title: '操作系统', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'browser', title: '浏览器', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'os', title: '操作系统', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'elapsed', title: '耗时(ms)', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'status', title: '状态', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ field: 'logDateTime', title: '日志时间', minWidth: 160, showOverflow: 'tooltip' },
|
{ field: 'elapsed', title: '耗时(ms)', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: 'logDateTime', title: '日志时间', minWidth: 160, showOverflow: 'tooltip' },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysExlog:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageLogInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
if (state.queryParams.startTime == null) state.queryParams.startTime = undefined;
|
|
||||||
if (state.queryParams.endTime == null) state.queryParams.endTime = undefined;
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysLogExApi).apiSysLogExPagePost(params);
|
return getAPI(SysLogExApi).apiSysLogExPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.startTime = undefined;
|
state.queryParams.startTime = undefined;
|
||||||
state.queryParams.endTime = undefined;
|
state.queryParams.endTime = undefined;
|
||||||
state.queryParams.displayTitle = '';
|
state.queryParams.displayTitle = '';
|
||||||
state.queryParams.realName = '';
|
state.queryParams.realName = '';
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysLogEx> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 清空日志
|
// 清空日志
|
||||||
@ -215,7 +223,7 @@ const handleClear = async () => {
|
|||||||
await getAPI(SysLogExApi).apiSysLogExClearPost();
|
await getAPI(SysLogExApi).apiSysLogExClearPost();
|
||||||
options.loading = false;
|
options.loading = false;
|
||||||
ElMessage.success('清空成功');
|
ElMessage.success('清空成功');
|
||||||
handleQuery(true);
|
await handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
@ -228,20 +236,6 @@ const handleView = async ({ row }: any) => {
|
|||||||
state.detail.returnResult = StringToObj(data?.result?.returnResult);
|
state.detail.returnResult = StringToObj(data?.result?.returnResult);
|
||||||
state.visible = true;
|
state.visible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -5,22 +5,22 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="开始时间" prop="name">
|
<el-form-item label="开始时间" prop="name">
|
||||||
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" :shortcuts="shortcuts" />
|
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" :shortcuts="shortcuts" class="w100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="结束时间" prop="code">
|
<el-form-item label="结束时间" prop="code">
|
||||||
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" :shortcuts="shortcuts" />
|
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" :shortcuts="shortcuts" class="w100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="显示名称" prop="displayTitle">
|
<el-form-item label="显示名称" prop="displayTitle">
|
||||||
<el-input v-model="state.queryParams.displayTitle" clearable placeholder="显示名称" @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.displayTitle" clearable placeholder="显示名称" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="操作人" prop="realName">
|
<el-form-item label="操作人" prop="realName">
|
||||||
<el-input v-model="state.queryParams.realName" clearable placeholder="操作人" @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.realName" clearable placeholder="操作人" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysOplog:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysOplog:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @cell-dblclick="handleView" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents" @cell-dblclick="handleView">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysOplog:clear'"> 清空 </el-button>
|
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysOplog:clear'"> 清空 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -61,15 +61,6 @@
|
|||||||
<template #row_buttons="{ row }">
|
<template #row_buttons="{ row }">
|
||||||
<el-button icon="ele-InfoFilled" text type="primary" @click="handleView({ row })">详情</el-button>
|
<el-button icon="ele-InfoFilled" text type="primary" @click="handleView({ row })">详情</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -106,15 +97,16 @@ import { onMounted, reactive, ref } from 'vue';
|
|||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
|
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
import VueJsonPretty from 'vue-json-pretty';
|
import VueJsonPretty from 'vue-json-pretty';
|
||||||
import 'vue-json-pretty/lib/styles.css';
|
import 'vue-json-pretty/lib/styles.css';
|
||||||
import { StringToObj } from '/@/utils/json-utils';
|
import { StringToObj } from '/@/utils/json-utils';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysLogOpApi } from '/@/api-services/api';
|
import { SysLogOpApi } from '/@/api-services/api';
|
||||||
import { SysLogOp } from '/@/api-services/models';
|
import { SysLogOp, PageLogInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const shortcuts = useDateTimeShortCust();
|
const shortcuts = useDateTimeShortCust();
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
@ -125,13 +117,9 @@ const state = reactive({
|
|||||||
displayTitle: '',
|
displayTitle: '',
|
||||||
realName: '',
|
realName: '',
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'id', order: 'desc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'desc', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
detail: {
|
detail: {
|
||||||
@ -143,72 +131,92 @@ const state = reactive({
|
|||||||
activeTab: 'message',
|
activeTab: 'message',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysOpLog';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysLogOp>({
|
const options = useVxeTable<SysLogOp>(
|
||||||
id: 'sysOpLog',
|
{
|
||||||
name: '操作日志',
|
id: 'sysOpLog',
|
||||||
columns: [
|
name: '操作日志',
|
||||||
// { type: 'checkbox', width: 40 },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40 },
|
||||||
{ field: 'controllerName', title: '模块名称', minWidth: 120, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'displayTitle', title: '显示名称', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'controllerName', title: '模块名称', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'actionName', title: '方法名称', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'displayTitle', title: '显示名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'httpMethod', title: '请求方式', minWidth: 90, showOverflow: 'tooltip' },
|
{ field: 'actionName', title: '方法名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
// { field: 'returnResult', title: '返回结果', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'httpMethod', title: '请求方式', minWidth: 90, showOverflow: 'tooltip' },
|
||||||
{ field: 'logLevel', title: '级别', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_logLevel' } },
|
// { field: 'returnResult', title: '返回结果', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'eventId', title: '事件Id', minWidth: 80, showOverflow: 'tooltip' },
|
{ field: 'logLevel', title: '级别', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_logLevel' } },
|
||||||
{ field: 'threadId', title: '线程Id', minWidth: 90, showOverflow: 'tooltip' },
|
{ field: 'eventId', title: '事件Id', minWidth: 80, showOverflow: 'tooltip' },
|
||||||
{ field: 'traceId', title: '请求跟踪Id', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'threadId', title: '线程Id', minWidth: 90, showOverflow: 'tooltip' },
|
||||||
{ field: 'account', title: '账号名称', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'traceId', title: '请求跟踪Id', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'realName', title: '真实姓名', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'account', title: '账号名称', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'remoteIp', title: 'IP地址', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'realName', title: '真实姓名', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'location', title: '登录地点', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'remoteIp', title: 'IP地址', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'longitude', title: '经度', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'location', title: '登录地点', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'latitude', title: '纬度', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'longitude', title: '经度', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'browser', title: '浏览器', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'latitude', title: '纬度', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'os', title: '操作系统', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'browser', title: '浏览器', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'os', title: '操作系统', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'elapsed', title: '耗时(ms)', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'status', title: '状态', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
// { field: 'exception', title: '异常对象', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'elapsed', title: '耗时(ms)', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
// { field: 'message', title: '日志消息', minWidth: 160, showOverflow: 'tooltip' },
|
// { field: 'exception', title: '异常对象', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'logDateTime', title: '日志时间', minWidth: 160, showOverflow: 'tooltip' },
|
// { field: 'message', title: '日志消息', minWidth: 160, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: 'logDateTime', title: '日志时间', minWidth: 160, showOverflow: 'tooltip' },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysOplog:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageLogInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
if (state.queryParams.startTime == null) state.queryParams.startTime = undefined;
|
|
||||||
if (state.queryParams.endTime == null) state.queryParams.endTime = undefined;
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysLogOpApi).apiSysLogOpPagePost(params);
|
return getAPI(SysLogOpApi).apiSysLogOpPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.startTime = undefined;
|
state.queryParams.startTime = undefined;
|
||||||
state.queryParams.endTime = undefined;
|
state.queryParams.endTime = undefined;
|
||||||
state.queryParams.displayTitle = '';
|
state.queryParams.displayTitle = '';
|
||||||
state.queryParams.realName = '';
|
state.queryParams.realName = '';
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysLogOp> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 清空日志
|
// 清空日志
|
||||||
@ -217,7 +225,7 @@ const handleClear = async () => {
|
|||||||
await getAPI(SysLogOpApi).apiSysLogOpClearPost();
|
await getAPI(SysLogOpApi).apiSysLogOpClearPost();
|
||||||
options.loading = false;
|
options.loading = false;
|
||||||
ElMessage.success('清空成功');
|
ElMessage.success('清空成功');
|
||||||
handleQuery(true);
|
await handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
@ -230,20 +238,6 @@ const handleView = async ({ row }: any) => {
|
|||||||
state.detail.returnResult = StringToObj(data?.result?.returnResult);
|
state.detail.returnResult = StringToObj(data?.result?.returnResult);
|
||||||
state.visible = true;
|
state.visible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -5,22 +5,22 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="开始时间" prop="name">
|
<el-form-item label="开始时间" prop="name">
|
||||||
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" :shortcuts="shortcuts" />
|
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" :shortcuts="shortcuts" class="w100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="结束时间" prop="code">
|
<el-form-item label="结束时间" prop="code">
|
||||||
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" :shortcuts="shortcuts" />
|
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" :shortcuts="shortcuts" class="w100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="显示名称" prop="displayTitle">
|
<el-form-item label="显示名称" prop="displayTitle">
|
||||||
<el-input v-model="state.queryParams.displayTitle" clearable placeholder="显示名称" @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.displayTitle" clearable placeholder="显示名称" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="操作人" prop="realName">
|
<el-form-item label="操作人" prop="realName">
|
||||||
<el-input v-model="state.queryParams.realName" clearable placeholder="操作人" @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.realName" clearable placeholder="操作人" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysVislog:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysVislog:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysVislog:clear'"> 清空 </el-button>
|
<el-button icon="ele-DeleteFilled" type="danger" @click="handleClear" v-auth="'sysVislog:clear'"> 清空 </el-button>
|
||||||
<el-button icon="ele-MapLocation" type="primary" @click="handleMap"> 热力图 </el-button>
|
<el-button icon="ele-MapLocation" type="primary" @click="handleMap"> 热力图 </el-button>
|
||||||
@ -52,15 +52,6 @@
|
|||||||
<el-tag v-if="row.status === '200'" type="success">成功</el-tag>
|
<el-tag v-if="row.status === '200'" type="success">成功</el-tag>
|
||||||
<el-tag v-else type="danger">失败</el-tag>
|
<el-tag v-else type="danger">失败</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -73,12 +64,13 @@ import { onMounted, reactive, ref, defineAsyncComponent } from 'vue';
|
|||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
|
import { useDateTimeShortCust } from '/@/hooks/dateTimeShortCust';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysLogVisApi } from '/@/api-services';
|
import { SysLogVisApi } from '/@/api-services';
|
||||||
import { SysLogVis } from '/@/api-services/models';
|
import { SysLogVis, PageLogInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const VisMap = defineAsyncComponent(() => import('./component/visMap.vue'));
|
const VisMap = defineAsyncComponent(() => import('./component/visMap.vue'));
|
||||||
|
|
||||||
@ -92,73 +84,89 @@ const state = reactive({
|
|||||||
displayTitle: '',
|
displayTitle: '',
|
||||||
realName: '',
|
realName: '',
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'id', order: 'desc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'desc', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysVisLog';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysLogVis>({
|
const options = useVxeTable<SysLogVis>(
|
||||||
id: 'sysVisLog',
|
{
|
||||||
name: '访问日志',
|
id: 'sysVisLog',
|
||||||
columns: [
|
name: '访问日志',
|
||||||
// { type: 'checkbox', width: 40 },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40 },
|
||||||
{ field: 'displayTitle', title: '显示名称', minWidth: 150, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'actionName', title: '方法名称', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'displayTitle', title: '显示名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'account', title: '账号名称', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'actionName', title: '方法名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'realName', title: '真实姓名', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'account', title: '账号名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'remoteIp', title: 'IP地址', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'realName', title: '真实姓名', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'location', title: '登录地点', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'remoteIp', title: 'IP地址', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'longitude', title: '经度', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'location', title: '登录地点', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'latitude', title: '纬度', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'longitude', title: '经度', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'browser', title: '浏览器', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'latitude', title: '纬度', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'os', title: '操作系统', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'browser', title: '浏览器', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'os', title: '操作系统', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'elapsed', title: '耗时(ms)', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'status', title: '状态', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ field: 'logDateTime', title: '日志时间', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'elapsed', title: '耗时(ms)', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
],
|
{ field: 'logDateTime', title: '日志时间', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
enableExport: auth('sysVislog:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageLogInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
if (state.queryParams.startTime == null) state.queryParams.startTime = undefined;
|
|
||||||
if (state.queryParams.endTime == null) state.queryParams.endTime = undefined;
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysLogVisApi).apiSysLogVisPagePost(params);
|
return getAPI(SysLogVisApi).apiSysLogVisPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.startTime = undefined;
|
state.queryParams.startTime = undefined;
|
||||||
state.queryParams.endTime = undefined;
|
state.queryParams.endTime = undefined;
|
||||||
state.queryParams.displayTitle = '';
|
state.queryParams.displayTitle = '';
|
||||||
state.queryParams.realName = '';
|
state.queryParams.realName = '';
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysLogVis> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 清空日志
|
// 清空日志
|
||||||
@ -167,7 +175,7 @@ const handleClear = async () => {
|
|||||||
await getAPI(SysLogVisApi).apiSysLogVisClearPost();
|
await getAPI(SysLogVisApi).apiSysLogVisClearPost();
|
||||||
options.loading = false;
|
options.loading = false;
|
||||||
ElMessage.success('清空成功');
|
ElMessage.success('清空成功');
|
||||||
handleQuery(true);
|
await handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开访问热力图
|
// 打开访问热力图
|
||||||
@ -175,18 +183,4 @@ const handleMap = async () => {
|
|||||||
state.title = '访问者热力图';
|
state.title = '访问者热力图';
|
||||||
mapRef.value?.openDialog();
|
mapRef.value?.openDialog();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" :tree-config="{}">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysMenu:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysMenu:add'"> 新增 </el-button>
|
||||||
<el-button-group style="padding-left: 12px">
|
<el-button-group style="padding-left: 12px">
|
||||||
@ -77,11 +77,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="sysMenu">
|
<script lang="ts" setup name="sysMenu">
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { VxeGridInstance, VxeGridListeners } from 'vxe-table';
|
||||||
import { VxeGridInstance } from 'vxe-table';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
|
||||||
import SvgIcon from '/@/components/svgIcon/index.vue';
|
import SvgIcon from '/@/components/svgIcon/index.vue';
|
||||||
|
|
||||||
import EditMenu from '/@/views/system/menu/component/editMenu.vue';
|
import EditMenu from '/@/views/system/menu/component/editMenu.vue';
|
||||||
@ -120,38 +119,40 @@ const options = useVxeTable<SysMenu>(
|
|||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
],
|
],
|
||||||
enableExport: auth('sysMenu:export'),
|
|
||||||
searchCallback: () => handleQuery(),
|
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
|
||||||
},
|
},
|
||||||
{ stripe: false, checkboxConfig: { range: false } }
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
stripe: false,
|
||||||
|
checkboxConfig: { range: false },
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: () => handleQueryApi() } },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { enabled: false },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
// 树形配置
|
||||||
|
treeConfig: { expandAll: false },
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 查询api
|
||||||
onMounted(async () => {
|
const handleQueryApi = async () => {
|
||||||
await handleQuery();
|
const params = Object.assign(state.queryParams);
|
||||||
});
|
|
||||||
|
|
||||||
// 查询操作
|
|
||||||
const handleQuery = async () => {
|
|
||||||
options.loading = true;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result ?? []);
|
|
||||||
state.menuData = res.data.result ?? [];
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, tableParams);
|
|
||||||
return getAPI(SysMenuApi).apiSysMenuListGet(params.title, params.type);
|
return getAPI(SysMenuApi).apiSysMenuListGet(params.title, params.type);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
// 调用vxe-grid的commitProxy(query)方法,触发表格重新加载数据
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.title = undefined;
|
state.queryParams.title = undefined;
|
||||||
state.queryParams.type = undefined;
|
state.queryParams.type = undefined;
|
||||||
handleQuery();
|
// 调用vxe-grid的commitProxy(reload)方法,触发表格重新加载数据
|
||||||
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -181,6 +182,14 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysMenu> = {
|
||||||
|
// 只对 proxy-config.ajax.query 配置时有效,当手动点击查询时会触发该事件
|
||||||
|
async proxyQuery() {
|
||||||
|
state.menuData = xGrid.value?.getTableData().tableData ?? [];
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 全部展开
|
// 全部展开
|
||||||
const handleExpand = () => {
|
const handleExpand = () => {
|
||||||
xGrid.value?.setAllTreeExpand(true);
|
xGrid.value?.setAllTreeExpand(true);
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="标题" prop="title">
|
<el-form-item label="标题" prop="title">
|
||||||
<el-input v-model="state.queryParams.title" placeholder="标题" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.title" placeholder="标题" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysNotice:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysNotice:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysNotice:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysNotice:add'"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -60,15 +60,6 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button icon="ele-Position" size="small" text type="primary" @click="handlePublic(row)" v-auth="'sysNotice:public'" :disabled="row.status === 1">发布</el-button>
|
<el-button icon="ele-Position" size="small" text type="primary" @click="handlePublic(row)" v-auth="'sysNotice:public'" :disabled="row.status === 1">发布</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -81,15 +72,16 @@ import { onMounted, reactive, ref } from 'vue';
|
|||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import commonFunction from '/@/utils/commonFunction';
|
import commonFunction from '/@/utils/commonFunction';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditNotice from '/@/views/system/notice/component/editNotice.vue';
|
import EditNotice from '/@/views/system/notice/component/editNotice.vue';
|
||||||
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysNoticeApi } from '/@/api-services/api';
|
import { SysNoticeApi } from '/@/api-services/api';
|
||||||
import { SysNotice } from '/@/api-services/models';
|
import { SysNotice, PageNoticeInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editNoticeRef = ref<InstanceType<typeof EditNotice>>();
|
const editNoticeRef = ref<InstanceType<typeof EditNotice>>();
|
||||||
@ -99,80 +91,70 @@ const state = reactive({
|
|||||||
title: undefined,
|
title: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysNotice';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysNotice>({
|
const options = useVxeTable<SysNotice>(
|
||||||
id: 'sysNotice',
|
{
|
||||||
name: '通知公告',
|
id: 'sysNotice',
|
||||||
columns: [
|
name: '通知公告',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'title', title: '标题', minWidth: 200, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'content', title: '内容', minWidth: 180, showOverflow: 'tooltip', slots: { default: (scope: any) => removeHtml(scope.row.content) } },
|
{ field: 'title', title: '标题', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'type', title: '类型', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_type' } },
|
{ field: 'content', title: '内容', minWidth: 180, showOverflow: 'tooltip', slots: { default: (scope: any) => removeHtml(scope.row.content) } },
|
||||||
{ field: 'createTime', title: '创建时间', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'type', title: '类型', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_type' } },
|
||||||
{ field: 'status', title: '状态', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'createTime', title: '创建时间', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'publicUserName', title: '发布者', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'status', title: '状态', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ field: 'publicTime', title: '发布时间', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'publicUserName', title: '发布者', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'publicTime', title: '发布时间', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 180, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 180, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysNotice:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageNoticeInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysNoticeApi).apiSysNoticePagePost(params);
|
return getAPI(SysNoticeApi).apiSysNoticePagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.title = undefined;
|
state.queryParams.title = undefined;
|
||||||
state.queryParams.type = undefined;
|
state.queryParams.type = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -202,6 +184,20 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysNotice> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 发布
|
// 发布
|
||||||
const handlePublic = (row: any) => {
|
const handlePublic = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定发布通知公告:【${row.title}】,不可撤销?`, '提示', {
|
ElMessageBox.confirm(`确定发布通知公告:【${row.title}】,不可撤销?`, '提示', {
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="微信昵称" prop="nickName">
|
<el-form-item label="微信昵称" prop="nickName">
|
||||||
<el-input v-model="state.queryParams.nickName" placeholder="微信昵称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.nickName" placeholder="微信昵称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="手机号码" prop="mobile">
|
<el-form-item label="手机号码" prop="mobile">
|
||||||
<el-input v-model="state.queryParams.mobile" placeholder="手机号码" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.mobile" placeholder="手机号码" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysOAuthUser:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysOAuthUser:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons> </template>
|
<template #toolbar_buttons> </template>
|
||||||
<template #toolbar_tools> </template>
|
<template #toolbar_tools> </template>
|
||||||
<template #empty>
|
<template #empty>
|
||||||
@ -61,15 +61,6 @@
|
|||||||
<el-button icon="ele-Delete" size="small" text type="danger" @click="handleDelete(row)" v-auth="'sysOAuthUser:delete'" :disabled="row.status === 1" />
|
<el-button icon="ele-Delete" size="small" text type="danger" @click="handleDelete(row)" v-auth="'sysOAuthUser:delete'" :disabled="row.status === 1" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -81,15 +72,16 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditOAuthUser from '/@/views/system/oAuthUser/component/editOAuthUser.vue';
|
import EditOAuthUser from '/@/views/system/oAuthUser/component/editOAuthUser.vue';
|
||||||
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysOAuthUserApi } from '/@/api-services/api';
|
import { SysOAuthUserApi } from '/@/api-services/api';
|
||||||
import { SysOAuthUser } from '/@/api-services/models';
|
import { SysOAuthUser, OAuthUserInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editOAuthUserRef = ref<InstanceType<typeof EditOAuthUser>>();
|
const editOAuthUserRef = ref<InstanceType<typeof EditOAuthUser>>();
|
||||||
@ -98,81 +90,71 @@ const state = reactive({
|
|||||||
nickName: undefined,
|
nickName: undefined,
|
||||||
mobile: undefined,
|
mobile: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:weChatUser';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysOAuthUser>({
|
const options = useVxeTable<SysOAuthUser>(
|
||||||
id: 'weChatUser',
|
{
|
||||||
name: '三方账号',
|
id: 'weChatUser',
|
||||||
columns: [
|
name: '三方账号',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'openId', title: 'OpenId', minWidth: 200, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'unionId', title: 'UnionId', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'openId', title: 'OpenId', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'platformType', title: '平台类型', minWidth: 110, showOverflow: 'tooltip', slots: { default: 'row_platformType' } },
|
{ field: 'unionId', title: 'UnionId', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'nickName', title: '昵称', minWidth: 160, showOverflow: 'tooltip' },
|
{ field: 'platformType', title: '平台类型', minWidth: 110, showOverflow: 'tooltip', slots: { default: 'row_platformType' } },
|
||||||
{ field: 'avatar', title: '头像', minWidth: 70, slots: { default: 'row_avatar' } },
|
{ field: 'nickName', title: '昵称', minWidth: 160, showOverflow: 'tooltip' },
|
||||||
{ field: 'mobile', title: '手机号码', minWidth: 160, showOverflow: 'tooltip' },
|
{ field: 'avatar', title: '头像', minWidth: 70, slots: { default: 'row_avatar' } },
|
||||||
{ field: 'sex', title: '性别', minWidth: 60, showOverflow: 'tooltip', slots: { default: 'row_sex' } },
|
{ field: 'mobile', title: '手机号码', minWidth: 160, showOverflow: 'tooltip' },
|
||||||
{ field: 'city', title: '城市', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'sex', title: '性别', minWidth: 60, showOverflow: 'tooltip', slots: { default: 'row_sex' } },
|
||||||
{ field: 'province', title: '省', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'city', title: '城市', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'country', title: '国家', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'province', title: '省', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: 'country', title: '国家', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysOAuthUser:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as OAuthUserInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysOAuthUserApi).apiSysOAuthUserPagePost(params);
|
return getAPI(SysOAuthUserApi).apiSysOAuthUserPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.nickName = undefined;
|
state.queryParams.nickName = undefined;
|
||||||
state.queryParams.mobile = undefined;
|
state.queryParams.mobile = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开编辑页面
|
// 打开编辑页面
|
||||||
@ -195,4 +177,18 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysOAuthUser> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -12,12 +12,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
||||||
<el-form-item label="账号" prop="userName">
|
<el-form-item label="账号" prop="userName">
|
||||||
<el-input v-model="state.queryParams.userName" placeholder="账号" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.userName" placeholder="账号" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
||||||
<el-form-item label="姓名" prop="realName">
|
<el-form-item label="姓名" prop="realName">
|
||||||
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons> </template>
|
<template #toolbar_buttons> </template>
|
||||||
<template #toolbar_tools> </template>
|
<template #toolbar_tools> </template>
|
||||||
<template #empty>
|
<template #empty>
|
||||||
@ -50,15 +50,6 @@
|
|||||||
<el-button icon="ele-CircleCloseFilled" text type="danger" v-auth="'sysOnlineUser:forceOffline'" @click="forceOffline(row)"> </el-button>
|
<el-button icon="ele-CircleCloseFilled" text type="danger" v-auth="'sysOnlineUser:forceOffline'" @click="forceOffline(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
@ -72,14 +63,15 @@ import { onMounted, reactive, ref } from 'vue';
|
|||||||
import { ElMessageBox, ElNotification } from 'element-plus';
|
import { ElMessageBox, ElNotification } from 'element-plus';
|
||||||
import { throttle } from 'lodash-es';
|
import { throttle } from 'lodash-es';
|
||||||
import { signalR } from './signalR';
|
import { signalR } from './signalR';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import SendMessage from '/@/views/system/onlineUser/component/sendMessage.vue';
|
import SendMessage from '/@/views/system/onlineUser/component/sendMessage.vue';
|
||||||
|
|
||||||
import { getAPI, clearAccessTokens } from '/@/utils/axios-utils';
|
import { getAPI, clearAccessTokens } from '/@/utils/axios-utils';
|
||||||
import { SysOnlineUserApi, SysAuthApi } from '/@/api-services/api';
|
import { SysOnlineUserApi, SysAuthApi } from '/@/api-services/api';
|
||||||
import { SysOnlineUser } from '/@/api-services/models';
|
import { SysOnlineUser, PageOnlineUserInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const sendMessageRef = ref<InstanceType<typeof SendMessage>>();
|
const sendMessageRef = ref<InstanceType<typeof SendMessage>>();
|
||||||
@ -89,13 +81,9 @@ const state = reactive({
|
|||||||
userName: undefined,
|
userName: undefined,
|
||||||
realName: undefined,
|
realName: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
onlineUserList: [] as Array<SysOnlineUser>, // 在线用户列表
|
onlineUserList: [] as Array<SysOnlineUser>, // 在线用户列表
|
||||||
lastUserState: {
|
lastUserState: {
|
||||||
@ -104,28 +92,41 @@ const state = reactive({
|
|||||||
}, // 最后接收的用户变更状态信息
|
}, // 最后接收的用户变更状态信息
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysOnlineUser';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysOnlineUser>({
|
const options = useVxeTable<SysOnlineUser>(
|
||||||
id: 'sysOnlineUser',
|
{
|
||||||
name: '在线用户',
|
id: 'sysOnlineUser',
|
||||||
columns: [
|
name: '在线用户',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 50, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'userName', title: '账号', minWidth: 110, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 50, fixed: 'left' },
|
||||||
{ field: 'realName', title: '姓名', minWidth: 110, showOverflow: 'tooltip' },
|
{ field: 'userName', title: '账号', minWidth: 110, showOverflow: 'tooltip' },
|
||||||
{ field: 'ip', title: 'IP地址', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'realName', title: '姓名', minWidth: 110, showOverflow: 'tooltip' },
|
||||||
{ field: 'browser', title: '浏览器', minWidth: 160, showOverflow: 'tooltip' },
|
{ field: 'ip', title: 'IP地址', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
// { field: 'connectionId', title: '连接Id', minWidth: 160, showOverflow: 'tooltip', sortable: true },
|
{ field: 'browser', title: '浏览器', minWidth: 160, showOverflow: 'tooltip' },
|
||||||
{ field: 'time', title: '登录时间', minWidth: 120, showOverflow: 'tooltip' },
|
// { field: 'connectionId', title: '连接Id', minWidth: 160, showOverflow: 'tooltip', sortable: true },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: 'time', title: '登录时间', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: true,
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
// 在线用户列表
|
// 在线用户列表
|
||||||
signalR.off('OnlineUserList');
|
signalR.off('OnlineUserList');
|
||||||
signalR.on('OnlineUserList', (data: any) => {
|
signalR.on('OnlineUserList', (data: any) => {
|
||||||
@ -170,20 +171,15 @@ const openDrawer = () => {
|
|||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageOnlineUserInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
return getAPI(SysOnlineUserApi).apiSysOnlineUserPagePost(params);
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取数据
|
// 查询操作
|
||||||
const fetchData = async (tableParams: any) => {
|
const handleQuery = async () => {
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
await xGrid.value?.commitProxy('query');
|
||||||
return getAPI(SysOnlineUserApi).apiSysOnlineUserPagePost(params);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
@ -213,18 +209,18 @@ const forceOffline = async (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
// 表格事件
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
const gridEvents: VxeGridListeners<SysOnlineUser> = {
|
||||||
state.tableParams.page = currentPage;
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
state.tableParams.pageSize = pageSize;
|
async pageChange({ pageSize }) {
|
||||||
handleQuery();
|
state.localPageParam.pageSize = pageSize;
|
||||||
};
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
// 列排序
|
// 当排序条件发生变化时会触发该事件
|
||||||
const sortChange = (options: any) => {
|
async sortChange({ field, order }) {
|
||||||
state.tableParams.field = options.field;
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
state.tableParams.order = options.order;
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
handleQuery();
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 导出对象
|
// 导出对象
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="身份标识" prop="accessKey">
|
<el-form-item label="身份标识" prop="accessKey">
|
||||||
<el-input v-model="state.queryParams.accessKey" placeholder="身份标识" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.accessKey" placeholder="身份标识" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysOpenAccess:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysOpenAccess:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysOpenAccess:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysOpenAccess:add'"> 新增 </el-button>
|
||||||
<el-button icon="ele-QuestionFilled" @click="openHelp"> 说明 </el-button>
|
<el-button icon="ele-QuestionFilled" @click="openHelp"> 说明 </el-button>
|
||||||
@ -47,15 +47,6 @@
|
|||||||
<el-button icon="ele-EditPen" size="small" text type="warning" @click="handleSign(row)" />
|
<el-button icon="ele-EditPen" size="small" text type="warning" @click="handleSign(row)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -69,8 +60,9 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditOpenAccess from '/@/views/system/openAccess/component/editOpenAccess.vue';
|
import EditOpenAccess from '/@/views/system/openAccess/component/editOpenAccess.vue';
|
||||||
import HelpView from '/@/views/system/openAccess/component/helpView.vue';
|
import HelpView from '/@/views/system/openAccess/component/helpView.vue';
|
||||||
@ -79,7 +71,7 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
|||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysOpenAccessApi } from '/@/api-services/api';
|
import { SysOpenAccessApi } from '/@/api-services/api';
|
||||||
import { OpenAccessOutput } from '/@/api-services/models';
|
import { PageOpenAccessInput, OpenAccessOutput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editRef = ref<InstanceType<typeof EditOpenAccess>>();
|
const editRef = ref<InstanceType<typeof EditOpenAccess>>();
|
||||||
@ -90,75 +82,65 @@ const state = reactive({
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
accessKey: undefined,
|
accessKey: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysOpenAccess';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<OpenAccessOutput>({
|
const options = useVxeTable<OpenAccessOutput>(
|
||||||
id: 'sysOpenAccess',
|
{
|
||||||
name: '开发接口身份',
|
id: 'sysOpenAccess',
|
||||||
columns: [
|
name: '开发接口身份',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'accessKey', title: '身份标识', minWidth: 200, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'accessSecret', title: '密钥', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'accessKey', title: '身份标识', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'bindUserAccount', title: '绑定用户账号', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'accessSecret', title: '密钥', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'bindTenantName', title: '绑定租户名称', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'bindUserAccount', title: '绑定用户账号', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'bindTenantName', title: '绑定租户名称', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', minWidth: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', minWidth: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysOpenAccess:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageOpenAccessInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysOpenAccessApi).apiSysOpenAccessPagePost(params);
|
return getAPI(SysOpenAccessApi).apiSysOpenAccessPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.accessKey = undefined;
|
state.queryParams.accessKey = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -188,6 +170,20 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<OpenAccessOutput> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 打开说明页面
|
// 打开说明页面
|
||||||
const openHelp = () => {
|
const openHelp = () => {
|
||||||
helpRef.value?.openDialog();
|
helpRef.value?.openDialog();
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px; flex: 1">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px; flex: 1">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" :tree-config="{}">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysOrg:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysOrg:add'"> 新增 </el-button>
|
||||||
<el-button-group style="padding-left: 12px">
|
<el-button-group style="padding-left: 12px">
|
||||||
@ -82,8 +82,8 @@
|
|||||||
import { onMounted, reactive, ref, nextTick } from 'vue';
|
import { onMounted, reactive, ref, nextTick } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
|
||||||
import OrgTree from '/@/views/system/org/component/orgTree.vue';
|
import OrgTree from '/@/views/system/org/component/orgTree.vue';
|
||||||
import EditOrg from '/@/views/system/org/component/editOrg.vue';
|
import EditOrg from '/@/views/system/org/component/editOrg.vue';
|
||||||
@ -125,11 +125,19 @@ const options = useVxeTable<SysOrg>(
|
|||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
],
|
],
|
||||||
enableExport: auth('sysOrg:export'),
|
|
||||||
searchCallback: () => handleQuery(),
|
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
|
||||||
},
|
},
|
||||||
{ stripe: false, checkboxConfig: { range: false } }
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
stripe: false,
|
||||||
|
checkboxConfig: { range: false },
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: () => handleQueryApi() } },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { enabled: false },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
treeConfig: { expandAll: false },
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
@ -143,10 +151,16 @@ onMounted(async () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 查询api
|
||||||
|
const handleQueryApi = async () => {
|
||||||
|
const params = Object.assign(state.queryParams);
|
||||||
|
return getAPI(SysOrgApi).apiSysOrgListGet(params.id, params.name, params.code, params.type);
|
||||||
|
};
|
||||||
|
|
||||||
// 查询操作
|
// 查询操作
|
||||||
const handleQuery = async (updateTree: boolean = false) => {
|
const handleQuery = async (updateTree: boolean = false) => {
|
||||||
options.loading = true;
|
options.loading = true;
|
||||||
var res = await fetchData(null);
|
var res = await handleQueryApi();
|
||||||
xGrid.value?.loadData(res.data.result ?? []);
|
xGrid.value?.loadData(res.data.result ?? []);
|
||||||
options.loading = false;
|
options.loading = false;
|
||||||
// 是否更新左侧机构列表树
|
// 是否更新左侧机构列表树
|
||||||
@ -159,19 +173,13 @@ const handleQuery = async (updateTree: boolean = false) => {
|
|||||||
state.treeData = res.data.result ?? [];
|
state.treeData = res.data.result ?? [];
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, tableParams);
|
|
||||||
return getAPI(SysOrgApi).apiSysOrgListGet(params.id, params.name, params.code, params.type);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = async () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.id = 0;
|
state.queryParams.id = 0;
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
state.queryParams.code = undefined;
|
state.queryParams.code = undefined;
|
||||||
state.queryParams.type = undefined;
|
state.queryParams.type = undefined;
|
||||||
await handleQuery();
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -201,6 +209,14 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysOrg> = {
|
||||||
|
// 只对 proxy-config.ajax.query 配置时有效,当手动点击查询时会触发该事件
|
||||||
|
async proxyQuery() {
|
||||||
|
state.treeData = xGrid.value?.getTableData().tableData ?? [];
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 树组件点击
|
// 树组件点击
|
||||||
const handleNodeChange = async (node: any) => {
|
const handleNodeChange = async (node: any) => {
|
||||||
state.queryParams.id = node.id;
|
state.queryParams.id = node.id;
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="功能名称" pro="name">
|
<el-form-item label="功能名称" pro="name">
|
||||||
<el-input v-model="state.queryParams.name" placeholder="功能名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.name" placeholder="功能名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysPlugin:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysPlugin:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysPlugin:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysPlugin:add'"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -47,15 +47,6 @@
|
|||||||
<el-button icon="ele-Delete" text type="danger" v-auth="'sysPlugin:delete'" @click="handleDelete(row)"> </el-button>
|
<el-button icon="ele-Delete" text type="danger" v-auth="'sysPlugin:delete'" @click="handleDelete(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -67,15 +58,16 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditPlugin from '/@/views/system/plugin/component/editPlugin.vue';
|
import EditPlugin from '/@/views/system/plugin/component/editPlugin.vue';
|
||||||
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysPluginApi } from '/@/api-services/api';
|
import { SysPluginApi } from '/@/api-services/api';
|
||||||
import { SysPlugin } from '/@/api-services/models';
|
import { SysPlugin, PagePluginInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editPluginRef = ref<InstanceType<typeof EditPlugin>>();
|
const editPluginRef = ref<InstanceType<typeof EditPlugin>>();
|
||||||
@ -83,76 +75,66 @@ const state = reactive({
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
name: undefined,
|
name: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysPlugin';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysPlugin>({
|
const options = useVxeTable<SysPlugin>(
|
||||||
id: 'sysPlugin',
|
{
|
||||||
name: '插件信息',
|
id: 'sysPlugin',
|
||||||
columns: [
|
name: '插件信息',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'name', title: '功能名称', minWidth: 200, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'assemblyName', title: '程序集名称', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'name', title: '功能名称', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
{ field: 'assemblyName', title: '程序集名称', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysPlugin:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PagePluginInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysPluginApi).apiSysPluginPagePost(params);
|
return getAPI(SysPluginApi).apiSysPluginPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -181,4 +163,18 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysPlugin> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="职位名称" prop="name">
|
<el-form-item label="职位名称" prop="name">
|
||||||
<el-input v-model="state.queryParams.name" placeholder="职位名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.name" placeholder="职位名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="职位编码" prop="code">
|
<el-form-item label="职位编码" prop="code">
|
||||||
<el-input v-model="state.queryParams.code" placeholder="职位编码" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.code" placeholder="职位编码" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysPos:page'"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysPos:page'"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysPos:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysPos:add'"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -52,15 +52,6 @@
|
|||||||
<el-button icon="ele-Delete" text type="danger" v-auth="'sysPos:delete'" @click="handleDelete(row)"> </el-button>
|
<el-button icon="ele-Delete" text type="danger" v-auth="'sysPos:delete'" @click="handleDelete(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -71,15 +62,16 @@
|
|||||||
<script lang="ts" setup name="sysPos">
|
<script lang="ts" setup name="sysPos">
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditPos from '/@/views/system/pos/component/editPos.vue';
|
import EditPos from '/@/views/system/pos/component/editPos.vue';
|
||||||
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysPosApi } from '/@/api-services/api';
|
import { SysPosApi } from '/@/api-services/api';
|
||||||
import { PosOutput } from '/@/api-services/models';
|
import { PagePosOutput, PagePosInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editPosRef = ref<InstanceType<typeof EditPos>>();
|
const editPosRef = ref<InstanceType<typeof EditPos>>();
|
||||||
@ -88,76 +80,68 @@ const state = reactive({
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
code: undefined,
|
code: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysPos';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<PosOutput>({
|
const options = useVxeTable<PagePosOutput>(
|
||||||
id: 'sysPos',
|
{
|
||||||
name: '职位',
|
id: 'sysPos',
|
||||||
columns: [
|
name: '职位',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'name', title: '职位名称', minWidth: 200, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'code', title: '职位编码', minWidth: 200, showOverflow: 'tooltip' },
|
{ field: 'name', title: '职位名称', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
{ field: 'code', title: '职位编码', minWidth: 200, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
searchCallback: () => handleQuery(),
|
],
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
},
|
||||||
});
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PagePosInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysPosApi).apiSysPosPagePost(params);
|
return getAPI(SysPosApi).apiSysPosPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
// 调用vxe-grid的commitProxy(query)方法,触发表格重新加载数据
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.code = undefined;
|
state.queryParams.code = undefined;
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -186,4 +170,18 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<PagePosOutput> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="模板名称" prop="name">
|
<el-form-item label="模板名称" prop="name">
|
||||||
<el-input v-model="state.queryParams.name" placeholder="模板名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.name" placeholder="模板名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysPrint:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysPrint:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysPrint:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysPrint:add'"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -47,15 +47,6 @@
|
|||||||
<el-button icon="ele-Delete" text type="danger" v-auth="'sysPrint:delete'" @click="handleDelete(row)"> </el-button>
|
<el-button icon="ele-Delete" text type="danger" v-auth="'sysPrint:delete'" @click="handleDelete(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -67,15 +58,16 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditPrint from '/@/views/system/print/component/editPrint.vue';
|
import EditPrint from '/@/views/system/print/component/editPrint.vue';
|
||||||
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysPrintApi } from '/@/api-services/api';
|
import { SysPrintApi } from '/@/api-services/api';
|
||||||
import { SysPrint } from '/@/api-services/models';
|
import { SysPrint, PagePrintInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editPrintRef = ref<InstanceType<typeof EditPrint>>();
|
const editPrintRef = ref<InstanceType<typeof EditPrint>>();
|
||||||
@ -83,78 +75,68 @@ const state = reactive({
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
name: undefined,
|
name: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysPrint';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysPrint>({
|
const options = useVxeTable<SysPrint>(
|
||||||
id: 'sysPrint',
|
{
|
||||||
name: '打印信息',
|
id: 'sysPrint',
|
||||||
columns: [
|
name: '打印信息',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'name', title: '名称', minWidth: 250, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
// { field: 'template', title: '模板', minWidth: 200, showOverflow: 'tooltip', sortable: true },
|
{ field: 'name', title: '名称', minWidth: 250, showOverflow: 'tooltip' },
|
||||||
{ field: 'createTime', title: '修改时间', minWidth: 150, showOverflow: 'tooltip' },
|
// { field: 'template', title: '模板', minWidth: 200, showOverflow: 'tooltip', sortable: true },
|
||||||
{ field: 'remark', title: '备注', minWidth: 250, showOverflow: 'tooltip' },
|
{ field: 'createTime', title: '修改时间', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
{ field: 'remark', title: '备注', minWidth: 250, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', width: 100, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'status', title: '状态', width: 100, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysPrint:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PagePrintInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysPrintApi).apiSysPrintPagePost(params);
|
return getAPI(SysPrintApi).apiSysPrintPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -178,9 +160,23 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysPrintApi).apiSysPrintDeletePost({ id: row.id });
|
await getAPI(SysPrintApi).apiSysPrintDeletePost({ id: row.id });
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysPrint> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -11,12 +11,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
||||||
<el-form-item label="行政名称" prop="name">
|
<el-form-item label="行政名称" prop="name">
|
||||||
<el-input v-model="state.queryParams.name" placeholder="行政名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.name" placeholder="行政名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
||||||
<el-form-item label="行政代码" prop="code">
|
<el-form-item label="行政代码" prop="code">
|
||||||
<el-input v-model="state.queryParams.code" placeholder="行政代码" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.code" placeholder="行政代码" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysRegion:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysRegion:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px; flex: 1">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px; flex: 1">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" :tree-config="{ transform: true, parentField: 'pid' }" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents" :tree-config="{ transform: true, parentField: 'pid' }">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysRegion:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysRegion:add'"> 新增 </el-button>
|
||||||
<el-button type="danger" icon="ele-Lightning" @click="handlSync" v-auth="'sysRegion:add'"> 同步统计局 </el-button>
|
<el-button type="danger" icon="ele-Lightning" @click="handlSync" v-auth="'sysRegion:add'"> 同步统计局 </el-button>
|
||||||
@ -56,15 +56,6 @@
|
|||||||
<el-button icon="ele-Delete" text type="danger" v-auth="'sysRegion:delete'" @click="handleDelete(row)"> </el-button>
|
<el-button icon="ele-Delete" text type="danger" v-auth="'sysRegion:delete'" @click="handleDelete(row)"> </el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -78,15 +69,16 @@
|
|||||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
import { nextTick, onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage, ElNotification } from 'element-plus';
|
import { ElMessageBox, ElMessage, ElNotification } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import RegionTree from '/@/views/system/region/component/regionTree.vue';
|
import RegionTree from '/@/views/system/region/component/regionTree.vue';
|
||||||
import EditRegion from '/@/views/system/region/component/editRegion.vue';
|
import EditRegion from '/@/views/system/region/component/editRegion.vue';
|
||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysRegionApi } from '/@/api-services/api';
|
import { SysRegionApi } from '/@/api-services/api';
|
||||||
import { SysRegion } from '/@/api-services/models';
|
import { SysRegion, PageRegionInput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editRegionRef = ref<InstanceType<typeof EditRegion>>();
|
const editRegionRef = ref<InstanceType<typeof EditRegion>>();
|
||||||
@ -98,40 +90,49 @@ const state = reactive({
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
code: undefined,
|
code: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysRegion';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysRegion>({
|
const options = useVxeTable<SysRegion>(
|
||||||
id: 'sysRegion',
|
{
|
||||||
name: '区域信息',
|
id: 'sysRegion',
|
||||||
columns: [
|
name: '区域信息',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 100, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'name', title: '行政名称', minWidth: 280, showOverflow: 'tooltip', treeNode: true },
|
{ type: 'seq', title: '序号', width: 100, fixed: 'left' },
|
||||||
{ field: 'code', title: '行政代码', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'name', title: '行政名称', minWidth: 280, showOverflow: 'tooltip', treeNode: true },
|
||||||
{ field: 'cityCode', title: '区号', minWidth: 100, showOverflow: 'tooltip' },
|
{ field: 'code', title: '行政代码', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'orderNo', title: '排序', minWidth: 80, showOverflow: 'tooltip' },
|
{ field: 'cityCode', title: '区号', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
{ field: 'createTime', title: '修改时间', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'orderNo', title: '排序', minWidth: 80, showOverflow: 'tooltip' },
|
||||||
{ field: 'remark', title: '备注', minWidth: 300, showOverflow: 'tooltip' },
|
{ field: 'createTime', title: '修改时间', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: 'remark', title: '备注', minWidth: 300, showOverflow: 'tooltip' },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 100, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysRegion:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
// 展开表格所有数据,数据量大时请勿开启
|
// 展开表格所有数据,数据量大时请勿开启
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@ -141,43 +142,24 @@ onMounted(async () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageRegionInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysRegionApi).apiSysRegionPagePost(params);
|
return getAPI(SysRegionApi).apiSysRegionPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.id = -1;
|
state.queryParams.id = -1;
|
||||||
state.queryParams.pid = undefined;
|
state.queryParams.pid = undefined;
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
state.queryParams.code = undefined;
|
state.queryParams.code = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -201,7 +183,7 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysRegionApi).apiSysRegionDeletePost({ id: row.id });
|
await getAPI(SysRegionApi).apiSysRegionDeletePost({ id: row.id });
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
// 编辑删除后更新机构数据
|
// 编辑删除后更新机构数据
|
||||||
regionTreeRef.value?.fetchTreeData();
|
regionTreeRef.value?.fetchTreeData();
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
@ -209,12 +191,26 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<SysRegion> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 树组件点击
|
// 树组件点击
|
||||||
const handleNodeChange = async (node: any) => {
|
const handleNodeChange = async (node: any) => {
|
||||||
state.queryParams.pid = node.id;
|
state.queryParams.pid = node.id;
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
state.queryParams.code = undefined;
|
state.queryParams.code = undefined;
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 同步国家统计局操作
|
// 同步国家统计局操作
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="角色名称" prop="name">
|
<el-form-item label="角色名称" prop="name">
|
||||||
<el-input v-model="state.queryParams.name" placeholder="角色名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.name" placeholder="角色名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="角色编码" prop="code">
|
<el-form-item label="角色编码" prop="code">
|
||||||
<el-input v-model="state.queryParams.code" placeholder="角色编码" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.code" placeholder="角色编码" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysRole:page'"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysRole:page'"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysRole:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysRole:add'"> 新增 </el-button>
|
||||||
<el-button type="primary" icon="ele-Link" @click="openBaseApi" plain> 设置基础接口资源 </el-button>
|
<el-button type="primary" icon="ele-Link" @click="openBaseApi" plain> 设置基础接口资源 </el-button>
|
||||||
@ -62,15 +62,6 @@
|
|||||||
<el-button icon="ele-Link" size="small" text type="primary" @click="openGrantApi(row)" v-auth="'sysRole:grantApi'"> 接口资源 </el-button>
|
<el-button icon="ele-Link" size="small" text type="primary" @click="openGrantApi(row)" v-auth="'sysRole:grantApi'"> 接口资源 </el-button>
|
||||||
<el-button icon="ele-OfficeBuilding" size="small" text type="primary" @click="openGrantData(row)" v-auth="'sysRole:grantDataScope'">数据范围</el-button>
|
<el-button icon="ele-OfficeBuilding" size="small" text type="primary" @click="openGrantData(row)" v-auth="'sysRole:grantDataScope'">数据范围</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -85,8 +76,9 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditRole from '/@/views/system/role/component/editRole.vue';
|
import EditRole from '/@/views/system/role/component/editRole.vue';
|
||||||
import GrantData from '/@/views/system/role/component/grantData.vue';
|
import GrantData from '/@/views/system/role/component/grantData.vue';
|
||||||
@ -96,7 +88,7 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
|||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysRoleApi } from '/@/api-services/api';
|
import { SysRoleApi } from '/@/api-services/api';
|
||||||
import { PageRoleOutput } from '/@/api-services/models';
|
import { PageRoleInput, PageRoleOutput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editRoleRef = ref<InstanceType<typeof EditRole>>();
|
const editRoleRef = ref<InstanceType<typeof EditRole>>();
|
||||||
@ -108,78 +100,69 @@ const state = reactive({
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
code: undefined,
|
code: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysRole';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<PageRoleOutput>({
|
const options = useVxeTable<PageRoleOutput>(
|
||||||
id: 'sysRole',
|
{
|
||||||
name: '角色',
|
id: 'sysRole',
|
||||||
columns: [
|
name: '角色',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'name', title: '角色名称', minWidth: 150, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'code', title: '角色编码', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'name', title: '角色名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'dataScope', title: '数据范围', minWidth: 150, showOverflow: 'tooltip', slots: { default: 'row_dataScope' } },
|
{ field: 'code', title: '角色编码', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'tenantName', title: '租户名称', minWidth: 180, showOverflow: 'tooltip' },
|
{ field: 'dataScope', title: '数据范围', minWidth: 150, showOverflow: 'tooltip', slots: { default: 'row_dataScope' } },
|
||||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
{ field: 'tenantName', title: '租户名称', minWidth: 180, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ title: '操作', fixed: 'right', width: 280, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 280, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
searchCallback: () => handleQuery(),
|
],
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
},
|
||||||
});
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
if (reset) state.tableParams.page = 1;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageRoleInput;
|
||||||
options.loading = true;
|
return getAPI(SysRoleApi).apiSysRolePagePost(params);
|
||||||
var res = await fetchData(null);
|
|
||||||
await xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取数据
|
// 查询操作
|
||||||
const fetchData = async (tableParams: any) => {
|
const handleQuery = async () => {
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
await xGrid.value?.commitProxy('query');
|
||||||
return getAPI(SysRoleApi).apiSysRolePagePost(params);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = async () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.code = undefined;
|
state.queryParams.code = undefined;
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
await handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = async ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
await handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = async (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
await handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -209,6 +192,20 @@ const handleDelete = (row: any) => {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<PageRoleOutput> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 打开授权数据范围页面
|
// 打开授权数据范围页面
|
||||||
const openGrantData = (row: any) => {
|
const openGrantData = (row: any) => {
|
||||||
grantDataRef.value?.openDialog(row);
|
grantDataRef.value?.openDialog(row);
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="租户名称" prop="name">
|
<el-form-item label="租户名称" prop="name">
|
||||||
<el-input v-model="state.queryParams.name" placeholder="租户名称" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.name" placeholder="租户名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="联系电话" prop="code">
|
<el-form-item label="联系电话" prop="code">
|
||||||
<el-input v-model="state.queryParams.phone" placeholder="联系电话" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.phone" placeholder="联系电话" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysTenant:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysTenant:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @cell-dblclick="handleEdit" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button icon="ele-Plus" type="primary" @click="handleAdd" v-auth="'sysTenant:add'"> 新增 </el-button>
|
<el-button icon="ele-Plus" type="primary" @click="handleAdd" v-auth="'sysTenant:add'"> 新增 </el-button>
|
||||||
<el-button type="danger" icon="ele-Refresh" @click="syncTenantDb" plain> 同步所有租户数据库 </el-button>
|
<el-button type="danger" icon="ele-Refresh" @click="syncTenantDb" plain> 同步所有租户数据库 </el-button>
|
||||||
@ -89,15 +89,6 @@
|
|||||||
<el-button icon="ele-Menu" size="small" text type="primary" @click="openGrantMenu(row)" :v-auth="'sysTenant:grantMenu'"> 授权菜单 </el-button>
|
<el-button icon="ele-Menu" size="small" text type="primary" @click="openGrantMenu(row)" :v-auth="'sysTenant:grantMenu'"> 授权菜单 </el-button>
|
||||||
<el-button icon="ele-Link" size="small" text type="primary" @click="openGrantApi(row)"> 授权接口 </el-button>
|
<el-button icon="ele-Link" size="small" text type="primary" @click="openGrantApi(row)"> 授权接口 </el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -111,8 +102,9 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage, ElButton } from 'element-plus';
|
import { ElMessageBox, ElMessage, ElButton } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
import EditTenant from '/@/views/system/tenant/component/editTenant.vue';
|
import EditTenant from '/@/views/system/tenant/component/editTenant.vue';
|
||||||
import GrantMenu from '/@/views/system/tenant/component/grantMenu.vue';
|
import GrantMenu from '/@/views/system/tenant/component/grantMenu.vue';
|
||||||
@ -121,7 +113,7 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
|||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysTenantApi } from '/@/api-services/api';
|
import { SysTenantApi } from '/@/api-services/api';
|
||||||
import { TenantOutput } from '/@/api-services/models';
|
import { PageTenantInput, TenantOutput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const editTenantRef = ref<InstanceType<typeof EditTenant>>();
|
const editTenantRef = ref<InstanceType<typeof EditTenant>>();
|
||||||
@ -132,84 +124,74 @@ const state = reactive({
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 20 as number,
|
||||||
pageSize: 10,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'createTime', // 默认的排序字段
|
|
||||||
order: 'desc', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysTenant';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<TenantOutput>({
|
const options = useVxeTable<TenantOutput>(
|
||||||
id: 'sysTenant',
|
{
|
||||||
name: '租户信息',
|
id: 'sysTenant',
|
||||||
columns: [
|
name: '租户信息',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'name', title: '租户名称', minWidth: 160, showOverflow: 'tooltip' },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'adminAccount', title: '租管账号', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'name', title: '租户名称', minWidth: 160, showOverflow: 'tooltip' },
|
||||||
{ field: 'phone', title: '电话', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'adminAccount', title: '租管账号', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'host', title: '主机', showOverflow: 'tooltip' },
|
{ field: 'phone', title: '电话', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'email', title: '邮箱', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'host', title: '主机', showOverflow: 'tooltip' },
|
||||||
{ field: 'tenantType', title: '租户类型', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_tenantType' } },
|
{ field: 'email', title: '邮箱', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', minWidth: 100, slots: { default: 'row_status' } },
|
{ field: 'tenantType', title: '租户类型', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_tenantType' } },
|
||||||
{ field: 'dbType', title: '数据库类型', minWidth: 120, showOverflow: 'tooltip', slots: { default: 'row_dbType' } },
|
{ field: 'status', title: '状态', minWidth: 100, slots: { default: 'row_status' } },
|
||||||
{ field: 'configId', title: '数据库标识', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'dbType', title: '数据库类型', minWidth: 120, showOverflow: 'tooltip', slots: { default: 'row_dbType' } },
|
||||||
{ field: 'connection', title: '数据库连接', minWidth: 300, showOverflow: 'tooltip' },
|
{ field: 'configId', title: '数据库标识', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'slaveConnections', title: '从库连接', showOverflow: 'tooltip' },
|
{ field: 'connection', title: '数据库连接', minWidth: 300, showOverflow: 'tooltip' },
|
||||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
{ field: 'slaveConnections', title: '从库连接', showOverflow: 'tooltip' },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 380, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 380, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysTenant:export'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageTenantInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysTenantApi).apiSysTenantPagePost(params);
|
return getAPI(SysTenantApi).apiSysTenantPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.name = undefined;
|
state.queryParams.name = undefined;
|
||||||
state.queryParams.phone = undefined;
|
state.queryParams.phone = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
@ -224,33 +206,6 @@ const handleEdit = (row: any) => {
|
|||||||
editTenantRef.value?.openDialog(row);
|
editTenantRef.value?.openDialog(row);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开授权菜单页面
|
|
||||||
const openGrantMenu = async (row: any) => {
|
|
||||||
grantMenuRef.value?.openDialog(row);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 打开授权接口页面
|
|
||||||
const openGrantApi = async (row: any) => {
|
|
||||||
grantApiRef.value?.openDrawer(row);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 重置密码
|
|
||||||
const resetTenantPwd = async (row: any) => {
|
|
||||||
ElMessageBox.confirm(`确定重置密码:【${row.name}】?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
await getAPI(SysTenantApi)
|
|
||||||
.apiSysTenantResetPwdPost({ userId: row.userId })
|
|
||||||
.then((res) => {
|
|
||||||
ElMessage.success(`密码重置成功为:${res.data.result}`);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const handleDelete = (row: any) => {
|
const handleDelete = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定删除租户:【${row.name}】?`, '提示', {
|
ElMessageBox.confirm(`确定删除租户:【${row.name}】?`, '提示', {
|
||||||
@ -260,12 +215,36 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysTenantApi).apiSysTenantDeletePost({ id: row.id });
|
await getAPI(SysTenantApi).apiSysTenantDeletePost({ id: row.id });
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<TenantOutput> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// 打开授权菜单页面
|
||||||
|
const openGrantMenu = async (row: any) => {
|
||||||
|
grantMenuRef.value?.openDialog(row);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 打开授权接口页面
|
||||||
|
const openGrantApi = async (row: any) => {
|
||||||
|
grantApiRef.value?.openDrawer(row);
|
||||||
|
};
|
||||||
|
|
||||||
// 创建租户库
|
// 创建租户库
|
||||||
const createTenant = (row: any) => {
|
const createTenant = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定创建/更新租户数据库:【${row.name}】?`, '提示', {
|
ElMessageBox.confirm(`确定创建/更新租户数据库:【${row.name}】?`, '提示', {
|
||||||
@ -293,6 +272,23 @@ const changeStatus = async (scope: any) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 重置密码
|
||||||
|
const resetTenantPwd = async (row: any) => {
|
||||||
|
ElMessageBox.confirm(`确定重置密码:【${row.name}】?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await getAPI(SysTenantApi)
|
||||||
|
.apiSysTenantResetPwdPost({ userId: row.userId })
|
||||||
|
.then((res) => {
|
||||||
|
ElMessage.success(`密码重置成功为:${res.data.result}`);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
// 同步所有租户数据库
|
// 同步所有租户数据库
|
||||||
const syncTenantDb = (row: any) => {
|
const syncTenantDb = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定同步所有租户数据库?`, '提示', {
|
ElMessageBox.confirm(`确定同步所有租户数据库?`, '提示', {
|
||||||
|
|||||||
@ -11,17 +11,17 @@
|
|||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="账号" prop="account">
|
<el-form-item label="账号" prop="account">
|
||||||
<el-input v-model="state.queryParams.account" placeholder="账号" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.account" placeholder="账号" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="姓名" prop="realName">
|
<el-form-item label="姓名" prop="realName">
|
||||||
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="手机号码" prop="phone">
|
<el-form-item label="手机号码" prop="phone">
|
||||||
<el-input v-model="state.queryParams.phone" placeholder="手机号码" clearable @keyup.enter.native="handleQuery(true)" />
|
<el-input v-model="state.queryParams.phone" placeholder="手机号码" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysUser:page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysUser:page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px; flex: 1">
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px; flex: 1">
|
||||||
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" @sort-change="sortChange">
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysUser:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="handleAdd" v-auth="'sysUser:add'"> 新增 </el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -78,15 +78,6 @@
|
|||||||
<el-button icon="ele-RefreshLeft" text type="danger" v-auth="'sysUser:resetPwd'" @click="resetQueryPwd(row)">重置密码</el-button>
|
<el-button icon="ele-RefreshLeft" text type="danger" v-auth="'sysUser:resetPwd'" @click="resetQueryPwd(row)">重置密码</el-button>
|
||||||
<el-button icon="ele-Unlock" text type="primary" v-auth="'sysUser:unlockLogin'" @click="handleUnlock(row)">解除锁定</el-button>
|
<el-button icon="ele-Unlock" text type="primary" v-auth="'sysUser:unlockLogin'" @click="handleUnlock(row)">解除锁定</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #pager>
|
|
||||||
<vxe-pager
|
|
||||||
:loading="options.loading"
|
|
||||||
v-model:current-page="state.tableParams.page"
|
|
||||||
v-model:page-size="state.tableParams.pageSize"
|
|
||||||
:total="state.tableParams.total"
|
|
||||||
@page-change="pageChange"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -100,8 +91,9 @@
|
|||||||
import { onMounted, reactive, ref, onActivated } from 'vue';
|
import { onMounted, reactive, ref, onActivated } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import { auth } from '/@/utils/authFunction';
|
import { auth } from '/@/utils/authFunction';
|
||||||
import { VxeGridInstance, VxePagerEvents, VxePagerDefines } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/vxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
import XEUtils from 'xe-utils';
|
import XEUtils from 'xe-utils';
|
||||||
|
|
||||||
import OrgTree from '/@/views/system/org/component/orgTree.vue';
|
import OrgTree from '/@/views/system/org/component/orgTree.vue';
|
||||||
@ -110,7 +102,7 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
|
|||||||
|
|
||||||
import { getAPI } from '/@/utils/axios-utils';
|
import { getAPI } from '/@/utils/axios-utils';
|
||||||
import { SysUserApi, SysOrgApi } from '/@/api-services/api';
|
import { SysUserApi, SysOrgApi } from '/@/api-services/api';
|
||||||
import { SysUser, SysOrg } from '/@/api-services/models';
|
import { SysOrg, PageTenantInput, UserOutput } from '/@/api-services/models';
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const treeRef = ref<InstanceType<typeof OrgTree>>();
|
const treeRef = ref<InstanceType<typeof OrgTree>>();
|
||||||
@ -123,48 +115,57 @@ const state = reactive({
|
|||||||
realName: undefined,
|
realName: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
},
|
},
|
||||||
tableParams: {
|
localPageParam: {
|
||||||
page: 1,
|
pageSize: 50 as number,
|
||||||
pageSize: 50,
|
defaultSort: { field: 'orderNo', order: 'asc', descStr: 'desc' },
|
||||||
field: 'id', // 默认的排序字段
|
|
||||||
order: 'aes', // 排序方向
|
|
||||||
descStr: 'desc', // 降序排序的关键字符
|
|
||||||
total: 0 as any,
|
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:sysUser';
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<SysUser>({
|
const options = useVxeTable<UserOutput>(
|
||||||
id: 'sysUser',
|
{
|
||||||
name: '账号',
|
id: 'sysUser',
|
||||||
columns: [
|
name: '账号',
|
||||||
// { type: 'checkbox', width: 40, fixed: 'left' },
|
columns: [
|
||||||
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
// { type: 'checkbox', width: 40, fixed: 'left' },
|
||||||
{ field: 'avatar', title: '头像', minWidth: 80, showOverflow: 'tooltip', slots: { default: 'row_avatar' } },
|
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
|
||||||
{ field: 'account', title: '账号', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'avatar', title: '头像', minWidth: 80, showOverflow: 'tooltip', slots: { default: 'row_avatar' } },
|
||||||
{ field: 'nickName', title: '昵称', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'account', title: '账号', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'realName', title: '姓名', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'nickName', title: '昵称', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'phone', title: '手机号码', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'realName', title: '姓名', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'birthday', title: '出生日期', minWidth: 100, showOverflow: 'tooltip', formatter: ({ cellValue }: any) => XEUtils.toDateString(cellValue, 'yyyy-MM-dd') },
|
{ field: 'phone', title: '手机号码', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'sex', title: '性别', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_sex' } },
|
{ field: 'birthday', title: '出生日期', minWidth: 100, showOverflow: 'tooltip', formatter: ({ cellValue }: any) => XEUtils.toDateString(cellValue, 'yyyy-MM-dd') },
|
||||||
{ field: 'accountType', title: '账号类型', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_accountType' } },
|
{ field: 'sex', title: '性别', minWidth: 70, showOverflow: 'tooltip', slots: { default: 'row_sex' } },
|
||||||
{ field: 'roleName', title: '角色集合', minWidth: 130, showOverflow: 'tooltip' },
|
{ field: 'accountType', title: '账号类型', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_accountType' } },
|
||||||
{ field: 'orgName', title: '所属机构', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'roleName', title: '角色集合', minWidth: 130, showOverflow: 'tooltip' },
|
||||||
{ field: 'posName', title: '职位名称', minWidth: 120, showOverflow: 'tooltip' },
|
{ field: 'orgName', title: '所属机构', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'posName', title: '职位名称', minWidth: 120, showOverflow: 'tooltip' },
|
||||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
||||||
{ title: '操作', fixed: 'right', width: 280, showOverflow: true, slots: { default: 'row_buttons' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
],
|
{ title: '操作', fixed: 'right', width: 280, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
enableExport: auth('sysUser:page'),
|
],
|
||||||
searchCallback: () => handleQuery(),
|
},
|
||||||
queryAllCallback: () => fetchData({ pageSize: 99999 }),
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
});
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 页面初始化
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
state.localPageParam = Local.get(localPageParamKey) || state.localPageParam;
|
||||||
fetchOrgData();
|
fetchOrgData();
|
||||||
await handleQuery();
|
await handleQuery();
|
||||||
});
|
});
|
||||||
@ -174,29 +175,24 @@ onActivated(async () => {
|
|||||||
await fetchOrgData();
|
await fetchOrgData();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询操作
|
// 查询api
|
||||||
const handleQuery = async (reset = false) => {
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
options.loading = true;
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' }) as PageTenantInput;
|
||||||
if (reset) state.tableParams.page = 1;
|
|
||||||
var res = await fetchData(null);
|
|
||||||
xGrid.value?.loadData(res.data.result?.items ?? []);
|
|
||||||
state.tableParams.total = res.data.result?.total;
|
|
||||||
options.loading = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取数据
|
|
||||||
const fetchData = async (tableParams: any) => {
|
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
|
||||||
return getAPI(SysUserApi).apiSysUserPagePost(params);
|
return getAPI(SysUserApi).apiSysUserPagePost(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async () => {
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = async () => {
|
||||||
state.queryParams.orgId = -1;
|
state.queryParams.orgId = -1;
|
||||||
state.queryParams.account = undefined;
|
state.queryParams.account = undefined;
|
||||||
state.queryParams.realName = undefined;
|
state.queryParams.realName = undefined;
|
||||||
state.queryParams.phone = undefined;
|
state.queryParams.phone = undefined;
|
||||||
handleQuery(true);
|
await xGrid.value?.commitProxy('reload');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 查询机构数据
|
// 查询机构数据
|
||||||
@ -205,20 +201,6 @@ const fetchOrgData = async () => {
|
|||||||
state.treeData = res.data.result ?? [];
|
state.treeData = res.data.result ?? [];
|
||||||
};
|
};
|
||||||
|
|
||||||
// 改变页码序号或页面容量
|
|
||||||
const pageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize }: VxePagerDefines.PageChangeEventParams) => {
|
|
||||||
state.tableParams.page = currentPage;
|
|
||||||
state.tableParams.pageSize = pageSize;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 列排序
|
|
||||||
const sortChange = (options: any) => {
|
|
||||||
state.tableParams.field = options.field;
|
|
||||||
state.tableParams.order = options.order;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 打开新增页面
|
// 打开新增页面
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
state.title = '添加账号';
|
state.title = '添加账号';
|
||||||
@ -240,12 +222,26 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysUserApi).apiSysUserDeletePost({ id: row.id });
|
await getAPI(SysUserApi).apiSysUserDeletePost({ id: row.id });
|
||||||
handleQuery();
|
await handleQuery();
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners<UserOutput> = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
// 修改状态
|
// 修改状态
|
||||||
const changeStatus = (row: any) => {
|
const changeStatus = (row: any) => {
|
||||||
getAPI(SysUserApi)
|
getAPI(SysUserApi)
|
||||||
@ -298,6 +294,6 @@ const handleNodeChange = async (node: any) => {
|
|||||||
state.queryParams.account = undefined;
|
state.queryParams.account = undefined;
|
||||||
state.queryParams.realName = undefined;
|
state.queryParams.realName = undefined;
|
||||||
state.queryParams.phone = undefined;
|
state.queryParams.phone = undefined;
|
||||||
handleQuery(true);
|
await handleQuery();
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user