This commit is contained in:
mmrbnjd
2024-05-05 21:35:15 +03:30
parent df6c31eac2
commit 9511457704

View File

@@ -5,6 +5,8 @@
@using Shared.DTOs.Serch
@inject HttpClientController hc;
<PageTitle>مشتری</PageTitle>
<Preload LoadingText="در حال بارگذاری..." />
@* search *@
<div class="row">
<div class="col-md-12">
@@ -78,13 +80,12 @@
@* pagination *@
<nav aria-label="Page navigation">
<br />
<ul class="pagination justify-content-center">
@for (int page = 1; page <= request?.PageCount; page++)
{
if (page == PageIndex)
{
<li class="page-item disabled">
<li class="page-item active">
<a class="page-link" href="@hc._nav.GetUriWithQueryParameter("PageIndex",page)">@(page)</a>
</li>
}
@@ -95,15 +96,21 @@
</li>
}
}
</ul>
</nav>
}
@layout PanelLayout
@code {
[Inject] protected PreloadService PreloadService { get; set; } = default!;
// alert
AlertColor alertColor = AlertColor.Primary;
IconName alertIconName = IconName.CheckCircleFill;
@@ -112,6 +119,7 @@
protected override async Task OnParametersSetAsync()
{
if (PageIndex == null) PageIndex = 1;
await LoadCus(PageIndex.Value);
await base.OnParametersSetAsync();
@@ -139,6 +147,7 @@
}
public async Task LoadCus(int pi)
{
PreloadService.Show(SpinnerColor.Dark);
var rsp = await hc.Post<ItemSerchGetCustomer>("Customer/GetAll", new ItemSerchGetCustomer()
{
PageIndex=pi
@@ -155,5 +164,6 @@
{
ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
}
PreloadService.Hide();
}
}