feat: 前端表格高级筛选 (#100)

* chore: 🔨 css 基础单位

[skip ci]

* fix: 🐛 ca2263 System.Enum.GetValues<TEnum>()

[skip ci]

* feat:  前端表格高级筛选

[skip ci]
This commit is contained in:
2024-04-22 21:16:53 +08:00
committed by GitHub
parent 1dc953a2b2
commit 3847d6fdbb
175 changed files with 1901 additions and 630 deletions

View File

@@ -25,6 +25,13 @@ public sealed class RoleService(DefaultRepository<Sys_Role> rpo) //
return ret;
}
/// <inheritdoc />
public Task<long> CountAsync(QueryReq<QueryRoleReq> req)
{
req.ThrowIfInvalid();
return QueryInternal(req).CountAsync();
}
/// <inheritdoc />
public async Task<QueryRoleRsp> CreateAsync(CreateRoleReq req)
{
@@ -116,8 +123,12 @@ public sealed class RoleService(DefaultRepository<Sys_Role> rpo) //
.WhereIf( //
req.Keywords?.Length > 0
, a => a.Id == req.Keywords.Int64Try(0) || a.Name.Contains(req.Keywords) ||
a.Summary.Contains(req.Keywords))
.OrderByPropertyNameIf(req.Prop?.Length > 0, req.Prop, req.Order == Orders.Ascending);
a.Summary.Contains(req.Keywords));
if (req.Order == Orders.Random) {
return ret.OrderByRandom();
}
ret = ret.OrderByPropertyNameIf(req.Prop?.Length > 0, req.Prop, req.Order == Orders.Ascending);
if (!req.Prop?.Equals(nameof(req.Filter.Sort), StringComparison.OrdinalIgnoreCase) ?? true) {
ret = ret.OrderByDescending(a => a.Sort);