Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
ebd1b422af
@ -11,5 +11,4 @@ namespace Admin.NET.Application;
|
||||
/// </summary>
|
||||
public class AppClaimConst : ClaimConst
|
||||
{
|
||||
|
||||
}
|
||||
@ -160,10 +160,6 @@ public class AppAuthService : IDynamicApiController, ITransient
|
||||
[NonAction]
|
||||
public virtual async Task<LoginOutput> CreateToken(SysUser user, LoginModeEnum loginMode)
|
||||
{
|
||||
// 默认PC端登录模式
|
||||
if (loginMode == 0)
|
||||
loginMode = LoginModeEnum.PC;
|
||||
|
||||
// 单用户登录
|
||||
await _sysOnlineUserService.SingleLogin(user.Id, loginMode);
|
||||
|
||||
@ -189,9 +185,6 @@ public class AppAuthService : IDynamicApiController, ITransient
|
||||
// 设置响应报文头
|
||||
_httpContextAccessor.HttpContext.SetTokensOfResponseHeaders(accessToken, refreshToken);
|
||||
|
||||
// Swagger Knife4UI-AfterScript登录脚本
|
||||
// ke.global.setAllHeader('Authorization', 'Bearer ' + ke.response.headers['access-token']);
|
||||
|
||||
return new LoginOutput
|
||||
{
|
||||
AccessToken = accessToken,
|
||||
|
||||
@ -18,5 +18,4 @@ public class AppUserManager : UserManager
|
||||
}
|
||||
|
||||
// 扩展属性
|
||||
|
||||
}
|
||||
@ -13,14 +13,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.0.0" />
|
||||
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.1.0" />
|
||||
<PackageReference Include="AngleSharp" Version="1.1.2" />
|
||||
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.15.10" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.17" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.17" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.5.17" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.5.18" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.5.18" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.5.18" />
|
||||
<PackageReference Include="Hardware.Info" Version="101.0.0" />
|
||||
<PackageReference Include="Hashids.net" Version="1.7.0" />
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
@ -30,9 +30,11 @@
|
||||
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.2" />
|
||||
<PackageReference Include="MailKit" Version="4.8.0" />
|
||||
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.6" />
|
||||
<PackageReference Include="MiniExcel" Version="1.34.2" />
|
||||
<PackageReference Include="MiniWord" Version="0.8.0" />
|
||||
<PackageReference Include="MQTTnet" Version="4.3.7.1207" />
|
||||
<PackageReference Include="MySqlBackup.NET.MySqlConnector" Version="2.3.8" />
|
||||
<PackageReference Include="NewLife.Redis" Version="6.0.2024.1006" />
|
||||
<PackageReference Include="NewLife.Redis" Version="6.0.2024.1101" />
|
||||
<PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" />
|
||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
|
||||
@ -42,8 +44,8 @@
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.8.0" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.1.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.6" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1112" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.8" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1115" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 租户种子数据特性
|
||||
/// 租户种子数据特性(种子Id不要设置值)
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
|
||||
@ -82,4 +82,16 @@ public partial class SysTenant : EntityBase
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
|
||||
public StatusEnum Status { get; set; } = StatusEnum.Enable;
|
||||
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "过期时间")]
|
||||
public DateTime? ExpirationTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构父Id
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public long OrgPid { get; set; }
|
||||
}
|
||||
@ -11,99 +11,99 @@ namespace Admin.NET.Core;
|
||||
/// </summary>
|
||||
public static class DataTypeExtension
|
||||
{
|
||||
/// <summary>转为SByte整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static sbyte ToSByte(this object value, sbyte defaultValue = default)
|
||||
{
|
||||
if (value is sbyte num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
/// <summary>转为SByte整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static sbyte ToSByte(this object value, sbyte defaultValue = default)
|
||||
{
|
||||
if (value is sbyte num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
|
||||
if (sbyte.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
if (sbyte.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/// <summary>转为Byte整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static byte ToByte(this object value, byte defaultValue = default)
|
||||
{
|
||||
if (value is byte num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
/// <summary>转为Byte整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static byte ToByte(this object value, byte defaultValue = default)
|
||||
{
|
||||
if (value is byte num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
|
||||
if (byte.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
if (byte.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/// <summary>转为Int16整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static short ToInt16(this object value, short defaultValue = default)
|
||||
{
|
||||
if (value is short num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
/// <summary>转为Int16整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static short ToInt16(this object value, short defaultValue = default)
|
||||
{
|
||||
if (value is short num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
|
||||
if (short.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
if (short.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/// <summary>转为UInt16整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static ushort ToUInt16(this object value, ushort defaultValue = default)
|
||||
{
|
||||
if (value is ushort num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
/// <summary>转为UInt16整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static ushort ToUInt16(this object value, ushort defaultValue = default)
|
||||
{
|
||||
if (value is ushort num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
|
||||
if (ushort.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
if (ushort.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/// <summary>转为UInt32整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static uint ToUInt32(this object value, uint defaultValue = default)
|
||||
{
|
||||
if (value is uint num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
/// <summary>转为UInt32整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static uint ToUInt32(this object value, uint defaultValue = default)
|
||||
{
|
||||
if (value is uint num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
|
||||
if (uint.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
if (uint.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/// <summary>转为UInt64整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static ulong ToUInt64(this object value, ulong defaultValue = default)
|
||||
{
|
||||
if (value is ulong num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
/// <summary>转为UInt64整数,转换失败时返回默认值。</summary>
|
||||
/// <remarks></remarks>
|
||||
/// <param name="value">待转换对象</param>
|
||||
/// <param name="defaultValue">默认值。待转换对象无效时使用</param>
|
||||
/// <returns></returns>
|
||||
public static ulong ToUInt64(this object value, ulong defaultValue = default)
|
||||
{
|
||||
if (value is ulong num) return num;
|
||||
if (value == null || value == DBNull.Value) return defaultValue;
|
||||
|
||||
if (ulong.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
if (ulong.TryParse(value.ToString(), out var result))
|
||||
return result;
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -405,4 +405,50 @@ public static class RepositoryExtension
|
||||
}
|
||||
return updateable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量列表in查询
|
||||
/// </summary>
|
||||
/// <typeparam name="T1"></typeparam>
|
||||
/// <typeparam name="T2"></typeparam>
|
||||
/// <param name="queryable"></param>
|
||||
/// <param name="exp"></param>
|
||||
/// <param name="queryList"></param>
|
||||
/// <param name="stoppingToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<T1>> BulkListQuery<T1, T2>(this ISugarQueryable<T1> queryable,
|
||||
Expression<Func<T1, SingleColumnEntity<T2>, bool>> exp,
|
||||
IEnumerable<T2> queryList,
|
||||
CancellationToken stoppingToken) where T1 : class, new()
|
||||
{
|
||||
// 创建临时表 (用真表兼容性好,表名随机)
|
||||
var tableName = "Temp" + SnowFlakeSingle.Instance.NextId();
|
||||
try
|
||||
{
|
||||
var type = queryable.Context.DynamicBuilder().CreateClass(tableName, new SugarTable())
|
||||
.CreateProperty("ColumnName", typeof(string), new SugarColumn() { IsPrimaryKey = true }) // 主键不要自增
|
||||
.BuilderType();
|
||||
// 创建表
|
||||
queryable.Context.CodeFirst.InitTables(type);
|
||||
var insertData = queryList.Select(it => new SingleColumnEntity<T2>() { ColumnName = it }).ToList();
|
||||
// 插入临时表
|
||||
queryable.Context.Fastest<SingleColumnEntity<T2>>()
|
||||
.AS(tableName)
|
||||
.BulkCopy(insertData);
|
||||
var queryTemp = queryable.Context.Queryable<SingleColumnEntity<T2>>()
|
||||
.AS(tableName);
|
||||
|
||||
var systemData = await queryable
|
||||
.InnerJoin(queryTemp, exp)
|
||||
.ToListAsync(stoppingToken);
|
||||
|
||||
queryable.Context.DbMaintenance.DropTable(tableName);
|
||||
return systemData;
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
queryable.Context.DbMaintenance.DropTable(tableName);
|
||||
throw Oops.Oh(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -33,10 +33,8 @@ public class EnumToDictJob : IJob
|
||||
var enumTypeList = sysEnumService.GetEnumTypeList();
|
||||
var enumCodeList = enumTypeList.Select(u => u.TypeName);
|
||||
// 查询数据库中已存在的枚举类型代码
|
||||
var sysDictTypeList = await db.Queryable<SysDictType>()
|
||||
.Includes(d => d.Children)
|
||||
.Where(d => enumCodeList.Contains(d.Code))
|
||||
.ToListAsync(stoppingToken);
|
||||
var exp = Expressionable.Create<SysDictType, SingleColumnEntity<string>>().And((t1, t2) => t1.Code == t2.ColumnName).ToExpression();
|
||||
var sysDictTypeList = await db.Queryable<SysDictType>().Includes(t1 => t1.Children).BulkListQuery(exp, enumCodeList, stoppingToken);
|
||||
// 更新的枚举转换字典
|
||||
var updatedEnumCodes = sysDictTypeList.Select(u => u.Code);
|
||||
var updatedEnumType = enumTypeList.Where(u => updatedEnumCodes.Contains(u.TypeName)).ToList();
|
||||
|
||||
@ -33,6 +33,7 @@ public class LogJob : IJob
|
||||
await db.Deleteable<SysLogVis>().Where(u => u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除访问日志
|
||||
await db.Deleteable<SysLogOp>().Where(u => u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除操作日志
|
||||
await db.Deleteable<SysLogDiff>().Where(u => u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除差异日志
|
||||
await db.Deleteable<SysJobTriggerRecord>().Where(u => u.CreatedTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除作业触发器运行记录
|
||||
|
||||
string msg = $"【{DateTime.Now}】清理系统日志成功,删除 {daysAgo} 天前的日志数据!";
|
||||
var originColor = Console.ForegroundColor;
|
||||
|
||||
@ -38,7 +38,7 @@ public class LoginInput
|
||||
/// <summary>
|
||||
/// 登录模式
|
||||
/// </summary>
|
||||
public LoginModeEnum LoginMode { get; set; }
|
||||
public LoginModeEnum LoginMode { get; set; } = LoginModeEnum.PC;
|
||||
}
|
||||
|
||||
public class LoginPhoneInput
|
||||
|
||||
@ -86,7 +86,7 @@ public class SysCodeGenConfigService : IDynamicApiController, ITransient
|
||||
if (tableColumnOutputList == null) return;
|
||||
|
||||
var codeGenConfigs = new List<SysCodeGenConfig>();
|
||||
var orderNo = 100;
|
||||
var orderNo = 1;
|
||||
foreach (var tableColumn in tableColumnOutputList)
|
||||
{
|
||||
if (_db.Queryable<SysCodeGenConfig>().Any(u => u.ColumnName == tableColumn.ColumnName && u.CodeGenId == codeGenerate.Id))
|
||||
@ -154,7 +154,7 @@ public class SysCodeGenConfigService : IDynamicApiController, ITransient
|
||||
codeGenConfig.DefaultValue = GetDefaultValue(tableColumn.DefaultValue);
|
||||
codeGenConfigs.Add(codeGenConfig);
|
||||
|
||||
orderNo += 10; // 每个配置排序间隔10
|
||||
orderNo += 1; // 每个配置排序间隔1
|
||||
}
|
||||
// 多库代码生成---这里要切回主库
|
||||
var provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId);
|
||||
|
||||
@ -190,7 +190,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
||||
if (bracketIndex != -1)
|
||||
dbTableName = dbTableName.Substring(0, bracketIndex);
|
||||
|
||||
var table = dbTableInfos.FirstOrDefault(u => u.Name.ToLower().StartsWith((config != null && config.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(dbTableName) : dbTableName).ToLower()));
|
||||
var table = dbTableInfos.FirstOrDefault(u => u.Name.ToLower().Equals((config != null && config.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(dbTableName) : dbTableName).ToLower()));
|
||||
if (table == null) continue;
|
||||
tableOutputList.Add(new TableOutput
|
||||
{
|
||||
|
||||
@ -256,9 +256,10 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
var sysCopyright = await GetConfigValueByCode<string>(ConfigConst.SysWebCopyright);
|
||||
var sysIcp = await GetConfigValueByCode<string>(ConfigConst.SysWebIcp);
|
||||
var sysIcpUrl = await GetConfigValueByCode<string>(ConfigConst.SysWebIcpUrl);
|
||||
var sysSecondVer = await GetConfigValueByCode<bool>(ConfigConst.SysSecondVer);
|
||||
var sysCaptcha = await GetConfigValueByCode<bool>(ConfigConst.SysCaptcha);
|
||||
var sysForceChangePassword = await GetConfigValueByCode<bool>(ConfigConst.SysForceChangePassword);
|
||||
var sysSecondVer = await GetConfigValueByCode<bool>(ConfigConst.SysSecondVer); // 登录二次验证
|
||||
var sysCaptcha = await GetConfigValueByCode<bool>(ConfigConst.SysCaptcha); // 图形验证码
|
||||
var sysForceChangePassword = await GetConfigValueByCode<bool>(ConfigConst.SysForceChangePassword); // 强制修改密码
|
||||
var publicKey = App.GetConfig<string>("Cryptogram:PublicKey", true); // 获取密码加解密公钥配置
|
||||
|
||||
return new
|
||||
{
|
||||
@ -272,7 +273,8 @@ public class SysConfigService : IDynamicApiController, ITransient
|
||||
SysIcpUrl = sysIcpUrl,
|
||||
SysSecondVer = sysSecondVer,
|
||||
SysCaptcha = sysCaptcha,
|
||||
SysForceChangePassword = sysForceChangePassword
|
||||
SysForceChangePassword = sysForceChangePassword,
|
||||
PublicKey = publicKey
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -6,45 +6,9 @@
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
public class FileInput : BaseIdInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件名称
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
/// </summary>
|
||||
public string FileType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否公开
|
||||
/// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
/// </summary>
|
||||
public bool IsPublic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件Url
|
||||
/// </summary>
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属实体ID
|
||||
/// </summary>
|
||||
public long BelongId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象Id
|
||||
/// </summary>
|
||||
public long RelationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象名称
|
||||
/// </summary>
|
||||
public string RelationName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 文件分页查询
|
||||
/// </summary>
|
||||
public class PageFileInput : BasePageInput
|
||||
{
|
||||
/// <summary>
|
||||
@ -52,6 +16,11 @@ public class PageFileInput : BasePageInput
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件后缀
|
||||
/// </summary>
|
||||
public string? Suffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
@ -63,11 +32,45 @@ public class PageFileInput : BasePageInput
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
|
||||
public class FileInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
|
||||
public class DeleteFileInput : BaseIdInput
|
||||
{
|
||||
}
|
||||
|
||||
public class UploadFileFromBase64Input
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
public class UploadFileInput : SysFile
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件
|
||||
/// </summary>
|
||||
[Required]
|
||||
public IFormFile File { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件路径
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件保存路径
|
||||
/// </summary>
|
||||
public string SavePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 允许格式:.jpeg.jpg.png.bmp.gif.tif
|
||||
/// </summary>
|
||||
public string AllowSuffix { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传文件Base64
|
||||
/// </summary>
|
||||
public class UploadFileFromBase64Input : SysFile
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件内容
|
||||
@ -79,84 +82,10 @@ public class UploadFileFromBase64Input
|
||||
/// </summary>
|
||||
public string ContentType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名称
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保存路径
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
/// </summary>
|
||||
public string FileType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否公开
|
||||
/// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
/// </summary>
|
||||
public bool IsPublic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属实体ID
|
||||
/// </summary>
|
||||
public long BelongId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象Id
|
||||
/// </summary>
|
||||
public long RelationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象名称
|
||||
/// </summary>
|
||||
public string RelationName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
public class FileUploadInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件
|
||||
/// </summary>
|
||||
[Required]
|
||||
public IFormFile File { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
/// </summary>
|
||||
public string FileType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否公开
|
||||
/// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
/// </summary>
|
||||
public bool IsPublic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件路径
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属实体ID
|
||||
/// </summary>
|
||||
public long BelongId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象Id
|
||||
/// </summary>
|
||||
public long RelationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象名称
|
||||
/// </summary>
|
||||
public string RelationName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -175,7 +104,7 @@ public class RelationQueryInput
|
||||
public long? RelationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件,多个以","分割
|
||||
/// 文件类型:多个以","分割
|
||||
/// </summary>
|
||||
public string FileTypes { get; set; }
|
||||
|
||||
@ -185,80 +114,11 @@ public class RelationQueryInput
|
||||
public long? BelongId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// 文件类型分割
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string[] GetFileTypeBS()
|
||||
{
|
||||
return FileTypes.Split(',');
|
||||
}
|
||||
}
|
||||
|
||||
public class FileOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// URL
|
||||
/// </summary>
|
||||
public string Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 大小
|
||||
/// </summary>
|
||||
public long SizeKb { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 后缀
|
||||
/// </summary>
|
||||
public string Suffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 路径
|
||||
/// </summary>
|
||||
public string FilePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件类别
|
||||
/// </summary>
|
||||
public string FileType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否公开
|
||||
/// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
/// </summary>
|
||||
public bool IsPublic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上传人
|
||||
/// </summary>
|
||||
public string CreateUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上传时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象名称
|
||||
/// </summary>
|
||||
public string RelationName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联对象Id
|
||||
/// </summary>
|
||||
public long? RelationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属Id
|
||||
/// </summary>
|
||||
public long? BelongId { get; set; }
|
||||
}
|
||||
@ -50,22 +50,11 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
var privateList = _sysFileRep.AsQueryable().Where(u => u.IsPublic == false);
|
||||
// 合并公开和私有附件并分页
|
||||
return await _sysFileRep.Context.UnionAll(publicList, privateList)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.FileName), u => u.FileName.Contains(input.FileName.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()) && !string.IsNullOrWhiteSpace(input.EndTime.ToString()),
|
||||
u => u.CreateTime >= input.StartTime && u.CreateTime <= input.EndTime)
|
||||
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||
.ToPagedListAsync(input.Page, input.PageSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传文件 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("上传文件")]
|
||||
public async Task<SysFile> UploadFile([FromForm] FileUploadInput input)
|
||||
{
|
||||
return await HandleUploadFile(input.File, input.Path, fileType: input.FileType, isPublic: input.IsPublic, belongId: input.BelongId, relationId: input.RelationId, relationName: input.RelationName);
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.FileName), u => u.FileName.Contains(input.FileName.Trim()))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()) && !string.IsNullOrWhiteSpace(input.EndTime.ToString()),
|
||||
u => u.CreateTime >= input.StartTime && u.CreateTime <= input.EndTime)
|
||||
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||
.ToPagedListAsync(input.Page, input.PageSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -93,7 +82,9 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
Headers = new HeaderDictionary(),
|
||||
ContentType = contentType
|
||||
};
|
||||
return await UploadFile(new FileUploadInput { File = formFile, Path = input.Path, FileType = input.FileType, IsPublic = input.IsPublic });
|
||||
var uploadFileInput = input.Adapt<UploadFileInput>();
|
||||
uploadFileInput.File = formFile;
|
||||
return await UploadFile(uploadFileInput);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -107,7 +98,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
var filelist = new List<SysFile>();
|
||||
foreach (var file in files)
|
||||
{
|
||||
filelist.Add(await UploadFile(new FileUploadInput { File = file }));
|
||||
filelist.Add(await UploadFile(new UploadFileInput { File = file }));
|
||||
}
|
||||
return filelist;
|
||||
}
|
||||
@ -118,9 +109,9 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("根据文件Id或Url下载")]
|
||||
public async Task<IActionResult> DownloadFile(FileInput input)
|
||||
public async Task<IActionResult> DownloadFile(SysFile input)
|
||||
{
|
||||
var file = input.Id > 0 ? await GetFile(input) : await _sysFileRep.CopyNew().GetFirstAsync(u => u.Url == input.Url);
|
||||
var file = input.Id > 0 ? await GetFile(input.Id) : await _sysFileRep.CopyNew().GetFirstAsync(u => u.Url == input.Url);
|
||||
var fileName = HttpUtility.UrlEncode(file.FileName, Encoding.GetEncoding("UTF-8"));
|
||||
var filePath = Path.Combine(file.FilePath, file.Id.ToString() + file.Suffix);
|
||||
|
||||
@ -147,12 +138,12 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
/// <summary>
|
||||
/// 文件预览 🔖
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("文件预览")]
|
||||
public async Task<IActionResult> GetPreview([FromRoute] long Id)
|
||||
public async Task<IActionResult> GetPreview([FromRoute] long id)
|
||||
{
|
||||
var file = await GetFile(new FileInput { Id = Id });
|
||||
var file = await GetFile(id);
|
||||
//var fileName = HttpUtility.UrlEncode(file.FileName, Encoding.GetEncoding("UTF-8"));
|
||||
var filePath = Path.Combine(file.FilePath, file.Id.ToString() + file.Suffix);
|
||||
|
||||
@ -269,71 +260,63 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
/// <returns></returns>
|
||||
[ApiDescriptionSettings(Name = "Update"), HttpPost]
|
||||
[DisplayName("更新文件")]
|
||||
public async Task UpdateFile(FileInput input)
|
||||
public async Task UpdateFile(SysFile input)
|
||||
{
|
||||
var isExist = await _sysFileRep.IsAnyAsync(u => u.Id == input.Id);
|
||||
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D8000);
|
||||
|
||||
await _sysFileRep.UpdateAsync(u => new SysFile() { FileName = input.FileName, FileType = input.FileType, IsPublic = input.IsPublic }, u => u.Id == input.Id);
|
||||
await _sysFileRep.UpdateAsync(u => input.Adapt<SysFile>(), u => u.Id == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取文件")]
|
||||
public async Task<SysFile> GetFile([FromQuery] FileInput input)
|
||||
public async Task<SysFile> GetFile([FromQuery] long id)
|
||||
{
|
||||
var file = await _sysFileRep.CopyNew().GetByIdAsync(input.Id);
|
||||
var file = await _sysFileRep.CopyNew().GetByIdAsync(id);
|
||||
return file ?? throw Oops.Oh(ErrorCodeEnum.D8000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// 上传文件 🔖
|
||||
/// </summary>
|
||||
/// <param name="file">文件</param>
|
||||
/// <param name="savePath">路径</param>
|
||||
/// <param name="allowSuffix">允许格式:.jpg.png.gif.tif.bmp</param>
|
||||
/// <param name="fileType">类型</param>
|
||||
/// <param name="isPublic">是否公开</param>
|
||||
/// <param name="belongId">所属实体的ID</param>
|
||||
/// <param name="relationName"></param>
|
||||
/// <param name="relationId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<SysFile> HandleUploadFile(IFormFile file, string savePath, string allowSuffix = "", string fileType = "", bool isPublic = false, long belongId = 0, string relationName = "", long relationId = 0)
|
||||
[DisplayName("上传文件")]
|
||||
public async Task<SysFile> UploadFile([FromForm] UploadFileInput input)
|
||||
{
|
||||
if (file == null) throw Oops.Oh(ErrorCodeEnum.D8000);
|
||||
if (input.File == null) throw Oops.Oh(ErrorCodeEnum.D8000);
|
||||
|
||||
// 判断是否重复上传的文件
|
||||
var sizeKb = file.Length / 1024; // 大小KB
|
||||
var sizeKb = input.File.Length / 1024; // 大小KB
|
||||
var fileMd5 = string.Empty;
|
||||
if (_uploadOptions.EnableMd5)
|
||||
{
|
||||
using (var fileStream = file.OpenReadStream())
|
||||
using (var fileStream = input.File.OpenReadStream())
|
||||
{
|
||||
fileMd5 = OssUtils.ComputeContentMd5(fileStream, fileStream.Length);
|
||||
}
|
||||
/*
|
||||
* Mysql8 中如果使用了 utf8mb4_general_ci 之外的编码会出错,尽量避免在条件里使用.ToString()
|
||||
* 因为 Squsugar 并不是把变量转换为字符串来构造SQL语句,而是构造了CAST(123 AS CHAR)这样的语句,这样这个返回值是utf8mb4_general_ci,所以容易出错。
|
||||
*/
|
||||
// Mysql8 中如果使用了 utf8mb4_general_ci 之外的编码会出错,尽量避免在条件里使用.ToString()
|
||||
// 因为 Squsugar 并不是把变量转换为字符串来构造SQL语句,而是构造了CAST(123 AS CHAR)这样的语句,这样这个返回值是utf8mb4_general_ci,所以容易出错。
|
||||
var sysFile = await _sysFileRep.GetFirstAsync(u => u.FileMd5 == fileMd5 && u.SizeKb == sizeKb);
|
||||
if (sysFile != null) return sysFile;
|
||||
}
|
||||
|
||||
// 验证文件类型
|
||||
if (!_uploadOptions.ContentType.Contains(file.ContentType))
|
||||
throw Oops.Oh($"{ErrorCodeEnum.D8001}:{file.ContentType}");
|
||||
if (!_uploadOptions.ContentType.Contains(input.File.ContentType))
|
||||
throw Oops.Oh($"{ErrorCodeEnum.D8001}:{input.File.ContentType}");
|
||||
|
||||
// 验证文件大小
|
||||
if (sizeKb > _uploadOptions.MaxSize)
|
||||
throw Oops.Oh($"{ErrorCodeEnum.D8002},允许最大:{_uploadOptions.MaxSize}KB");
|
||||
|
||||
// 获取文件后缀
|
||||
var suffix = Path.GetExtension(file.FileName).ToLower(); // 后缀
|
||||
var suffix = Path.GetExtension(input.File.FileName).ToLower(); // 后缀
|
||||
if (string.IsNullOrWhiteSpace(suffix))
|
||||
suffix = string.Concat(".", file.ContentType.AsSpan(file.ContentType.LastIndexOf('/') + 1));
|
||||
suffix = string.Concat(".", input.File.ContentType.AsSpan(input.File.ContentType.LastIndexOf('/') + 1));
|
||||
if (!string.IsNullOrWhiteSpace(suffix))
|
||||
{
|
||||
//var contentTypeProvider = FS.GetFileExtensionContentTypeProvider();
|
||||
@ -346,38 +329,30 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
throw Oops.Oh(ErrorCodeEnum.D8003);
|
||||
|
||||
// 防止客户端伪造文件类型
|
||||
if (!string.IsNullOrWhiteSpace(allowSuffix) && !allowSuffix.Contains(suffix))
|
||||
if (!string.IsNullOrWhiteSpace(input.AllowSuffix) && !input.AllowSuffix.Contains(suffix))
|
||||
throw Oops.Oh(ErrorCodeEnum.D8003);
|
||||
//if (!VerifyFileExtensionName.IsSameType(file.OpenReadStream(), suffix))
|
||||
// throw Oops.Oh(ErrorCodeEnum.D8001);
|
||||
|
||||
var path = string.IsNullOrWhiteSpace(savePath) ? _uploadOptions.Path : savePath;
|
||||
// 文件存储位置
|
||||
var path = string.IsNullOrWhiteSpace(input.SavePath) ? _uploadOptions.Path : input.SavePath;
|
||||
path = path.ParseToDateTimeForRep();
|
||||
var newFile = new SysFile
|
||||
{
|
||||
Id = YitIdHelper.NextId(),
|
||||
// BucketName = _OSSProviderOptions.Enabled ? _OSSProviderOptions.Provider.ToString() : "Local",
|
||||
// 阿里云对bucket名称有要求,1.只能包括小写字母,数字,短横线(-)2.必须以小写字母或者数字开头 3.长度必须在3-63字节之间
|
||||
// 无法使用Provider
|
||||
BucketName = _OSSProviderOptions.Enabled ? _OSSProviderOptions.Bucket : "Local",
|
||||
FileName = Path.GetFileNameWithoutExtension(file.FileName),
|
||||
Suffix = suffix,
|
||||
SizeKb = sizeKb,
|
||||
FilePath = path,
|
||||
FileMd5 = fileMd5,
|
||||
FileType = fileType,
|
||||
IsPublic = isPublic,
|
||||
BelongId = belongId,
|
||||
RelationId = relationId,
|
||||
RelationName = relationName,
|
||||
};
|
||||
|
||||
var newFile = input.Adapt<SysFile>();
|
||||
newFile.Id = YitIdHelper.NextId();
|
||||
newFile.BucketName = _OSSProviderOptions.Enabled ? _OSSProviderOptions.Bucket : "Local"; // 阿里云对bucket名称有要求,1.只能包括小写字母,数字,短横线(-)2.必须以小写字母或者数字开头 3.长度必须在3-63字节之间
|
||||
newFile.FileName = Path.GetFileNameWithoutExtension(input.File.FileName);
|
||||
newFile.Suffix = suffix;
|
||||
newFile.SizeKb = sizeKb;
|
||||
newFile.FilePath = path;
|
||||
newFile.FileMd5 = fileMd5;
|
||||
|
||||
var finalName = newFile.Id + suffix; // 文件最终名称
|
||||
if (_OSSProviderOptions.Enabled)
|
||||
{
|
||||
newFile.Provider = Enum.GetName(_OSSProviderOptions.Provider);
|
||||
var filePath = string.Concat(path, "/", finalName);
|
||||
await _OSSService.PutObjectAsync(newFile.BucketName, filePath, file.OpenReadStream());
|
||||
await _OSSService.PutObjectAsync(newFile.BucketName, filePath, input.File.OpenReadStream());
|
||||
// http://<你的bucket名字>.oss.aliyuncs.com/<你的object名字>
|
||||
// 生成外链地址 方便前端预览
|
||||
switch (_OSSProviderOptions.Provider)
|
||||
@ -407,7 +382,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"],
|
||||
App.Configuration["SSHProvider:Port"].ToInt(), App.Configuration["SSHProvider:Username"], App.Configuration["SSHProvider:Password"]))
|
||||
{
|
||||
helper.UploadFile(file.OpenReadStream(), fullPath);
|
||||
helper.UploadFile(input.File.OpenReadStream(), fullPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -420,7 +395,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
var realFile = Path.Combine(filePath, finalName);
|
||||
using (var stream = File.Create(realFile))
|
||||
{
|
||||
await file.CopyToAsync(stream);
|
||||
await input.File.CopyToAsync(stream);
|
||||
}
|
||||
|
||||
newFile.Url = $"{newFile.FilePath}/{newFile.Id + newFile.Suffix}";
|
||||
@ -437,7 +412,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
[DisplayName("上传头像")]
|
||||
public async Task<SysFile> UploadAvatar([Required] IFormFile file)
|
||||
{
|
||||
var sysFile = await HandleUploadFile(file, "upload/avatar", _imageType);
|
||||
var sysFile = await UploadFile(new UploadFileInput { File = file, AllowSuffix = _imageType, SavePath = "upload/avatar" });
|
||||
|
||||
var sysUserRep = _sysFileRep.ChangeRepository<SqlSugarRepository<SysUser>>();
|
||||
var user = await sysUserRep.GetByIdAsync(_userManager.UserId);
|
||||
@ -459,7 +434,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
[DisplayName("上传电子签名")]
|
||||
public async Task<SysFile> UploadSignature([Required] IFormFile file)
|
||||
{
|
||||
var sysFile = await HandleUploadFile(file, "upload/signature", _imageType);
|
||||
var sysFile = await UploadFile(new UploadFileInput { File = file, AllowSuffix = _imageType, SavePath = "upload/signature" });
|
||||
|
||||
var sysUserRep = _sysFileRep.ChangeRepository<SqlSugarRepository<SysUser>>();
|
||||
var user = await sysUserRep.GetByIdAsync(_userManager.UserId);
|
||||
@ -501,28 +476,17 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
[DisplayName("根据关联查询附件")]
|
||||
public async Task<List<FileOutput>> GetRelationFiles([FromQuery] RelationQueryInput input)
|
||||
public async Task<List<SysFile>> GetRelationFiles([FromQuery] RelationQueryInput input)
|
||||
{
|
||||
return await _sysFileRep.AsQueryable()
|
||||
.WhereIF(input.RelationId.HasValue && input.RelationId > 0, u => u.RelationId == input.RelationId)
|
||||
.WhereIF(input.BelongId.HasValue && input.BelongId > 0, u => u.BelongId == input.BelongId.Value)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.RelationName), u => u.RelationName == input.RelationName)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), u => input.GetFileTypeBS().Contains(u.FileType))
|
||||
.Select(u => new FileOutput
|
||||
.Select(u => new SysFile
|
||||
{
|
||||
Id = u.Id,
|
||||
FileType = u.FileType,
|
||||
Name = u.FileName,
|
||||
RelationId = u.RelationId,
|
||||
BelongId = u.BelongId,
|
||||
FilePath = u.FilePath,
|
||||
SizeKb = u.SizeKb,
|
||||
Suffix = u.Suffix,
|
||||
RelationName = u.RelationName,
|
||||
Url = SqlFunc.MergeString("/api/sysFile/Preview/", u.Id.ToString()),
|
||||
CreateUserName = u.CreateUserName,
|
||||
CreateTime = u.CreateTime,
|
||||
})
|
||||
}, true)
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
@ -312,24 +312,30 @@ public class SysRoleService : IDynamicApiController, ITransient
|
||||
foreach (var controller in apiOutput.Children)
|
||||
apiList[0].AddRange(controller.Children.Select(u => u.Route));
|
||||
}
|
||||
|
||||
// 所有按钮权限集合
|
||||
var allButtonList = await GetButtonList();
|
||||
// 没有接口对应的按钮权限集合
|
||||
var diffButtonList = allButtonList.Except(apiList[0]).ToList(); // 差集
|
||||
apiList[0].AddRange(diffButtonList);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 当前账号所有角色集合
|
||||
var roleIds = await _sysUserRoleService.GetUserRoleIdList(_userManager.UserId);
|
||||
var roleIdList = await _sysUserRoleService.GetUserRoleIdList(_userManager.UserId);
|
||||
|
||||
// 已勾选按钮权限集合
|
||||
apiList[0] = await GetRoleButtonList(roleIds);
|
||||
apiList[0] = await GetRoleButtonList(roleIdList);
|
||||
|
||||
// 未勾选按钮权限集合(放到接口黑名单里面)
|
||||
var allButtonList = await GetButtonList(new());
|
||||
var allButtonList = await GetButtonList();
|
||||
apiList[1] = allButtonList.Except(apiList[0]).ToList(); // 差集
|
||||
|
||||
// 接口黑名单集合
|
||||
var roleApis = await _sysRoleApiService.GetRoleApiList(roleIds);
|
||||
apiList[1].AddRange(roleApis);
|
||||
var roleApiList = await _sysRoleApiService.GetRoleApiList(roleIdList);
|
||||
apiList[1].AddRange(roleApiList);
|
||||
}
|
||||
_sysCacheService.Set(CacheConst.KeyUserApi + userId, apiList, TimeSpan.FromDays(7));
|
||||
_sysCacheService.Set(CacheConst.KeyUserApi + userId, apiList, TimeSpan.FromDays(7)); // 缓存7天
|
||||
}
|
||||
return apiList;
|
||||
}
|
||||
@ -367,11 +373,11 @@ public class SysRoleService : IDynamicApiController, ITransient
|
||||
/// </summary>
|
||||
/// <param name="menuIds"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<List<string>> GetButtonList(List<long> menuIds)
|
||||
private async Task<List<string>> GetButtonList(List<long> menuIds = null)
|
||||
{
|
||||
return await _sysRoleRep.ChangeRepository<SqlSugarRepository<SysMenu>>().AsQueryable()
|
||||
.Where(u => u.Type == MenuTypeEnum.Btn)
|
||||
.WhereIF(menuIds.Count > 0, u => menuIds.Contains(u.Id))
|
||||
.WhereIF(menuIds != null && menuIds.Count > 0, u => menuIds.Contains(u.Id))
|
||||
.Select(u => u.Permission).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
@ -71,11 +71,13 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
{
|
||||
Id = u.Id,
|
||||
OrgId = b.Id,
|
||||
OrgPid = b.Pid,
|
||||
Name = b.Name,
|
||||
UserId = a.Id,
|
||||
AdminAccount = a.Account,
|
||||
Phone = a.Phone,
|
||||
Email = a.Email,
|
||||
ExpirationTime = u.ExpirationTime,
|
||||
TenantType = u.TenantType,
|
||||
DbType = u.DbType,
|
||||
Connection = u.Connection,
|
||||
@ -180,7 +182,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
{
|
||||
Id = tenantId,
|
||||
TenantId = tenantId,
|
||||
Pid = 0,
|
||||
Pid = tenant.OrgPid,
|
||||
Name = tenantName,
|
||||
Code = tenantName,
|
||||
Remark = tenantName,
|
||||
@ -287,8 +289,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
|
||||
await _sysRoleRep.AsDeleteable().Where(u => u.TenantId == input.Id).ExecuteCommandAsync();
|
||||
|
||||
var roleIds = await _sysRoleRep.AsQueryable().ClearFilter()
|
||||
.Where(u => u.TenantId == input.Id).Select(u => u.Id).ToListAsync();
|
||||
var roleIds = await _sysRoleRep.AsQueryable().ClearFilter().Where(u => u.TenantId == input.Id).Select(u => u.Id).ToListAsync();
|
||||
await _sysRoleMenuRep.AsDeleteable().Where(u => roleIds.Contains(u.RoleId)).ExecuteCommandAsync();
|
||||
|
||||
await _sysOrgRep.AsDeleteable().Where(u => u.TenantId == input.Id).ExecuteCommandAsync();
|
||||
@ -336,7 +337,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
await _sysTenantRep.AsUpdateable(input.Adapt<TenantOutput>()).IgnoreColumns(true).ExecuteCommandAsync();
|
||||
|
||||
// 更新系统机构
|
||||
await _sysOrgRep.UpdateAsync(u => new SysOrg() { Name = input.Name }, u => u.Id == input.OrgId);
|
||||
await _sysOrgRep.UpdateAsync(u => new SysOrg() { Name = input.Name, Pid = input.OrgPid }, u => u.Id == input.OrgId);
|
||||
|
||||
// 更新系统用户
|
||||
await _sysUserRep.UpdateAsync(u => new SysUser() { Account = input.AdminAccount, Phone = input.Phone, Email = input.Email }, u => u.Id == input.UserId);
|
||||
|
||||
@ -502,24 +502,24 @@ public class SysWechatPayService : IDynamicApiController, ITransient
|
||||
if (input.SuccessTimeRange != null && input.SuccessTimeRange.Count > 0)
|
||||
{
|
||||
DateTime? start = input.SuccessTimeRange[0];
|
||||
query = query.WhereIF(start.HasValue, u => u.SuccessTime > start);
|
||||
query.WhereIF(start.HasValue, u => u.SuccessTime > start);
|
||||
if (input.SuccessTimeRange.Count > 1 && input.SuccessTimeRange[1].HasValue)
|
||||
{
|
||||
var end = input.SuccessTimeRange[1].Value.AddDays(1);
|
||||
query = query.Where(u => u.SuccessTime < end);
|
||||
query.Where(u => u.SuccessTime < end);
|
||||
}
|
||||
}
|
||||
if (input.ExpireTimeRange != null && input.ExpireTimeRange.Count > 0)
|
||||
{
|
||||
DateTime? start = input.ExpireTimeRange[0];
|
||||
query = query.WhereIF(start.HasValue, u => u.ExpireTime > start);
|
||||
query.WhereIF(start.HasValue, u => u.ExpireTime > start);
|
||||
if (input.ExpireTimeRange.Count > 1 && input.ExpireTimeRange[1].HasValue)
|
||||
{
|
||||
var end = input.ExpireTimeRange[1].Value.AddDays(1);
|
||||
query = query.Where(u => u.ExpireTime < end);
|
||||
query.Where(u => u.ExpireTime < end);
|
||||
}
|
||||
}
|
||||
query = query.OrderByDescending(u => u.CreateTime);
|
||||
query.OrderByDescending(u => u.CreateTime);
|
||||
return await query.ToPagedListAsync(input.Page, input.PageSize);
|
||||
}
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ public class SysWxOpenService : IDynamicApiController, ITransient
|
||||
if (wxUser == null)
|
||||
throw Oops.Oh("未找到用户上传失败");
|
||||
|
||||
var res = await _sysFileService.UploadFile(new FileUploadInput { File = input.File, FileType = input.FileType, Path = input.Path });
|
||||
var res = await _sysFileService.UploadFile(new UploadFileInput { File = input.File, FileType = input.FileType, Path = input.Path });
|
||||
wxUser.Avatar = res.Url;
|
||||
await _sysOAuthUserRep.AsUpdateable(wxUser).IgnoreColumns(true).ExecuteCommandAsync();
|
||||
|
||||
|
||||
@ -265,6 +265,22 @@ public static class SqlSugarSetup
|
||||
|
||||
db.Aop.OnDiffLogEvent = async u =>
|
||||
{
|
||||
// 移除相同字段
|
||||
for (int i = 0; i < u.AfterData.Count; i++)
|
||||
{
|
||||
var afterColumns = u.AfterData[i].Columns;
|
||||
var beforeColumns = u.BeforeData[i].Columns;
|
||||
for (int j = 0; j < afterColumns.Count; j++)
|
||||
{
|
||||
if (afterColumns[j].Value.Equals(beforeColumns[j].Value))
|
||||
{
|
||||
beforeColumns.Remove(beforeColumns[j]);
|
||||
afterColumns.Remove(afterColumns[j]);
|
||||
j--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var logDiff = new SysLogDiff
|
||||
{
|
||||
// 操作后记录(字段描述、列名、值、表名、表描述)
|
||||
@ -336,6 +352,7 @@ public static class SqlSugarSetup
|
||||
|
||||
Log.Information($"初始化种子数据 {config.DbType} - {config.ConfigId}");
|
||||
var seedDataTypes = App.EffectiveTypes.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.GetInterfaces().Any(i => i.HasImplementedRawGeneric(typeof(ISqlSugarEntitySeedData<>))))
|
||||
.Where(u => !u.IsDefined(typeof(TenantSeedAttribute), false))
|
||||
.WhereIF(config.SeedSettings.EnableIncreSeed, u => u.IsDefined(typeof(IncreSeedAttribute), false))
|
||||
.OrderBy(u => u.GetCustomAttributes(typeof(SeedDataAttribute), false).Length > 0 ? ((SeedDataAttribute)u.GetCustomAttributes(typeof(SeedDataAttribute), false)[0]).Order : 0).ToList();
|
||||
|
||||
|
||||
@ -447,6 +447,7 @@ public class ShellUtil
|
||||
/// <returns></returns>
|
||||
public static string PowerShell(string script)
|
||||
{
|
||||
#if NET8_0 || NET9_0
|
||||
// net 8.0 可用
|
||||
using var PowerShellInstance = System.Management.Automation.PowerShell.Create();
|
||||
PowerShellInstance.AddScript(script);
|
||||
@ -519,7 +520,6 @@ public class ShellHelper
|
||||
/// <returns></returns>
|
||||
public static string PowerShell(string script)
|
||||
{
|
||||
// net 8.0 可用
|
||||
using var PowerShellInstance = System.Management.Automation.PowerShell.Create();
|
||||
PowerShellInstance.AddScript(script);
|
||||
var PSOutput = PowerShellInstance.Invoke();
|
||||
|
||||
70
Admin.NET/Admin.NET.Core/Utils/MiniExcelUtil.cs
Normal file
70
Admin.NET/Admin.NET.Core/Utils/MiniExcelUtil.cs
Normal file
@ -0,0 +1,70 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using MiniExcelLibs;
|
||||
|
||||
namespace Admin.NET.Core;
|
||||
|
||||
public static class MiniExcelUtil
|
||||
{
|
||||
private const string _sheetName = "ImportTemplate";
|
||||
private const string _directory = "export";
|
||||
|
||||
/// <summary>
|
||||
/// 导出模板Excel
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<IActionResult> ExportExcelTemplate<T>(string fileName = null) where T : class, new()
|
||||
{
|
||||
var values = Array.Empty<T>();
|
||||
// 在内存中当开辟空间
|
||||
var memoryStream = new MemoryStream();
|
||||
// 将数据写到内存当中
|
||||
await memoryStream.SaveAsAsync(values, sheetName: _sheetName);
|
||||
// 从0的位置开始写入
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
{
|
||||
FileDownloadName = $"{(string.IsNullOrEmpty(fileName) ? typeof(T).Name : fileName)}.xlsx"
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取导入数据Excel
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<IEnumerable<T>> GetImportExcelData<T>([Required] IFormFile file) where T : class, new()
|
||||
{
|
||||
using MemoryStream stream = new MemoryStream();
|
||||
await file.CopyToAsync(stream);
|
||||
var res = await stream.QueryAsync<T>(sheetName: _sheetName);
|
||||
return res.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取导出数据excel地址
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<string> GetExportDataExcelUrl<T>(IEnumerable<T> exportData) where T : class, new()
|
||||
{
|
||||
var fileName = string.Format("{0}.xlsx", YitIdHelper.NextId());
|
||||
try
|
||||
{
|
||||
var path = Path.Combine(App.WebHostEnvironment.WebRootPath, _directory);
|
||||
if (!Directory.Exists(path))
|
||||
Directory.CreateDirectory(path);
|
||||
var filePath = Path.Combine(path, fileName);
|
||||
await MiniExcel.SaveAsAsync(filePath, exportData, overwriteFile: true);
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
throw Oops.Oh("出现错误:" + error);
|
||||
}
|
||||
var host = CommonUtil.GetLocalhost();
|
||||
return $"{host}/{_directory}/{fileName}";
|
||||
}
|
||||
}
|
||||
56
Admin.NET/Admin.NET.Core/Utils/YitIdInitHelper.cs
Normal file
56
Admin.NET/Admin.NET.Core/Utils/YitIdInitHelper.cs
Normal file
@ -0,0 +1,56 @@
|
||||
//// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
////
|
||||
//// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
////
|
||||
//// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
//namespace Admin.NET.Core;
|
||||
|
||||
///// <summary>
|
||||
///// 使用Redis自动注册雪花Id的 WorkerId
|
||||
///// </summary>
|
||||
//public class YitIdInitHelper
|
||||
//{
|
||||
// // 定义dll路径
|
||||
// public const string RegWorkerId_DLL_NAME = "lib\\regworkerid_lib_v1.3.1\\yitidgengo.dll";
|
||||
|
||||
// // 注册一个 WorkerId,会先注销所有本机已注册的记录
|
||||
// // ip: redis 服务器地址
|
||||
// // port: redis 端口
|
||||
// // password: redis 访问密码,可为空字符串“”
|
||||
// // maxWorkerId: 最大 WorkerId
|
||||
// [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "RegisterOne", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
// private static extern ushort RegisterOne(string ip, int port, string password, int maxWorkerId);
|
||||
|
||||
// // 注销本机已注册的 WorkerId
|
||||
// [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "UnRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
// private static extern void UnRegister();
|
||||
|
||||
// // 检查本地WorkerId是否有效(0-有效,其它-无效)
|
||||
// [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "Validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)]
|
||||
// private static extern int Validate(int workerId);
|
||||
|
||||
// public static long NextId()
|
||||
// {
|
||||
// // 此判断在高并发的情况下可能会有问题
|
||||
// if (YitIdHelper.IdGenInstance == null)
|
||||
// {
|
||||
// UnRegister();
|
||||
|
||||
// // 如果不用自动注册WorkerId的话,直接传一个数值就可以了
|
||||
// var workerId = RegisterOne("127.0.0.1", 6379, "", 63);
|
||||
// // 创建 IdGeneratorOptions 对象,可在构造函数中输入 WorkerId:
|
||||
// var options = new IdGeneratorOptions(workerId);
|
||||
// // options.WorkerIdBitLength = 10; // 默认值6,限定 WorkerId 最大值为2^6-1,即默认最多支持64个节点。
|
||||
// // options.SeqBitLength = 6; // 默认值6,限制每毫秒生成的ID个数。若生成速度超过5万个/秒,建议加大 SeqBitLength 到 10。
|
||||
// // options.BaseTime = Your_Base_Time; // 如果要兼容老系统的雪花算法,此处应设置为老系统的BaseTime。
|
||||
// // ...... 其它参数参考 IdGeneratorOptions 定义。
|
||||
|
||||
// // 保存参数(务必调用,否则参数设置不生效):
|
||||
// YitIdHelper.SetIdGenerator(options);
|
||||
|
||||
// // 以上过程只需全局一次,且应在生成ID之前完成。
|
||||
// }
|
||||
// return YitIdHelper.NextId();
|
||||
// }
|
||||
//}
|
||||
@ -13,6 +13,8 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Admin.NET.Web.Core
|
||||
@ -48,6 +50,19 @@ namespace Admin.NET.Web.Core
|
||||
|
||||
// 验证Token版本号
|
||||
|
||||
// 验证租户有效期
|
||||
var tenantId = context.User.FindFirst(ClaimConst.TenantId)?.Value;
|
||||
if (!string.IsNullOrWhiteSpace(tenantId))
|
||||
{
|
||||
var tenant = sysCacheService.Get<List<SysTenant>>(CacheConst.KeyTenant)?.FirstOrDefault(u => u.Id == long.Parse(tenantId));
|
||||
if (tenant != null && tenant.ExpirationTime != null && DateTime.Now > tenant.ExpirationTime)
|
||||
{
|
||||
context.Fail();
|
||||
context.GetCurrentHttpContext().SignoutToSwagger();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var sysConfigService = serviceScope.ServiceProvider.GetRequiredService<SysConfigService>();
|
||||
var tokenExpire = await sysConfigService.GetTokenExpire();
|
||||
var refreshTokenExpire = await sysConfigService.GetRefreshTokenExpire();
|
||||
|
||||
@ -25,20 +25,20 @@
|
||||
@if(Model.QueryWhetherList.Count > 0){
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb5">
|
||||
<el-form-item label="关键字" prop="searchKey">
|
||||
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @@keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
foreach (var column in Model.QueryWhetherList) {
|
||||
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb5" v-if="state.showAdvanceQueryUI">
|
||||
<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" />
|
||||
<el-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "InputNumber") {
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb5" v-if="state.showAdvanceQueryUI">
|
||||
<el-form-item label="@column.ColumnComment">
|
||||
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" />
|
||||
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "fk") {
|
||||
@ -52,7 +52,7 @@
|
||||
} else if(@column.EffectType == "Select") {
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb5" v-if="state.showAdvanceQueryUI">
|
||||
<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" >
|
||||
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
||||
<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-form-item>
|
||||
@ -60,7 +60,7 @@
|
||||
} else if(@column.EffectType == "EnumSelector") {
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb5" v-if="state.showAdvanceQueryUI">
|
||||
<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" >
|
||||
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
||||
<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-form-item>
|
||||
@ -86,7 +86,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @@click="handleQuery" v-auth="'@(@Model.LowerClassName)/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @@click="handleQuery(true)" 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-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>
|
||||
@ -342,7 +342,7 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
// 查询操作
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -31,8 +31,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Paddle.Runtime.win_x64" Version="2.6.1.1" />
|
||||
<PackageReference Include="PaddleOCRSharp" Version="4.4.0.1" />
|
||||
<PackageReference Include="PaddleOCRSharp" Version="4.4.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0" />
|
||||
<PackageReference Include="Rezero.Api" Version="1.7.12" />
|
||||
</ItemGroup>
|
||||
|
||||
2
Web/.env
2
Web/.env
@ -17,4 +17,4 @@ VITE_DEFAULT_USER = superadmin
|
||||
VITE_DEFAULT_USER_PASSWORD = 123456
|
||||
|
||||
# 国密SM公钥
|
||||
VITE_SM_PUBLIC_KEY = "04851D329AA3E38C2E7670AFE70E6E70E92F8769CA27C8766B12209A0FFBA4493B603EF7A0B9B1E16F0E8930C0406EA0B179B68DF28E25334BDEC4AE76D907E9E9"
|
||||
VITE_SM_PUBLIC_KEY =
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "admin.net.pro",
|
||||
"type": "module",
|
||||
"version": "2.4.33",
|
||||
"lastBuildTime": "2024.10.24",
|
||||
"lastBuildTime": "2024.11.03",
|
||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||
"author": "zuohuaijun",
|
||||
"license": "MIT",
|
||||
@ -21,7 +21,7 @@
|
||||
"@vue-office/docx": "^1.6.2",
|
||||
"@vue-office/excel": "^1.7.11",
|
||||
"@vue-office/pdf": "^2.0.7",
|
||||
"@vueuse/core": "^11.1.0",
|
||||
"@vueuse/core": "^11.2.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"animate.css": "^4.1.1",
|
||||
@ -33,9 +33,9 @@
|
||||
"echarts": "^5.5.1",
|
||||
"echarts-gl": "^2.0.9",
|
||||
"echarts-wordcloud": "^2.1.0",
|
||||
"element-plus": "^2.8.6",
|
||||
"element-plus": "^2.8.7",
|
||||
"exceljs": "^4.4.0",
|
||||
"ezuikit-js": "^8.0.13-alpha.2",
|
||||
"ezuikit-js": "^8.1.1-alpha.2",
|
||||
"gcoord": "^1.0.6",
|
||||
"js-cookie": "^3.0.5",
|
||||
"js-table2excel": "^1.1.2",
|
||||
@ -48,7 +48,7 @@
|
||||
"mqtt": "^5.10.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"ol": "^10.2.1",
|
||||
"pinia": "^2.2.4",
|
||||
"pinia": "^2.2.5",
|
||||
"print-js": "^1.6.0",
|
||||
"push.js": "^1.0.12",
|
||||
"qrcodejs2-fixes": "^0.0.2",
|
||||
@ -63,15 +63,15 @@
|
||||
"vue": "^3.5.12",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-demi": "0.14.6",
|
||||
"vue-draggable-plus": "^0.5.4",
|
||||
"vue-draggable-plus": "^0.5.6",
|
||||
"vue-grid-layout": "3.0.0-beta1",
|
||||
"vue-i18n": "^10.0.4",
|
||||
"vue-json-pretty": "^2.4.0",
|
||||
"vue-plugin-hiprint": "0.0.57-beta30",
|
||||
"vue-plugin-hiprint": "^0.0.58-fix",
|
||||
"vue-router": "^4.4.5",
|
||||
"vue-signature-pad": "^3.0.2",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
"vxe-pc-ui": "^4.2.28",
|
||||
"vxe-pc-ui": "^4.2.37",
|
||||
"vxe-table": "^4.7.59",
|
||||
"vxe-table-plugin-element": "^4.0.4",
|
||||
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
||||
@ -85,19 +85,19 @@
|
||||
"@types/node": "^20.16.5",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/sortablejs": "^1.15.8",
|
||||
"@typescript-eslint/eslint-plugin": "^8.11.0",
|
||||
"@typescript-eslint/parser": "^8.11.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.12.2",
|
||||
"@typescript-eslint/parser": "^8.12.2",
|
||||
"@vitejs/plugin-vue": "^5.1.4",
|
||||
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
||||
"@vue/compiler-sfc": "^3.5.12",
|
||||
"code-inspector-plugin": "^0.17.3",
|
||||
"eslint": "^9.13.0",
|
||||
"code-inspector-plugin": "^0.17.7",
|
||||
"eslint": "^9.14.0",
|
||||
"eslint-plugin-vue": "^9.29.1",
|
||||
"globals": "^15.11.0",
|
||||
"less": "^4.2.0",
|
||||
"prettier": "^3.3.3",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"sass": "^1.80.4",
|
||||
"sass": "^1.80.6",
|
||||
"terser": "^5.36.0",
|
||||
"typescript": "^5.6.3",
|
||||
"vite": "^5.4.10",
|
||||
|
||||
@ -128,6 +128,8 @@ const loadSysInfo = () => {
|
||||
themeConfig.value.captcha = data.sysCaptcha;
|
||||
// 开启强制修改密码
|
||||
themeConfig.value.sysForceChangePassword = data.sysForceChangePassword;
|
||||
// 密码加解密公匙
|
||||
window.__env__.VITE_SM_PUBLIC_KEY = data.publicKey;
|
||||
|
||||
// 更新 favicon
|
||||
updateFavicon(data.sysLogo);
|
||||
|
||||
@ -19,6 +19,7 @@ import { Configuration } from '../configuration';
|
||||
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
||||
import { AdminResultIActionResult } from '../models';
|
||||
import { AdminResultListApiOutput } from '../models';
|
||||
import { AdminResultListString } from '../models';
|
||||
import { AdminResultSmKeyPairOutput } from '../models';
|
||||
import { AdminResultString } from '../models';
|
||||
/**
|
||||
@ -31,10 +32,11 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura
|
||||
*
|
||||
* @summary 获取所有接口/动态API 🔖
|
||||
* @param {string} [groupName]
|
||||
* @param {boolean} [isAppApi]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysCommonApiListGet: async (groupName?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
apiSysCommonApiListGet: async (groupName?: string, isAppApi?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysCommon/apiList`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
@ -59,6 +61,53 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura
|
||||
localVarQueryParameter['groupName'] = groupName;
|
||||
}
|
||||
|
||||
if (isAppApi !== undefined) {
|
||||
localVarQueryParameter['isAppApi'] = isAppApi;
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有移动端接口
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysCommonAppApiListGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysCommon/appApiList`;
|
||||
// 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]);
|
||||
@ -277,11 +326,25 @@ export const SysCommonApiFp = function(configuration?: Configuration) {
|
||||
*
|
||||
* @summary 获取所有接口/动态API 🔖
|
||||
* @param {string} [groupName]
|
||||
* @param {boolean} [isAppApi]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysCommonApiListGet(groupName?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListApiOutput>>> {
|
||||
const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonApiListGet(groupName, options);
|
||||
async apiSysCommonApiListGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListApiOutput>>> {
|
||||
const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonApiListGet(groupName, isAppApi, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有移动端接口
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysCommonAppApiListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListString>>> {
|
||||
const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonAppApiListGet(options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
@ -355,11 +418,21 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base
|
||||
*
|
||||
* @summary 获取所有接口/动态API 🔖
|
||||
* @param {string} [groupName]
|
||||
* @param {boolean} [isAppApi]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysCommonApiListGet(groupName?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListApiOutput>> {
|
||||
return SysCommonApiFp(configuration).apiSysCommonApiListGet(groupName, options).then((request) => request(axios, basePath));
|
||||
async apiSysCommonApiListGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListApiOutput>> {
|
||||
return SysCommonApiFp(configuration).apiSysCommonApiListGet(groupName, isAppApi, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有移动端接口
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysCommonAppApiListGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListString>> {
|
||||
return SysCommonApiFp(configuration).apiSysCommonAppApiListGet(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
@ -414,12 +487,23 @@ export class SysCommonApi extends BaseAPI {
|
||||
*
|
||||
* @summary 获取所有接口/动态API 🔖
|
||||
* @param {string} [groupName]
|
||||
* @param {boolean} [isAppApi]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysCommonApi
|
||||
*/
|
||||
public async apiSysCommonApiListGet(groupName?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListApiOutput>> {
|
||||
return SysCommonApiFp(this.configuration).apiSysCommonApiListGet(groupName, options).then((request) => request(this.axios, this.basePath));
|
||||
public async apiSysCommonApiListGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListApiOutput>> {
|
||||
return SysCommonApiFp(this.configuration).apiSysCommonApiListGet(groupName, isAppApi, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取所有移动端接口
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysCommonApi
|
||||
*/
|
||||
public async apiSysCommonAppApiListGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListString>> {
|
||||
return SysCommonApiFp(this.configuration).apiSysCommonAppApiListGet(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -169,6 +169,22 @@ export interface AddTenantInput {
|
||||
*/
|
||||
status?: StatusEnum;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AddTenantInput
|
||||
*/
|
||||
expirationTime?: Date | null;
|
||||
|
||||
/**
|
||||
* 机构父Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AddTenantInput
|
||||
*/
|
||||
orgPid?: number;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*
|
||||
|
||||
@ -1,71 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { FileOutput } from './file-output';
|
||||
/**
|
||||
* 全局返回结果
|
||||
*
|
||||
* @export
|
||||
* @interface AdminResultListFileOutput
|
||||
*/
|
||||
export interface AdminResultListFileOutput {
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AdminResultListFileOutput
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* 类型success、warning、error
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminResultListFileOutput
|
||||
*/
|
||||
type?: string | null;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AdminResultListFileOutput
|
||||
*/
|
||||
message?: string | null;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*
|
||||
* @type {Array<FileOutput>}
|
||||
* @memberof AdminResultListFileOutput
|
||||
*/
|
||||
result?: Array<FileOutput> | null;
|
||||
|
||||
/**
|
||||
* 附加数据
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof AdminResultListFileOutput
|
||||
*/
|
||||
extras?: any | null;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AdminResultListFileOutput
|
||||
*/
|
||||
time?: Date;
|
||||
}
|
||||
@ -44,6 +44,8 @@ export enum DbType {
|
||||
NUMBER_23 = 23,
|
||||
NUMBER_24 = 24,
|
||||
NUMBER_25 = 25,
|
||||
NUMBER_26 = 26,
|
||||
NUMBER_27 = 27,
|
||||
NUMBER_900 = 900
|
||||
}
|
||||
|
||||
|
||||
@ -1,86 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @export
|
||||
* @interface FileInput
|
||||
*/
|
||||
export interface FileInput {
|
||||
|
||||
/**
|
||||
* 主键Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileInput
|
||||
*/
|
||||
id: number;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileInput
|
||||
*/
|
||||
fileName?: string | null;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileInput
|
||||
*/
|
||||
fileType?: string | null;
|
||||
|
||||
/**
|
||||
* 是否公开 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof FileInput
|
||||
*/
|
||||
isPublic?: boolean;
|
||||
|
||||
/**
|
||||
* 文件Url
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileInput
|
||||
*/
|
||||
url?: string | null;
|
||||
|
||||
/**
|
||||
* 所属实体ID
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileInput
|
||||
*/
|
||||
belongId?: number;
|
||||
|
||||
/**
|
||||
* 关联对象Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileInput
|
||||
*/
|
||||
relationId?: number;
|
||||
|
||||
/**
|
||||
* 关联对象名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileInput
|
||||
*/
|
||||
relationName?: string | null;
|
||||
}
|
||||
@ -1,126 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @export
|
||||
* @interface FileOutput
|
||||
*/
|
||||
export interface FileOutput {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
id?: number;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
name?: string | null;
|
||||
|
||||
/**
|
||||
* URL
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
url?: string | null;
|
||||
|
||||
/**
|
||||
* 大小
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
sizeKb?: number;
|
||||
|
||||
/**
|
||||
* 后缀
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
suffix?: string | null;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
filePath?: string | null;
|
||||
|
||||
/**
|
||||
* 文件类别
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
fileType?: string | null;
|
||||
|
||||
/**
|
||||
* 是否公开 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
isPublic?: boolean;
|
||||
|
||||
/**
|
||||
* 上传人
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
createUserName?: string | null;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
createTime?: Date | null;
|
||||
|
||||
/**
|
||||
* 关联对象名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
relationName?: string | null;
|
||||
|
||||
/**
|
||||
* 关联对象Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
relationId?: number | null;
|
||||
|
||||
/**
|
||||
* 所属Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileOutput
|
||||
*/
|
||||
belongId?: number | null;
|
||||
}
|
||||
@ -44,7 +44,6 @@ export * from './admin-result-list-db-column-output';
|
||||
export * from './admin-result-list-db-table-info';
|
||||
export * from './admin-result-list-enum-entity';
|
||||
export * from './admin-result-list-enum-type-output';
|
||||
export * from './admin-result-list-file-output';
|
||||
export * from './admin-result-list-int64';
|
||||
export * from './admin-result-list-list-string';
|
||||
export * from './admin-result-list-log-vis-output';
|
||||
@ -199,8 +198,6 @@ export * from './export-proc-by-tmpinput';
|
||||
export * from './export-proc-input';
|
||||
export * from './field-attributes';
|
||||
export * from './field-info';
|
||||
export * from './file-input';
|
||||
export * from './file-output';
|
||||
export * from './filter';
|
||||
export * from './filter-logic-enum';
|
||||
export * from './filter-operator-enum';
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
import { Filter } from './filter';
|
||||
import { Search } from './search';
|
||||
/**
|
||||
*
|
||||
* 文件分页查询
|
||||
*
|
||||
* @export
|
||||
* @interface PageFileInput
|
||||
@ -90,6 +90,14 @@ export interface PageFileInput {
|
||||
*/
|
||||
fileName?: string | null;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PageFileInput
|
||||
*/
|
||||
suffix?: string | null;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -169,6 +169,22 @@ export interface TenantOutput {
|
||||
*/
|
||||
status?: StatusEnum;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TenantOutput
|
||||
*/
|
||||
expirationTime?: Date | null;
|
||||
|
||||
/**
|
||||
* 机构父Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof TenantOutput
|
||||
*/
|
||||
orgPid?: number;
|
||||
|
||||
/**
|
||||
* 租户名称
|
||||
*
|
||||
|
||||
@ -169,6 +169,22 @@ export interface UpdateTenantInput {
|
||||
*/
|
||||
status?: StatusEnum;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof UpdateTenantInput
|
||||
*/
|
||||
expirationTime?: Date | null;
|
||||
|
||||
/**
|
||||
* 机构父Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateTenantInput
|
||||
*/
|
||||
orgPid?: number;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*
|
||||
|
||||
@ -13,13 +13,213 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* 上传文件Base64
|
||||
*
|
||||
* @export
|
||||
* @interface UploadFileFromBase64Input
|
||||
*/
|
||||
export interface UploadFileFromBase64Input {
|
||||
|
||||
/**
|
||||
* 雪花Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
id?: number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
createTime?: Date;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
updateTime?: Date | null;
|
||||
|
||||
/**
|
||||
* 创建者Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
createUserId?: number | null;
|
||||
|
||||
/**
|
||||
* 创建者姓名
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
createUserName?: string | null;
|
||||
|
||||
/**
|
||||
* 修改者Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
updateUserId?: number | null;
|
||||
|
||||
/**
|
||||
* 修改者姓名
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
updateUserName?: string | null;
|
||||
|
||||
/**
|
||||
* 软删除
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
isDelete?: boolean;
|
||||
|
||||
/**
|
||||
* 创建者部门Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
createOrgId?: number | null;
|
||||
|
||||
/**
|
||||
* 创建者部门名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
createOrgName?: string | null;
|
||||
|
||||
/**
|
||||
* 租户Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
tenantId?: number | null;
|
||||
|
||||
/**
|
||||
* 提供者
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
provider?: string | null;
|
||||
|
||||
/**
|
||||
* 仓储名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
bucketName?: string | null;
|
||||
|
||||
/**
|
||||
* 文件名称(源文件名)
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
fileName?: string | null;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
suffix?: string | null;
|
||||
|
||||
/**
|
||||
* 存储路径
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
filePath?: string | null;
|
||||
|
||||
/**
|
||||
* 文件大小KB
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
sizeKb?: number;
|
||||
|
||||
/**
|
||||
* 文件大小信息-计算后的
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
sizeInfo?: string | null;
|
||||
|
||||
/**
|
||||
* 外链地址-OSS上传后生成外链地址方便前端预览
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
url?: string | null;
|
||||
|
||||
/**
|
||||
* 文件MD5
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
fileMd5?: string | null;
|
||||
|
||||
/**
|
||||
* 关联对象名称(如子对象)
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
relationName?: string | null;
|
||||
|
||||
/**
|
||||
* 关联对象Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
relationId?: number | null;
|
||||
|
||||
/**
|
||||
* 所属Id(如主对象)
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
belongId?: number | null;
|
||||
|
||||
/**
|
||||
* 文件类别
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
fileType?: string | null;
|
||||
|
||||
/**
|
||||
* 是否公开 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
isPublic?: boolean;
|
||||
|
||||
/**
|
||||
* 文件内容
|
||||
*
|
||||
@ -36,14 +236,6 @@ export interface UploadFileFromBase64Input {
|
||||
*/
|
||||
contentType?: string | null;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
fileName?: string | null;
|
||||
|
||||
/**
|
||||
* 保存路径
|
||||
*
|
||||
@ -51,44 +243,4 @@ export interface UploadFileFromBase64Input {
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
path?: string | null;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
fileType?: string | null;
|
||||
|
||||
/**
|
||||
* 是否公开 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
isPublic?: boolean;
|
||||
|
||||
/**
|
||||
* 所属实体ID
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
belongId?: number;
|
||||
|
||||
/**
|
||||
* 关联对象Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
relationId?: number;
|
||||
|
||||
/**
|
||||
* 关联对象名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UploadFileFromBase64Input
|
||||
*/
|
||||
relationName?: string | null;
|
||||
}
|
||||
|
||||
@ -20,9 +20,11 @@ interface iVxeOption {
|
||||
id?: string;
|
||||
name?: string;
|
||||
columns: VxeGridPropTypes.Columns<any>;
|
||||
data?: VxeTablePropTypes.Data<any>;
|
||||
sortConfig?: VxeTablePropTypes.SortConfig<any>;
|
||||
showFooter?: boolean;
|
||||
footerData?: any;
|
||||
footerMethod?: VxeTablePropTypes.FooterMethod<any>;
|
||||
footerData?: VxeTablePropTypes.FooterData;
|
||||
footerMethod?: VxeTablePropTypes.FooterMethod<D>;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -58,7 +60,7 @@ export const useVxeTable = <T>(opt: iVxeOption, extras?: VxeGridProps<T>) => {
|
||||
custom: true,
|
||||
},
|
||||
checkboxConfig: { range: true },
|
||||
sortConfig: { trigger: 'cell', remote: true },
|
||||
// sortConfig: { trigger: 'cell', remote: true },
|
||||
exportConfig: {
|
||||
remote: false, // 设置使用服务端导出
|
||||
filename: `${opt.name}导出_${dayjs().format('YYMMDDHHmmss')}`,
|
||||
@ -69,7 +71,30 @@ export const useVxeTable = <T>(opt: iVxeOption, extras?: VxeGridProps<T>) => {
|
||||
pageSize: 20,
|
||||
},
|
||||
printConfig: { sheetName: '' },
|
||||
proxyConfig: {
|
||||
// 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, // 启用列宽状态
|
||||
},
|
||||
},
|
||||
});
|
||||
// data优先级高于proxyConfig
|
||||
if (opt.data) {
|
||||
options.data = opt.data;
|
||||
} else {
|
||||
options.proxyConfig = {
|
||||
enabled: true,
|
||||
autoLoad: false,
|
||||
sort: true,
|
||||
@ -79,14 +104,12 @@ export const useVxeTable = <T>(opt: iVxeOption, extras?: VxeGridProps<T>) => {
|
||||
total: 'data.result.total',
|
||||
message: 'data.message',
|
||||
},
|
||||
},
|
||||
customConfig: {
|
||||
storage: {
|
||||
// 是否启用 localStorage 本地保存,会将列操作状态保留在本地(需要有 id)
|
||||
visible: true, // 启用显示/隐藏列状态
|
||||
resizable: true, // 启用列宽状态
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
if (opt.sortConfig) {
|
||||
options.sortConfig = opt.sortConfig;
|
||||
} else {
|
||||
options.sortConfig = { remote: true };
|
||||
}
|
||||
return extras ? merge(options, extras) : options;
|
||||
};
|
||||
|
||||
2
Web/src/types/mitt.d.ts
vendored
2
Web/src/types/mitt.d.ts
vendored
@ -11,6 +11,7 @@
|
||||
* @method openShareTagsView 布局设置弹窗,开启 TagsView 共用
|
||||
* @method onTagsViewRefreshRouterView tagsview 刷新界面
|
||||
* @method onCurrentContextmenuClick tagsview 右键菜单每项点击时
|
||||
* @method submitRefreshFk
|
||||
*/
|
||||
declare type MittType<T = any> = {
|
||||
openSettingsDrawer?: string;
|
||||
@ -23,6 +24,7 @@ declare type MittType<T = any> = {
|
||||
openShareTagsView?: string;
|
||||
onTagsViewRefreshRouterView?: T;
|
||||
onCurrentContextmenuClick?: T;
|
||||
submitRefreshFk?: T;
|
||||
};
|
||||
|
||||
// mitt 参数类型定义
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="state.queryParams.title" placeholder="标题" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.title" placeholder="标题" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
@ -24,7 +24,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -146,10 +146,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
// 调用vxe-grid的commitProxy(query)方法,触发表格重新加载数据
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -1,107 +1,59 @@
|
||||
<template>
|
||||
<div class="sys-codeGenConfig-container">
|
||||
<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="80vw">
|
||||
<template #header>
|
||||
<div style="color: #fff">
|
||||
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||
<span> 生成配置 </span>
|
||||
</div>
|
||||
</template>
|
||||
<el-table :data="state.tableData" style="width: 100%" v-loading="state.loading" border>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="columnName" label="字段" width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="columnComment" label="描述" width="160" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.columnComment" autocomplete="off" />
|
||||
<vxe-modal v-model="state.isShowDialog" title="生成配置" :width="800" :height="350" show-footer show-zoom resize fullscreen @close="cancel">
|
||||
<template #default>
|
||||
<vxe-grid ref="xGrid" class="xGrid-table-style" v-bind="options">
|
||||
<template #drag_default="{}">
|
||||
<span class="drag-btn">
|
||||
<i class="fa fa-arrows"></i>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="netType" label="数据类型" min-width="90" show-overflow-tooltip />
|
||||
<el-table-column prop="effectType" label="作用类型" width="140" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<div class="effect-type-container">
|
||||
<el-select
|
||||
v-model="scope.row.effectType"
|
||||
class="m-2"
|
||||
style="width: 90%"
|
||||
placeholder="Select"
|
||||
:disabled="judgeColumns(scope.row)"
|
||||
@change="effectTypeChange(scope.row, scope.$index)"
|
||||
filterable
|
||||
>
|
||||
<el-option v-for="item in state.effectTypeList" :key="item.code" :label="item.value" :value="item.code" />
|
||||
</el-select>
|
||||
<el-button
|
||||
v-if="scope.row.effectType === 'ApiTreeSelect' || scope.row.effectType === 'fk'"
|
||||
:icon="Edit"
|
||||
type="dashed"
|
||||
title="修改"
|
||||
link
|
||||
@click="effectTypeChange(scope.row, scope.$index)"
|
||||
/>
|
||||
</div>
|
||||
<template #effectType="{ row, $index }">
|
||||
<vxe-select v-model="row.effectType" class="m-2" style="width: 70%" placeholder="Select" transfer :disabled="judgeColumns(row)" @change="effectTypeChange(row, $index)" filterable>
|
||||
<vxe-option v-for="item in state.effectTypeList" :key="item.code" :label="item.value" :value="item.code" />
|
||||
</vxe-select>
|
||||
<vxe-button v-if="row.effectType === 'ApiTreeSelect' || row.effectType === 'fk'" style="width: 30%" icon="vxe-icon-edit" @click="effectTypeChange(row, $index)">修改</vxe-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dictTypeCode" label="字典" width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.dictTypeCode" class="m-2" :disabled="effectTypeEnable(scope.row)" filterable>
|
||||
<el-option v-for="item in state.dictTypeCodeList" :key="item.code" :label="item.name" :value="item.code" />
|
||||
</el-select>
|
||||
<template #columnComment="{ row }">
|
||||
<vxe-input v-model="row.columnComment" autocomplete="off" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="whetherTable" label="列表显示" width="70" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.whetherTable" />
|
||||
<template #dictType="{ row }">
|
||||
<vxe-select v-model="row.dictTypeCode" class="m-2" :disabled="effectTypeEnable(row)" filterable transfer>
|
||||
<vxe-option v-for="item in state.dictTypeCodeList" :key="item.code" :label="item.name" :value="item.code" />
|
||||
</vxe-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="whetherAddUpdate" label="增改" width="70" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.whetherAddUpdate" :disabled="judgeColumns(scope.row)" />
|
||||
<template #whetherTable="{ row }">
|
||||
<vxe-checkbox v-model="row.whetherTable"></vxe-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="whetherRequired" label="必填" width="70" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<!-- <el-checkbox v-model="scope.row.whetherRequired" :disabled="judgeColumns(scope.row)" /> -->
|
||||
<el-tag v-if="scope.row.whetherRequired" type="success">是</el-tag>
|
||||
<el-tag v-else type="info">否</el-tag>
|
||||
<template #whetherAddUpdate="{ row }">
|
||||
<vxe-checkbox v-model="row.whetherAddUpdate" :disabled="judgeColumns(row)"></vxe-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="whetherSortable" label="可排序" width="80" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-checkbox v-model="scope.row.whetherSortable" />
|
||||
<template #whetherSortable="{ row }">
|
||||
<vxe-checkbox v-model="row.whetherSortable"></vxe-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="queryWhether" label="是否是查询" min-width="80" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.queryWhether" :active-value="true" :inactive-value="false" />
|
||||
<template #whetherRequired="{ row }">
|
||||
<vxe-tag v-if="row.whetherRequired" status="success">是</vxe-tag>
|
||||
<vxe-tag v-else status="info">否</vxe-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="queryType" label="查询方式" min-width="120" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.queryType" class="m-2" placeholder="Select" :disabled="!scope.row.queryWhether" filterable>
|
||||
<el-option v-for="item in state.queryTypeList" :key="item.code" :label="item.value" :value="item.code" />
|
||||
</el-select>
|
||||
<template #queryWhether="{ row }">
|
||||
<vxe-switch readonly v-model="row.queryWhether" open-label="是" close-label="否" :openValue="true" :closeValue="false"></vxe-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNo" label="排序" width="100" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.orderNo" autocomplete="off" type="number" />
|
||||
<template #queryType="{ row }">
|
||||
<vxe-select v-model="row.queryType" class="m-2" placeholder="Select" :disabled="!row.queryWhether" filterable transfer>
|
||||
<vxe-option v-for="item in state.queryTypeList" :key="item.code" :label="item.value" :value="item.code" />
|
||||
</vxe-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNo" label="校验规则" width="120" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button type="primary" plain v-if="scope.row.columnKey === 'False' && !scope.row.whetherCommon" @click="openVerifyDialog(scope.row)">校验规则{{ scope.row.ruleCount }}</el-button>
|
||||
<template #verification="{ row }">
|
||||
<vxe-button status="primary" plain v-if="row.columnKey === 'False' && !row.whetherCommon" @click="openVerifyDialog(row)">校验规则{{ row.ruleCount }}</vxe-button>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</vxe-grid>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<template #footer>
|
||||
<vxe-button @click="cancel">取 消</vxe-button>
|
||||
<vxe-button status="primary" @click="submit">确 定</vxe-button>
|
||||
</template>
|
||||
</vxe-modal>
|
||||
|
||||
<fkDialog ref="fkDialogRef" @submitRefreshFk="submitRefreshFk" />
|
||||
<treeDialog ref="treeDialogRef" @submitRefreshFk="submitRefreshFk" />
|
||||
@ -110,9 +62,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="sysCodeGenConfig">
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import { nextTick, onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import mittBus from '/@/utils/mitt';
|
||||
import { Edit } from '@element-plus/icons-vue';
|
||||
import Sortable from 'sortablejs';
|
||||
import { VxeGridInstance, VxeGridProps } from 'vxe-pc-ui';
|
||||
|
||||
import fkDialog from '/@/views/system/codeGen/component/fkDialog.vue';
|
||||
import treeDialog from '/@/views/system/codeGen/component/treeDialog.vue';
|
||||
@ -122,6 +75,7 @@ import { getAPI } from '/@/utils/axios-utils';
|
||||
import { SysCodeGenConfigApi, SysConstApi, SysDictDataApi, SysDictTypeApi, SysEnumApi } from '/@/api-services/api';
|
||||
// import { CodeGenConfig } from '/@/api-services/models/code-gen-config';
|
||||
|
||||
const xGrid = ref<VxeGridInstance<any>>();
|
||||
const emits = defineEmits(['handleQuery']);
|
||||
const fkDialogRef = ref();
|
||||
const treeDialogRef = ref();
|
||||
@ -129,7 +83,6 @@ const verifyDialogRef = ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
loading: false,
|
||||
tableData: [] as any, // CodeGenConfig[],
|
||||
dbData: [] as any,
|
||||
effectTypeList: [] as any,
|
||||
dictTypeCodeList: [] as any,
|
||||
@ -137,38 +90,214 @@ const state = reactive({
|
||||
queryTypeList: [] as any,
|
||||
allConstSelector: [] as any,
|
||||
allEnumSelector: [] as any,
|
||||
sortable: undefined as any,
|
||||
});
|
||||
|
||||
// 表格参数配置
|
||||
const options = reactive<VxeGridProps>({
|
||||
id: 'genConfigDialog',
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
autoResize: true,
|
||||
loading: false,
|
||||
align: 'center',
|
||||
rowConfig: { useKey: true },
|
||||
seqConfig: { seqMethod: ({ row }) => row.orderNo },
|
||||
columns: [
|
||||
{
|
||||
width: 50,
|
||||
slots: {
|
||||
default: 'drag_default',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'orderNo',
|
||||
title: '排序',
|
||||
minWidth: 80,
|
||||
showOverflow: 'tooltip',
|
||||
},
|
||||
{
|
||||
field: 'columnName',
|
||||
title: '字段',
|
||||
minWidth: 160,
|
||||
showOverflow: 'tooltip',
|
||||
},
|
||||
{
|
||||
field: 'columnComment',
|
||||
title: '描述',
|
||||
minWidth: 120,
|
||||
showOverflow: 'tooltip',
|
||||
slots: {
|
||||
edit: 'columnComment',
|
||||
default: 'columnComment',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'netType',
|
||||
title: '数据类型',
|
||||
minWidth: 90,
|
||||
},
|
||||
{
|
||||
field: 'effectType',
|
||||
title: '作用类型',
|
||||
minWidth: 160,
|
||||
slots: {
|
||||
edit: 'effectType',
|
||||
default: 'effectType',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'dictTypeCode',
|
||||
title: '字典',
|
||||
minWidth: 180,
|
||||
slots: {
|
||||
edit: 'dictType',
|
||||
default: 'dictType',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'whetherTable',
|
||||
title: '列表显示',
|
||||
minWidth: 70,
|
||||
slots: {
|
||||
edit: 'whetherTable',
|
||||
default: 'whetherTable',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'whetherAddUpdate',
|
||||
title: '增改',
|
||||
minWidth: 70,
|
||||
slots: {
|
||||
edit: 'whetherAddUpdate',
|
||||
default: 'whetherAddUpdate',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'whetherRequired',
|
||||
title: '必填',
|
||||
minWidth: 70,
|
||||
slots: {
|
||||
edit: 'whetherRequired',
|
||||
default: 'whetherRequired',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'whetherSortable',
|
||||
title: '可排序',
|
||||
minWidth: 70,
|
||||
slots: {
|
||||
edit: 'whetherSortable',
|
||||
default: 'whetherSortable',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'queryWhether',
|
||||
title: '是否是查询',
|
||||
minWidth: 70,
|
||||
slots: {
|
||||
edit: 'queryWhether',
|
||||
default: 'queryWhether',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'queryType',
|
||||
title: '查询方式',
|
||||
minWidth: 120,
|
||||
slots: {
|
||||
edit: 'queryType',
|
||||
default: 'queryType',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '校验规则',
|
||||
width: 130,
|
||||
showOverflow: true,
|
||||
slots: {
|
||||
edit: 'verification',
|
||||
default: 'verification',
|
||||
},
|
||||
},
|
||||
],
|
||||
editConfig: { trigger: 'click', mode: 'row', showStatus: true },
|
||||
});
|
||||
|
||||
const rowDrop = () => {
|
||||
const el = document.querySelector('.xGrid-table-style .vxe-table--body tbody') as HTMLElement;
|
||||
state.sortable = Sortable.create(el, {
|
||||
animation: 300,
|
||||
handle: '.drag-btn',
|
||||
onEnd: (sortableEvent: any) => {
|
||||
const fullData = xGrid.value?.getTableData().fullData || [];
|
||||
const newIndex = sortableEvent.newIndex as number;
|
||||
const oldIndex = sortableEvent.oldIndex as number;
|
||||
// 往前移动
|
||||
if (oldIndex > newIndex) {
|
||||
const moveRow = fullData?.find((e) => e.orderNo == oldIndex + 1);
|
||||
for (let i = oldIndex; i > newIndex; i--) {
|
||||
const row = fullData?.find((e) => e.orderNo == i);
|
||||
if (row) {
|
||||
row.orderNo += 1;
|
||||
}
|
||||
}
|
||||
moveRow.orderNo = newIndex + 1;
|
||||
} else {
|
||||
// 往后移动
|
||||
const moveRow = fullData?.find((e) => e.orderNo == oldIndex + 1);
|
||||
for (let i = oldIndex; i < newIndex; i++) {
|
||||
const row = fullData?.find((e) => e.orderNo == i + 2);
|
||||
if (row) {
|
||||
row.orderNo -= 1;
|
||||
}
|
||||
}
|
||||
moveRow.orderNo = newIndex + 1;
|
||||
}
|
||||
// 更新表格数据
|
||||
xGrid.value?.updateData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 页面初始化
|
||||
onMounted(async () => {
|
||||
// 从后端获取字典列表数据,并保存到本地状态管理中
|
||||
var res = await getAPI(SysDictDataApi).apiSysDictDataDataListCodeGet('code_gen_effect_type');
|
||||
state.effectTypeList = res.data.result;
|
||||
|
||||
// 获取字典类型代码列表,并将其保存到本地状态管理中,同时更新字典数据全集
|
||||
var res1 = await getAPI(SysDictTypeApi).apiSysDictTypeListGet();
|
||||
state.dictTypeCodeList = res1.data.result;
|
||||
state.dictDataAll = res1.data.result;
|
||||
|
||||
// 获取查询类型列表数据,并保存到本地状态管理中
|
||||
var res2 = await getAPI(SysDictDataApi).apiSysDictDataDataListCodeGet('code_gen_query_type');
|
||||
state.queryTypeList = res2.data.result;
|
||||
|
||||
// 从后端获取常量列表数据,并保存到本地状态管理中
|
||||
var res3 = await getAPI(SysConstApi).apiSysConstListGet();
|
||||
state.allConstSelector = res3.data.result;
|
||||
|
||||
// 获取枚举类型列表数据,对其进行处理后保存到本地状态管理中
|
||||
let resEnum = await getAPI(SysEnumApi).apiSysEnumEnumTypeListGet();
|
||||
state.allEnumSelector = resEnum.data.result?.map((item) => ({ ...item, name: `${item.typeDescribe} [${item.typeName?.replace('Enum', '')}]`, code: item.typeName }));
|
||||
|
||||
mittBus.on('submitRefreshFk', (data: any) => {
|
||||
state.tableData[data.index] = data;
|
||||
let tableData = xGrid.value?.getData() || [];
|
||||
tableData[data.index] = data;
|
||||
xGrid.value?.loadData(tableData);
|
||||
});
|
||||
});
|
||||
|
||||
// 更新主键
|
||||
const submitRefreshFk = (data: any) => {
|
||||
state.tableData[data.index] = data;
|
||||
let tableData = xGrid.value?.getData() || [];
|
||||
tableData[data.index] = data;
|
||||
xGrid.value?.reloadData(tableData);
|
||||
};
|
||||
|
||||
// 页面初始化
|
||||
onUnmounted(() => {
|
||||
mittBus.off('submitRefresh', () => {});
|
||||
// mittBus.off('submitRefresh', () => {});
|
||||
mittBus.off('submitRefreshFk', () => {});
|
||||
});
|
||||
|
||||
@ -213,7 +342,7 @@ const handleQuery = async (row: any) => {
|
||||
}
|
||||
item.ruleCount = rules.length > 0 ? `(${rules.length})` : '';
|
||||
});
|
||||
state.tableData = data;
|
||||
xGrid.value?.loadData(data);
|
||||
state.loading = false;
|
||||
};
|
||||
|
||||
@ -229,11 +358,15 @@ function effectTypeEnable(data: any) {
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (addRow: any) => {
|
||||
await handleQuery(addRow);
|
||||
state.isShowDialog = true;
|
||||
|
||||
nextTick(async () => {
|
||||
await handleQuery(addRow);
|
||||
rowDrop();
|
||||
});
|
||||
};
|
||||
|
||||
// 打开弹窗
|
||||
// 打开外键弹窗
|
||||
const openFkDialog = (addRow: any, index: number) => {
|
||||
addRow.index = index;
|
||||
fkDialogRef.value.openDialog(addRow);
|
||||
@ -253,43 +386,47 @@ const openVerifyDialog = (row: any) => {
|
||||
|
||||
// 验证提交回调
|
||||
const submitVerifyOk = (data: any) => {
|
||||
console.log('submitVerifyOk', data);
|
||||
for (let i = 0; i < state.tableData.length; i++) {
|
||||
if (state.tableData[i].id == data.id) {
|
||||
state.tableData[i].rules = data.rules;
|
||||
state.tableData[i].ruleCount = data.ruleCount;
|
||||
//更新必填项
|
||||
let tableData = xGrid.value?.getData() || [];
|
||||
for (let i = 0; i < tableData.length; i++) {
|
||||
if (tableData[i].id == data.id) {
|
||||
tableData[i].rules = data.rules;
|
||||
tableData[i].ruleCount = data.ruleCount;
|
||||
// 更新必填项
|
||||
let rules = new Array();
|
||||
if (data.rules != '' && data.rules !== null) {
|
||||
rules = JSON.parse(data.rules);
|
||||
let requiredRule = rules.find((t) => t.type === 'required');
|
||||
if (requiredRule) {
|
||||
state.tableData[i].whetherRequired = true;
|
||||
tableData[i].whetherRequired = true;
|
||||
} else {
|
||||
state.tableData[i].whetherRequired = false;
|
||||
tableData[i].whetherRequired = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
xGrid.value?.reloadData(tableData);
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
emits('handleQuery');
|
||||
state.isShowDialog = false;
|
||||
cancel();
|
||||
};
|
||||
|
||||
// 取消
|
||||
const cancel = () => {
|
||||
xGrid.value?.loadData([]);
|
||||
state.isShowDialog = false;
|
||||
if (state.sortable) {
|
||||
state.sortable.destroy();
|
||||
}
|
||||
};
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
state.loading = true;
|
||||
var lst = state.tableData;
|
||||
// console.log(lst);
|
||||
let lst = xGrid.value?.getData() || [];
|
||||
let ignoreFields = ['remoteVerify', 'anyRule', 'columnKey'];
|
||||
lst.forEach((item: any) => {
|
||||
// 必填那一项转换
|
||||
@ -310,3 +447,10 @@ const submit = async () => {
|
||||
// 导出对象
|
||||
defineExpose({ openDialog });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.xGrid-table-style .drag-btn {
|
||||
cursor: move;
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="业务名" prop="busName">
|
||||
<el-input placeholder="业务名" clearable @keyup.enter="handleQuery" v-model="state.queryParams.busName" @keyup.enter.native="handleQuery" />
|
||||
<el-input placeholder="业务名" clearable @keyup.enter="handleQuery" v-model="state.queryParams.busName" @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="数据库表名" prop="tableName">
|
||||
<el-input placeholder="数据库表名" clearable @keyup.enter="handleQuery" v-model="state.queryParams.tableName" @keyup.enter.native="handleQuery" />
|
||||
<el-input placeholder="数据库表名" clearable @keyup.enter="handleQuery" v-model="state.queryParams.tableName" @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -21,7 +21,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -158,9 +158,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="配置名称" prop="name">
|
||||
<el-input v-model="state.queryParams.name" placeholder="配置名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.name" placeholder="配置名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="配置编码" prop="code">
|
||||
<el-input v-model="state.queryParams.code" placeholder="配置编码" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.code" placeholder="配置编码" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
@ -28,7 +28,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysConfig/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysConfig/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -146,10 +146,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
// 调用vxe-grid的commitProxy(query)方法,触发表格重新加载数据
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -1,51 +1,61 @@
|
||||
<template>
|
||||
<div class="sys-dbTable-container">
|
||||
<el-dialog v-model="state.visible" :z-index="2008" draggable :close-on-click-modal="false" width="70vw">
|
||||
<template #header>
|
||||
<div style="color: #fff">
|
||||
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
|
||||
<span> 增加表 </span>
|
||||
<vxe-modal v-model="state.visible" title="增加表" :width="800" :height="350" resize show-footer show-confirm-button show-cancel-button show-zoom fullscreen @close="cancel">
|
||||
<template #default>
|
||||
<el-divider content-position="left" style="margin: 10px 0 18px 0">数据表信息</el-divider>
|
||||
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto">
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="表名称" prop="tableName" :rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model.lazy.trim="state.ruleForm.tableName" placeholder="表名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="描述" prop="description" :rules="[{ required: true, message: '描述不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model.lazy.trim="state.ruleForm.description" placeholder="描述" clearable type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-divider content-position="left" style="margin: 10px 0 18px 0">数据列信息</el-divider>
|
||||
<div style="height: calc(100vh - 300px)">
|
||||
<vxe-grid ref="xGrid" class="xGrid-table-style" v-bind="options">
|
||||
<template #toolbar_buttons>
|
||||
<el-button icon="ele-Plus" @click="addPrimaryColumn">新增主键字段</el-button>
|
||||
<el-button icon="ele-Plus" @click="addColumn">新增普通字段</el-button>
|
||||
<el-button icon="ele-Plus" @click="addTenantColumn">新增租户字段</el-button>
|
||||
<el-button icon="ele-Plus" @click="addBaseColumn">新增基础字段</el-button>
|
||||
<el-button icon="ele-Delete" type="danger" @click="deleteSelected">删除选中</el-button>
|
||||
</template>
|
||||
<template #toolbar_tools> </template>
|
||||
<template #empty>
|
||||
<el-empty :image-size="200" />
|
||||
</template>
|
||||
<template #drag_default="{}">
|
||||
<span class="drag-btn">
|
||||
<i class="fa fa-arrows"></i>
|
||||
</span>
|
||||
</template>
|
||||
<template #isPrimarykey="{ row }">
|
||||
<vxe-switch readonly v-model="row.isPrimarykey" open-label="是" close-label="否" :openValue="1" :closeValue="0"></vxe-switch>
|
||||
</template>
|
||||
<template #isIdentity="{ row }">
|
||||
<vxe-switch readonly v-model="row.isIdentity" open-label="是" close-label="否" :openValue="1" :closeValue="0"></vxe-switch>
|
||||
</template>
|
||||
<template #isNullable="{ row }">
|
||||
<vxe-switch readonly v-model="row.isNullable" open-label="是" close-label="否" :openValue="1" :closeValue="0"></vxe-switch>
|
||||
</template>
|
||||
<template #operate="{ row }">
|
||||
<vxe-button mode="text" status="error" icon="vxe-icon-delete" @click="deleteRow(row)" />
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
</template>
|
||||
<el-divider content-position="left" style="margin: 10px 0 18px 0">数据表信息</el-divider>
|
||||
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto">
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="表名称" prop="tableName" :rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="state.ruleForm.tableName" placeholder="表名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="描述" prop="description" :rules="[{ required: true, message: '描述不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="state.ruleForm.description" placeholder="描述" clearable type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-divider content-position="left" style="margin: 10px 0 18px 0">数据列信息</el-divider>
|
||||
<div style="height: calc(90vh - 252px)">
|
||||
<vxe-grid ref="xGrid" class="xGrid-table-style" v-bind="options">
|
||||
<template #toolbar_buttons>
|
||||
<el-button icon="ele-Plus" @click="addPrimaryColumn">新增主键字段</el-button>
|
||||
<el-button icon="ele-Plus" @click="addColumn">新增普通字段</el-button>
|
||||
<el-button icon="ele-Plus" @click="addTenantColumn">新增租户字段</el-button>
|
||||
<el-button icon="ele-Plus" @click="addBaseColumn">新增基础字段</el-button>
|
||||
<el-button icon="ele-Delete" type="danger" @click="deleteSelected">删除选中</el-button>
|
||||
</template>
|
||||
<template #toolbar_tools> </template>
|
||||
<template #empty>
|
||||
<el-empty :image-size="200" />
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
<vxe-button @click="cancel">取 消</vxe-button>
|
||||
<vxe-button status="primary" @click="submit">确 定</vxe-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</vxe-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -53,7 +63,6 @@
|
||||
import { nextTick, reactive, ref } from 'vue';
|
||||
import { ElMessage, dayjs } from 'element-plus';
|
||||
import { VxeGridInstance, VxeGridProps } from 'vxe-table';
|
||||
import { Rank } from '@element-plus/icons-vue';
|
||||
import Sortable from 'sortablejs';
|
||||
import { dataTypeList } from '../database';
|
||||
|
||||
@ -81,21 +90,25 @@ const options = reactive<VxeGridProps>({
|
||||
align: 'center', // 自动监听父元素的变化去重新计算表格(对于父元素可能存在动态变化、显示隐藏的容器中、列宽异常等场景中的可能会用到)
|
||||
data: [] as Array<any>,
|
||||
rowConfig: { useKey: true },
|
||||
mouseConfig: {
|
||||
selected: true,
|
||||
},
|
||||
keyboardConfig: {
|
||||
isArrow: true,
|
||||
isDel: true,
|
||||
isEnter: true,
|
||||
isTab: true,
|
||||
isEdit: true,
|
||||
},
|
||||
seqConfig: { seqMethod: ({ row }) => row.orderNo },
|
||||
columns: [
|
||||
{
|
||||
width: 80,
|
||||
slots: {
|
||||
default: () => (
|
||||
<span class="drag-btn">
|
||||
<el-icon>
|
||||
<Rank />
|
||||
</el-icon>
|
||||
</span>
|
||||
),
|
||||
default: 'drag_default',
|
||||
},
|
||||
},
|
||||
{ type: 'seq', title: '序号', width: 50 },
|
||||
{ type: 'seq', title: '序号', width: 60 },
|
||||
{ type: 'checkbox', width: 40 },
|
||||
{
|
||||
field: 'dbColumnName',
|
||||
@ -115,9 +128,9 @@ const options = reactive<VxeGridProps>({
|
||||
field: 'isPrimarykey',
|
||||
title: '主键',
|
||||
minWidth: 100,
|
||||
editRender: { name: '$switch', props: { openValue: 1, closeValue: 0, openLabel: '是', closeLabel: '否' } },
|
||||
editRender: { name: '$switch', props: { openValue: 1, closeValue: 0, openLabel: '是', closeLabel: '否', immediate: true } },
|
||||
slots: {
|
||||
default: (scope) => <vxe-switch vModel={scope.row.isPrimarykey} open-label="是" close-label="否" openValue={1} closeValue={0}></vxe-switch>,
|
||||
default: 'isPrimarykey',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -126,7 +139,7 @@ const options = reactive<VxeGridProps>({
|
||||
minWidth: 100,
|
||||
editRender: { name: '$switch', props: { openValue: 1, closeValue: 0, openLabel: '是', closeLabel: '否' } },
|
||||
slots: {
|
||||
default: (scope) => <vxe-switch vModel={scope.row.isIdentity} open-label="是" close-label="否" openValue={1} closeValue={0}></vxe-switch>,
|
||||
default: 'isIdentity',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -146,7 +159,7 @@ const options = reactive<VxeGridProps>({
|
||||
minWidth: 100,
|
||||
editRender: { name: '$switch', props: { openValue: 1, closeValue: 0, openLabel: '是', closeLabel: '否' } },
|
||||
slots: {
|
||||
default: (scope) => <vxe-switch vModel={scope.row.isNullable} open-label="是" close-label="否" openValue={1} closeValue={0}></vxe-switch>,
|
||||
default: 'isNullable',
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -169,7 +182,7 @@ const options = reactive<VxeGridProps>({
|
||||
showOverflow: true,
|
||||
fixed: 'right',
|
||||
slots: {
|
||||
default: (scope) => <el-button icon="ele-Delete" text type="danger" onClick={() => deleteRow(scope.row)}></el-button>,
|
||||
default: 'operate',
|
||||
},
|
||||
},
|
||||
],
|
||||
@ -193,20 +206,20 @@ const options = reactive<VxeGridProps>({
|
||||
},
|
||||
editConfig: { trigger: 'click', mode: 'row', showStatus: true },
|
||||
exportConfig: {
|
||||
remote: false, //设置使用服务端导出
|
||||
remote: false, // 设置使用服务端导出
|
||||
filename: `数据列信息导出_${dayjs().format('YYMMDDHHmmss')}`,
|
||||
exportMethod: ({ options }) => handleExport(options), //服务器导出方法
|
||||
exportMethod: ({ options }) => handleExport(options), // 服务器导出方法
|
||||
},
|
||||
printConfig: { sheetName: '' },
|
||||
proxyConfig: {
|
||||
props: {
|
||||
list: 'data.result.items', //不分页时
|
||||
// result: 'data.result.items', //分页时
|
||||
list: 'data.result.items', // 不分页时
|
||||
// result: 'data.result.items', // 分页时
|
||||
total: 'data.result.total',
|
||||
message: 'data.message',
|
||||
},
|
||||
ajax: {
|
||||
query: () => Promise.resolve(), //不加会报错
|
||||
query: () => Promise.resolve(), // 不加会报错
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -307,7 +320,7 @@ const addPrimaryColumn = async () => {
|
||||
const colIndex = (fullData?.length ?? 0) + 1;
|
||||
const temp = await xGrid.value?.insertAt(
|
||||
{
|
||||
columnDescription: '主键Id',
|
||||
columnDescription: '主键ID',
|
||||
dataType: 'bigint',
|
||||
dbColumnName: 'Id',
|
||||
decimalDigits: 0,
|
||||
@ -337,7 +350,7 @@ const addColumn = async () => {
|
||||
isIdentity: 0,
|
||||
isNullable: 1,
|
||||
isPrimarykey: 0,
|
||||
length: 32,
|
||||
length: 64,
|
||||
orderNo: colIndex,
|
||||
editable: true,
|
||||
isNew: true,
|
||||
@ -373,14 +386,17 @@ const addTenantColumn = async () => {
|
||||
// 增加通用基础列
|
||||
const addBaseColumn = async () => {
|
||||
const fileds = [
|
||||
{ dataType: 'varchar', name: 'Code', desc: '编码', length: 64 },
|
||||
{ dataType: 'varchar', name: 'Name', desc: '名称', length: 64 },
|
||||
{ dataType: 'varchar', name: 'Description', desc: '描述', length: 500 },
|
||||
{ dataType: 'datetime', name: 'CreateTime', desc: '创建时间' },
|
||||
{ dataType: 'datetime', name: 'UpdateTime', desc: '更新时间' },
|
||||
{ dataType: 'bigint', name: 'CreateUserId', desc: '创建者Id' },
|
||||
{ dataType: 'varchar', name: 'CreateUserName', desc: '创建者姓名', length: 64 },
|
||||
{ dataType: 'bigint', name: 'UpdateUserId', desc: '修改者Id' },
|
||||
{ dataType: 'varchar', name: 'UpdateUserName', desc: '修改者姓名', length: 64 },
|
||||
{ dataType: 'bigint', name: 'CreateOrgId', desc: '创建者部门Id' },
|
||||
{ dataType: 'varchar', name: 'CreateOrgName', desc: '创建者部门名称', length: 64 },
|
||||
{ dataType: 'bigint', name: 'CreateUserId', desc: '创建人Id' },
|
||||
{ dataType: 'varchar', name: 'CreateUserName', desc: '创建人', length: 64 },
|
||||
{ dataType: 'datetime', name: 'UpdateTime', desc: '修改时间' },
|
||||
{ dataType: 'bigint', name: 'UpdateUserId', desc: '修改人Id' },
|
||||
{ dataType: 'varchar', name: 'UpdateUserName', desc: '修改人', length: 64 },
|
||||
{ dataType: 'bigint', name: 'CreateOrgId', desc: '创建者机构Id' },
|
||||
{ dataType: 'varchar', name: 'CreateOrgName', desc: '创建者机构名称', length: 64 },
|
||||
{ dataType: 'bit', name: 'IsDelete', desc: '软删除', isNullable: 0 },
|
||||
];
|
||||
let temp = {} as any;
|
||||
@ -433,13 +449,13 @@ defineExpose({ openDialog });
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sys-dbTable-container :deep(.el-dialog__body) {
|
||||
height: 90vh;
|
||||
max-height: 90vh;
|
||||
}
|
||||
|
||||
.xGrid-table-style .drag-btn {
|
||||
cursor: move;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.xGrid-table-style .vxe-body--row.sortable-ghost,
|
||||
.xGrid-table-style .vxe-body--row.sortable-chosen {
|
||||
background-color: #e40000 !important;
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
||||
<el-form-item label="字典名称" prop="name">
|
||||
<el-input v-model="state.queryParamsDictType.name" placeholder="字典名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParamsDictType.name" placeholder="字典名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
||||
<el-form-item label="字典编码" prop="code">
|
||||
<el-input v-model="state.queryParamsDictType.code" placeholder="字典编码" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParamsDictType.code" placeholder="字典编码" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -21,7 +21,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysDictType/page'" :loading="optionsDictType.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysDictType/page'" :loading="optionsDictType.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="optionsDictType.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -63,12 +63,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
||||
<el-form-item label="字典值" prop="value">
|
||||
<el-input v-model="state.queryParamsDictData.value" placeholder="字典值" clearable @keyup.enter.native="handleQueryDictData" />
|
||||
<el-input v-model="state.queryParamsDictData.value" placeholder="字典值" clearable @keyup.enter.native="handleQueryDictData(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="state.queryParamsDictData.code" placeholder="编码" clearable @keyup.enter.native="handleQueryDictData" />
|
||||
<el-input v-model="state.queryParamsDictData.code" placeholder="编码" clearable @keyup.enter.native="handleQueryDictData(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -216,8 +216,8 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
await xGridDictType.value?.commitProxy('query');
|
||||
const handleQuery = async (reset = false) => {
|
||||
reset ? await xGridDictType.value?.commitProxy('reload') : await xGridDictType.value?.commitProxy('query');
|
||||
};
|
||||
|
||||
// 重置操作
|
||||
@ -320,8 +320,8 @@ const handleQueryDictDataApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageP
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQueryDictData = async () => {
|
||||
await xGridDictData.value?.commitProxy('query');
|
||||
const handleQueryDictData = async (reset = false) => {
|
||||
reset ? await xGridDictData.value?.commitProxy('reload') : await xGridDictData.value?.commitProxy('query');
|
||||
};
|
||||
|
||||
// 重置操作
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="所属ID" prop="fileName">
|
||||
<el-form-item label="所属Id" prop="fileName">
|
||||
<el-input v-model="state.ruleForm.belongId" placeholder="所属ID" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -71,7 +71,7 @@ import { ElMessage } from 'element-plus';
|
||||
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { SysFileApi } from '/@/api-services/api';
|
||||
import { FileInput } from '/@/api-services/models';
|
||||
import { SysFile } from '/@/api-services/models';
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
@ -81,7 +81,7 @@ const emits = defineEmits(['handleQuery']);
|
||||
const ruleFormRef = ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
ruleForm: {} as FileInput,
|
||||
ruleForm: {} as SysFile,
|
||||
});
|
||||
|
||||
// 打开弹窗
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="state.queryParams.fileName" placeholder="文件名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.fileName" placeholder="文件名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
@ -26,7 +26,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysFile/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysFile/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -92,7 +92,7 @@
|
||||
<el-option label="归档文件" value="归档文件" />
|
||||
</el-select>
|
||||
是否公开:
|
||||
<el-radio-group v-model="state.isPublic">
|
||||
<el-radio-group v-model="state.isPublic" style="margin-bottom: 10px">
|
||||
<el-radio :value="false">否</el-radio>
|
||||
<el-radio :value="true">是</el-radio>
|
||||
</el-radio-group>
|
||||
@ -230,9 +230,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="作业编号" prop="jobId">
|
||||
<el-input v-model="state.queryParams.jobId" placeholder="作业编号" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.jobId" placeholder="作业编号" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
@ -17,7 +17,7 @@
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="描述信息" prop="description">
|
||||
<el-input v-model="state.queryParams.description" placeholder="描述信息" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.description" placeholder="描述信息" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -26,7 +26,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysJob/pageJobDetail'" :loading="optionsJob.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysJob/pageJobDetail'" :loading="optionsJob.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="optionsJob.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -342,8 +342,8 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
await xGridJob.value?.commitProxy('query');
|
||||
const handleQuery = async (reset = false) => {
|
||||
reset ? await xGridJob.value?.commitProxy('reload') : await xGridJob.value?.commitProxy('query');
|
||||
};
|
||||
|
||||
// 重置操作
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -16,7 +16,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysLdap/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysLdap/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</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>
|
||||
@ -35,7 +35,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb8">
|
||||
<el-form-item label="主机">
|
||||
<el-input v-model="state.queryParams.host" clearable placeholder="请输入主机" @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.host" clearable placeholder="请输入主机" @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -163,9 +163,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysLogDiff/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysLogDiff/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -166,9 +166,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysLogEx/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysLogEx/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -217,9 +217,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysLogOp/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysLogOp/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -210,9 +210,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysLogVis/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysLogVis/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -161,9 +161,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="菜单名称" prop="title">
|
||||
<el-input v-model="state.queryParams.title" placeholder="菜单名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.title" placeholder="菜单名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
@ -25,7 +25,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysMenu/list'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysMenu/list'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -140,10 +140,9 @@ const handleQueryApi = async () => {
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
// 调用vxe-grid的commitProxy(query)方法,触发表格重新加载数据
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="state.queryParams.title" placeholder="标题" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.title" placeholder="标题" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
@ -24,7 +24,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysNotice/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysNotice/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -144,9 +144,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="微信昵称" prop="nickName">
|
||||
<el-input v-model="state.queryParams.nickName" placeholder="微信昵称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.nickName" placeholder="微信昵称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input v-model="state.queryParams.mobile" placeholder="手机号码" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.mobile" placeholder="手机号码" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -21,7 +21,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysOAuthUser/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysOAuthUser/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -146,9 +146,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -12,12 +12,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
||||
<el-form-item label="账号" prop="userName">
|
||||
<el-input v-model="state.queryParams.userName" placeholder="账号" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.userName" placeholder="账号" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
||||
<el-form-item label="姓名" prop="realName">
|
||||
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -28,7 +28,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -178,9 +178,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="身份标识" prop="accessKey">
|
||||
<el-input v-model="state.queryParams.accessKey" placeholder="身份标识" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.accessKey" placeholder="身份标识" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -16,7 +16,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysOpenAccess/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysOpenAccess/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -131,9 +131,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="功能名称" pro="name">
|
||||
<el-input v-model="state.queryParams.name" placeholder="功能名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.name" placeholder="功能名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -16,7 +16,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysPlugin/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysPlugin/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -125,9 +125,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="职位名称" prop="name">
|
||||
<el-input v-model="state.queryParams.name" placeholder="职位名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.name" placeholder="职位名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="职位编码" prop="code">
|
||||
<el-input v-model="state.queryParams.code" placeholder="职位编码" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.code" placeholder="职位编码" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -21,7 +21,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysPos/page'"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysPos/page'"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -128,10 +128,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
// 调用vxe-grid的commitProxy(query)方法,触发表格重新加载数据
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-row :gutter="8" style="margin-bottom: 5px">
|
||||
<el-row :gutter="8" style="margin-bottom: 10px">
|
||||
<!-- 流程下拉 模板选择 -->
|
||||
<el-col :span="4">
|
||||
<!-- 流程下拉 模板选择 -->
|
||||
<el-select v-model="mode" showSearch @change="changeMode" :defaultValue="0" option-label-prop="label" class="w100">
|
||||
<el-option v-for="(opt, idx) in state.modeList" :key="idx" :label="opt.name" :value="idx">
|
||||
{{ opt.name }}
|
||||
@ -10,11 +10,12 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="20">
|
||||
<el-select v-model="state.curPaper.type" placeholder="默认纸张" style="width: 120px" @change="setPaper">
|
||||
<el-option v-for="item in state.paperTypes" :key="item.type" :label="item.type" :value="item.type" />
|
||||
</el-select>
|
||||
<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
|
||||
<!-- 纸张设置 -->
|
||||
<el-button-group style="margin: 0 2px">
|
||||
<el-button v-for="(value, type) in state.paperTypes" :type="curPaperType === type ? 'primary' : ''" @click="setPaper(type, value)" :key="type">
|
||||
{{ type }}
|
||||
</el-button>
|
||||
<el-button-group>
|
||||
<el-popover v-model="state.paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px">
|
||||
<el-input type="number" v-model="state.paperWidth" style="width: 100px; text-align: center" place="宽(mm)"></el-input>~
|
||||
@ -24,12 +25,13 @@
|
||||
<el-button type="primary" style="width: 100%" @click="otherPaper">确定</el-button>
|
||||
</div>
|
||||
<template #reference>
|
||||
<el-button :type="'other' == curPaperType ? 'primary' : ''" style="margin: 0 10px">自定义宽高</el-button>
|
||||
<el-button :type="'other' == curPaperType ? 'primary' : ''">自定义宽高</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
</el-button-group>
|
||||
<el-input-number style="margin-right: 8px" v-model="state.scaleValue" :precision="2" :step="0.1" :min="state.scaleMin" :max="state.scaleMax" @change="changeScale"></el-input-number>
|
||||
|
||||
<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
|
||||
<el-input-number style="margin-left: 5px; width: 130px" v-model="state.scaleValue" :precision="2" :step="0.1" :min="state.scaleMin" :max="state.scaleMax" @change="changeScale"></el-input-number>
|
||||
<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
|
||||
<el-button-group>
|
||||
<el-tooltip content="左对齐" placement="bottom">
|
||||
<el-button icon="ele-Back" @click="setElsAlign('left')"> </el-button>
|
||||
@ -56,21 +58,30 @@
|
||||
<el-button icon="ele-Switch" @click="setElsAlign('distributeVer')"> </el-button>
|
||||
</el-tooltip>
|
||||
</el-button-group>
|
||||
|
||||
<!-- 预览/打印 -->
|
||||
<el-button-group style="margin-left: 8px">
|
||||
<el-button type="primary" icon="ele-RefreshRight" @click="rotatePaper"> 旋转 </el-button>
|
||||
<el-button type="primary" icon="ele-View" @click="preView"> 预览 </el-button>
|
||||
<el-button type="primary" icon="ele-Printer" @click="print"> 直接打印 </el-button>
|
||||
<el-button type="primary" icon="ele-CircleCheck" @click="viewJson"> 模板JSON </el-button>
|
||||
<el-button type="danger" icon="ele-Delete" @click="clearPaper"> 清空模板 </el-button>
|
||||
<el-divider style="height: calc(100% - 5px); margin: 0 10px" direction="vertical" />
|
||||
<el-button-group>
|
||||
<el-tooltip content="旋转" placement="bottom">
|
||||
<el-button icon="ele-RefreshRight" @click="rotatePaper"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="预览" placement="bottom">
|
||||
<el-button icon="ele-View" @click="preView"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="清空模板" placement="bottom">
|
||||
<el-button icon="ele-Delete" @click="clearPaper"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="直接打印" placement="bottom">
|
||||
<el-button icon="ele-Printer" @click="print"> </el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="模板JSON" placement="bottom">
|
||||
<el-button icon="ele-Coin" @click="viewJson"> </el-button>
|
||||
</el-tooltip>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="8">
|
||||
<el-col :span="4">
|
||||
<el-card style="height: 100%" shadow="never" :body-style="{ padding: '0px 0 5px 7px' }">
|
||||
<el-card style="height: 100%" shadow="never">
|
||||
<el-row>
|
||||
<el-col :span="24" id="hiprintEpContainer" class="rect-printElement-types hiprintEpContainer"> </el-col>
|
||||
</el-row>
|
||||
@ -82,8 +93,8 @@
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6" class="params_setting_container">
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="属性" style="height: auto">
|
||||
<el-tabs type="border-card" style="height: 100%">
|
||||
<el-tab-pane label="属性" style="height: 100%">
|
||||
<el-card shadow="never" :body-style="{ padding: '0px' }">
|
||||
<el-row class="hinnn-layout-sider">
|
||||
<div id="PrintElementOptionSetting"></div>
|
||||
@ -91,8 +102,8 @@
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="测试数据">
|
||||
<el-input v-model="printDataDemo" type="textarea" style="width: 100%" rows="30" placeholder="对整个文档的完整测试数据"></el-input>
|
||||
<el-button @click="formatPrintDataDemo()" style="margin-top: 10px; width: 100%" type="success">格式化字符串</el-button>
|
||||
<el-button @click="formatPrintDataDemo()" style="margin-bottom: 10px; width: 100%">格式化字符串</el-button>
|
||||
<el-input v-model="printDataDemo" type="textarea" style="width: 100%" :rows="30" placeholder="对整个文档的完整测试数据"></el-input>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
@ -103,7 +114,7 @@
|
||||
</el-drawer>
|
||||
|
||||
<!-- 预览 -->
|
||||
<PrintPreview ref="preViewRef" />
|
||||
<PrintPreview ref="preViewRef" title="预览" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="hiprintDesign">
|
||||
@ -116,6 +127,13 @@ import { hiprint } from 'vue-plugin-hiprint';
|
||||
import providers from './providers';
|
||||
import PrintPreview from './preview.vue';
|
||||
import printDataDefault from './print-data';
|
||||
// import { IPaperType } from './type';
|
||||
|
||||
interface IPaperType {
|
||||
type: string;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
var props = defineProps({
|
||||
modeIndex: {
|
||||
@ -136,42 +154,50 @@ const state = reactive({
|
||||
type: 'A4',
|
||||
width: 220,
|
||||
height: 296.6,
|
||||
},
|
||||
} as IPaperType,
|
||||
// 纸张类型
|
||||
paperTypes: {
|
||||
A3: {
|
||||
paperTypes: [
|
||||
{
|
||||
type: 'A3',
|
||||
width: 420,
|
||||
height: 296.6,
|
||||
},
|
||||
A4: {
|
||||
{
|
||||
type: 'A4',
|
||||
width: 210,
|
||||
height: 296.6,
|
||||
},
|
||||
A5: {
|
||||
{
|
||||
type: 'A5',
|
||||
width: 210,
|
||||
height: 147.6,
|
||||
},
|
||||
B3: {
|
||||
{
|
||||
type: 'B3',
|
||||
width: 500,
|
||||
height: 352.6,
|
||||
},
|
||||
B4: {
|
||||
{
|
||||
type: 'B4',
|
||||
width: 250,
|
||||
height: 352.6,
|
||||
},
|
||||
B5: {
|
||||
{
|
||||
type: 'B5',
|
||||
width: 250,
|
||||
height: 175.6,
|
||||
},
|
||||
'4R': {
|
||||
{
|
||||
type: '4R',
|
||||
width: 152,
|
||||
height: 102,
|
||||
},
|
||||
'6R': {
|
||||
{
|
||||
type: '6R',
|
||||
width: 203,
|
||||
height: 152,
|
||||
},
|
||||
},
|
||||
] as IPaperType[],
|
||||
scaleValue: 1,
|
||||
scaleMax: 5,
|
||||
scaleMin: 0.5,
|
||||
@ -243,14 +269,15 @@ const changeMode = () => {
|
||||
* @param type [A3, A4, A5, B3, B4, B5, other]
|
||||
* @param value {width,height} mm
|
||||
*/
|
||||
const setPaper = (type: string, value: { width: number; height: number }) => {
|
||||
const setPaper = (type: string, value?: { width: number; height: number }) => {
|
||||
try {
|
||||
if (Object.keys(state.paperTypes).includes(type)) {
|
||||
state.curPaper = { type: type, width: value.width, height: value.height };
|
||||
hiprintTemplate.value.setPaper(value.width, value.height);
|
||||
const paperType = state.paperTypes.find((x) => x.type == type);
|
||||
if (paperType) {
|
||||
state.curPaper = { type: type, width: paperType.width || 0, height: paperType.height || 0 };
|
||||
hiprintTemplate.value.setPaper(paperType.width, paperType.height);
|
||||
} else {
|
||||
state.curPaper = { type: 'other', width: value.width, height: value.height };
|
||||
hiprintTemplate.value.setPaper(value.width, value.height);
|
||||
state.curPaper = { type: 'other', width: value?.width || 0, height: value?.height || 0 };
|
||||
hiprintTemplate.value.setPaper(value?.width, value?.height);
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error(`操作失败: ${error}`);
|
||||
@ -360,8 +387,8 @@ const initPaper = () => {
|
||||
var template = hiprintTemplate.value.getJson();
|
||||
var width = template.panels[0].width;
|
||||
var height = template.panels[0].height;
|
||||
|
||||
state.curPaper = { type: '', width: width, height: height }; // 计算纸张类型和状态
|
||||
const paperType = state.paperTypes.find((x) => x.width == width && x.height == height);
|
||||
state.curPaper = { type: paperType?.type || '', width: width, height: height }; // 计算纸张类型和状态
|
||||
hiprintTemplate.value.setPaper(width, height); // 设置纸张大小
|
||||
};
|
||||
|
||||
@ -393,7 +420,7 @@ defineExpose({ hiprintTemplate, printDataDemo, setPrintDataDemo, initPaper, mode
|
||||
text-overflow: ellipsis;
|
||||
color: var(--el-color-primary);
|
||||
box-shadow: none !important;
|
||||
border: 1px dashed var(--el-color-primary);
|
||||
// border: 1px dashed var(--el-color-primary);
|
||||
}
|
||||
|
||||
// 默认图片
|
||||
@ -408,14 +435,18 @@ defineExpose({ hiprintTemplate, printDataDemo, setPrintDataDemo, initPaper, mode
|
||||
overflow: hidden;
|
||||
overflow-x: auto;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
:deep(.hiprint-option-item-submitBtn) {
|
||||
background: var(--el-color-primary);
|
||||
}
|
||||
|
||||
:deep(.hiprint-option-item-deleteBtn) {
|
||||
background: var(--el-color-danger);
|
||||
}
|
||||
|
||||
:deep(.prop-tabs .prop-tab-items li.active) {
|
||||
color: var(--el-color-primary);
|
||||
border-bottom: 2px solid var(--el-color-primary);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="模板名称" prop="name">
|
||||
<el-input v-model="state.queryParams.name" placeholder="模板名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.name" placeholder="模板名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -16,7 +16,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysPrint/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysPrint/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -127,9 +127,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -10,12 +10,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
||||
<el-form-item label="行政名称" prop="name">
|
||||
<el-input v-model="state.queryParams.name" placeholder="行政名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.name" placeholder="行政名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="8" :xl="6">
|
||||
<el-form-item label="行政代码" prop="code">
|
||||
<el-input v-model="state.queryParams.code" placeholder="行政代码" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.code" placeholder="行政代码" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -26,7 +26,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysRegion/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysRegion/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -168,9 +168,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="角色名称" prop="name">
|
||||
<el-input v-model="state.queryParams.name" placeholder="角色名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.name" placeholder="角色名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="角色编码" prop="code">
|
||||
<el-input v-model="state.queryParams.code" placeholder="角色编码" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.code" placeholder="角色编码" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -21,7 +21,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysRole/page'"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysRole/page'"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -152,9 +152,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -17,6 +17,16 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="所属机构">
|
||||
<el-cascader :options="state.orgData" :props="cascaderProps" placeholder="所属机构" clearable filterable class="w100" v-model="state.ruleForm.orgPid">
|
||||
<template #default="{ node, data }">
|
||||
<span>{{ data.name }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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-input v-model="state.ruleForm.name" placeholder="租户名称" clearable />
|
||||
@ -37,6 +47,11 @@
|
||||
<el-input v-model="state.ruleForm.email" placeholder="邮箱" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="过期时间">
|
||||
<el-date-picker v-model="state.ruleForm.expirationTime" type="datetime" placeholder="过期时间" value-format="YYYY-MM-DD HH:mm:ss" class="w100" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="排序">
|
||||
<el-input-number v-model="state.ruleForm.orderNo" placeholder="排序" class="w100" />
|
||||
@ -135,8 +150,8 @@
|
||||
import { reactive, ref } from 'vue';
|
||||
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { SysTenantApi } from '/@/api-services/api';
|
||||
import { UpdateTenantInput } from '/@/api-services/models';
|
||||
import { SysOrgApi, SysTenantApi } from '/@/api-services/api';
|
||||
import { SysOrg, UpdateTenantInput } from '/@/api-services/models';
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
@ -146,10 +161,17 @@ const ruleFormRef = ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
ruleForm: {} as UpdateTenantInput,
|
||||
orgData: [] as Array<SysOrg>,
|
||||
});
|
||||
// 级联选择器配置选项
|
||||
const cascaderProps = { checkStrictly: true, emitPath: false, value: 'id', label: 'name', expandTrigger: 'hover' };
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (row: any) => {
|
||||
const openDialog = async (row: any) => {
|
||||
// 获取机构数据
|
||||
var res = await getAPI(SysOrgApi).apiSysOrgListGet(0);
|
||||
state.orgData = res.data.result ?? [];
|
||||
|
||||
state.ruleForm = JSON.parse(JSON.stringify(row));
|
||||
state.isShowDialog = true;
|
||||
ruleFormRef.value?.resetFields();
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="租户名称" prop="name">
|
||||
<el-input v-model="state.queryParams.name" placeholder="租户名称" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.name" placeholder="租户名称" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="联系电话" prop="code">
|
||||
<el-input v-model="state.queryParams.phone" placeholder="联系电话" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.phone" placeholder="联系电话" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -21,7 +21,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysTenant/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysTenant/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -145,8 +145,9 @@ const options = useVxeTable<TenantOutput>(
|
||||
{ field: 'name', title: '租户名称', minWidth: 160, showOverflow: 'tooltip' },
|
||||
{ field: 'adminAccount', title: '租管账号', minWidth: 120, showOverflow: 'tooltip' },
|
||||
{ field: 'phone', title: '电话', minWidth: 120, showOverflow: 'tooltip' },
|
||||
{ field: 'host', title: '主机', showOverflow: 'tooltip' },
|
||||
// { field: 'host', title: '主机', showOverflow: 'tooltip' },
|
||||
{ field: 'email', title: '邮箱', minWidth: 150, showOverflow: 'tooltip' },
|
||||
{ field: 'expirationTime', title: '过期时间', minWidth: 150, showOverflow: 'tooltip' },
|
||||
{ field: 'tenantType', title: '租户类型', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_tenantType' } },
|
||||
{ field: 'status', title: '状态', minWidth: 100, slots: { default: 'row_status' } },
|
||||
{ field: 'dbType', title: '数据库类型', minWidth: 120, showOverflow: 'tooltip', slots: { default: 'row_dbType' } },
|
||||
@ -183,9 +184,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -10,12 +10,12 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="账号" prop="account">
|
||||
<el-input v-model="state.queryParams.account" placeholder="账号" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.account" placeholder="账号" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="姓名" prop="realName">
|
||||
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
@ -25,7 +25,7 @@
|
||||
</el-col>
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="手机号码" prop="phone">
|
||||
<el-input v-model="state.queryParams.phone" placeholder="手机号码" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="state.queryParams.phone" placeholder="手机号码" clearable @keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -36,7 +36,7 @@
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysUser/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)" v-auth="'sysUser/page'" :loading="options.loading"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
@ -191,9 +191,9 @@ const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, s
|
||||
};
|
||||
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
const handleQuery = async (reset = false) => {
|
||||
options.loading = true;
|
||||
await xGrid.value?.commitProxy('query');
|
||||
reset ? await xGrid.value?.commitProxy('reload') : await xGrid.value?.commitProxy('query');
|
||||
options.loading = false;
|
||||
};
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery"> 查询 </el-button>
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery(true)"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="resetQuery"> 重置 </el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user