mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-12-30 09:25:49 +08:00
feat: ✨ 前端表格高级筛选 (#100)
* chore: 🔨 css 基础单位 [skip ci] * fix: 🐛 ca2263 System.Enum.GetValues<TEnum>() [skip ci] * feat: ✨ 前端表格高级筛选 [skip ci]
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user