| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using AntDesign;
- using AntDesign.TableModels;
- using EasyTemplate.Tool;
- using Microsoft.JSInterop;
- namespace EasyTemplate.Blazor.Web.Components.Pages.Management.Area;
- public partial class Area
- {
- protected override async Task OnAfterRenderAsync(bool firstRender)
- {
- if (firstRender)
- {
- await NavigationManager.RedirectLogin(IJSRuntime);
- }
- }
- /// <summary>
- /// 查
- /// </summary>
- /// <returns></returns>
- private async Task Query()
- {
- Loading = true;
- DataSource = await Repository.AsQueryable().OrderBy(x => x.Sort).ToTreeAsync(x => x.Children, x => x.ParentCode, 0, x => x.AreaCode);
- Loading = false;
- }
- private async Task OnChange(QueryModel<SystemArea> query)
- => await Query();
- /// <summary>
- /// 账号
- /// </summary>
- private string Q_Name { get; set; }
- /// <summary>
- /// 注入实例
- /// </summary>
- [Inject] SqlSugarRepository<SystemArea> Repository { get; set; }
- /// <summary>
- ///
- /// </summary>
- [Inject] NavigationManager NavigationManager { get; set; }
- /// <summary>
- ///
- /// </summary>
- [Inject] IJSRuntime IJSRuntime { get; set; }
- /// <summary>
- ///
- /// </summary>
- private ITable Table;
- /// <summary>
- ///
- /// </summary>
- private IEnumerable<SystemArea> SelectedRows = [];
- /// <summary>
- ///
- /// </summary>
- private List<SystemArea> DataSource;
- /// <summary>
- ///
- /// </summary>
- private int Pi = 1;
- /// <summary>
- ///
- /// </summary>
- private int Ps = 20;
- /// <summary>
- ///
- /// </summary>
- private int _total;
- /// <summary>
- ///
- /// </summary>
- private bool Loading = false;
- }
|