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

@@ -109,7 +109,7 @@ else
}
}
</div>
<div class="col-md-2" style="align-content:center">
<div class="col-md-2" >
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
</div>
</div>

View File

@@ -43,7 +43,10 @@
</div>
<div class="col-auto">
<button @onclick="() => LoadCod(1)" type="submit" class="btn btn-primary">جستجو</button>
<Button @onclick="() => LoadCod(1)" Color="ButtonColor.Primary">جستجو</Button>
</div>
<div class="col-auto">
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
</div>
</div>
</li>
@@ -125,6 +128,7 @@
@layout PanelLayout
@code {
public bool SpinnerVisible { get; set; } = false;
//private Modal stuffmodal = default!;
[Inject] protected PreloadService PreloadService { get; set; } = default!;
ItemSerchGetCOD itemsearch = new ItemSerchGetCOD();
@@ -141,15 +145,18 @@
protected override async Task OnInitializedAsync()
{
SpinnerVisible = true;
Unitrequest =await fv.GetUnits();
SpinnerVisible = false;
await base.OnInitializedAsync();
}
protected override async Task OnParametersSetAsync()
{
SpinnerVisible = false;
if (PageIndex == null) PageIndex = 1;
await LoadCod(PageIndex.Value);
await base.OnParametersSetAsync();
}
}
@@ -170,6 +177,7 @@
}
public async Task LoadCod(int pi)
{
SpinnerVisible = true;
if (itemsearch.UnitID == 0) itemsearch.UnitID = null;
itemsearch.PageSize = 10;
itemsearch.PageIndex = pi;
@@ -188,6 +196,7 @@
ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
}
PreloadService.Hide();
SpinnerVisible = false;
}
public async Task CallBackCodItem(ActionInResultComponent result)
{

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)
{