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