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 DeptService(DefaultRepository<Sys_Dept> rpo) //
return ret;
}
/// <inheritdoc />
public Task<long> CountAsync(QueryReq<QueryDeptReq> req)
{
req.ThrowIfInvalid();
return QueryInternal(req).CountAsync();
}
/// <inheritdoc />
/// <exception cref="NetAdminInvalidOperationException">Parent_department_does_not_exist</exception>
public async Task<QueryDeptRsp> CreateAsync(CreateDeptReq req)
@ -88,12 +95,11 @@ public sealed class DeptService(DefaultRepository<Sys_Dept> rpo) //
}
/// <inheritdoc />
/// <exception cref="NetAdminUnexpectedException">NetAdminUnexpectedException</exception>
public async Task<QueryDeptRsp> UpdateAsync(UpdateDeptReq req)
{
req.ThrowIfInvalid();
return await Rpo.UpdateDiy.SetSource(req).ExecuteAffrowsAsync().ConfigureAwait(false) <= 0
? throw new NetAdminUnexpectedException()
? null
: (await QueryInternal(new QueryReq<QueryDeptReq> { Filter = new QueryDeptReq { Id = req.Id } }, true)
.ToTreeListAsync()
.ConfigureAwait(false))[0]
@ -118,6 +124,10 @@ public sealed class DeptService(DefaultRepository<Sys_Dept> rpo) //
ret = ret.AsTreeCte();
}
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) {