This commit is contained in:
mmrbnjd
2024-10-14 16:26:20 +03:30
parent 35cad6876b
commit 831e5fafec
3 changed files with 22 additions and 5 deletions

View File

@@ -44,6 +44,9 @@
<div class="col-auto">
<button @onclick="() => LoadCus(1)" type="submit" class="btn btn-primary">جستجو</button>
</div>
<div class="col-auto">
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
</div>
</div>
</li>
</ul>
@@ -62,6 +65,7 @@
<div class="col-auto">
<button type="submit" @onclick="()=>CustomerItem(0)" class="btn btn-primary">جدید</button>
</div>
</div>
</div>
</div>
@@ -108,7 +112,7 @@
@layout PanelLayout
@code {
public bool SpinnerVisible { get; set; } = false;
[Inject] protected PreloadService PreloadService { get; set; } = default!;
public int? ItemSearchCustomertype { get; set; }
ItemSerchGetCustomer itemsearch = new ItemSerchGetCustomer();
@@ -124,8 +128,10 @@
protected override async Task OnParametersSetAsync()
{
SpinnerVisible = true;
if (PageIndex == null) PageIndex = 1;
await LoadCus(PageIndex.Value);
SpinnerVisible = false;
await base.OnParametersSetAsync();
}
}
@@ -146,6 +152,7 @@
}
public async Task LoadCus(int pi)
{
SpinnerVisible = true;
if (ItemSearchCustomertype > 0)
itemsearch.CustomerType = (CustomerType)ItemSearchCustomertype;
else
@@ -168,6 +175,7 @@
ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
}
PreloadService.Hide();
SpinnerVisible = false;
}
public async Task CallBackCustomerItem(ActionInResultComponent result)
{