Update test paginazione
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
<MP_TAB.Client.Components.TcHistoryFilter Title="Storico Tempi Ciclo" SearchMinChar="@SearchMinChar" E_CodArt="SelCodArt" E_IdxMacc="SelIdxMacc" MatrOpr="@MatrOpr"></MP_TAB.Client.Components.TcHistoryFilter>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -38,7 +37,7 @@
|
||||
<small class="text-secondary">@item.DescArticolo</small>
|
||||
</td>
|
||||
<td>
|
||||
@item.Tcassegnato
|
||||
<div>@item.Tcassegnato</div>
|
||||
<small class="text-secondary">@item.Tcassegnato</small>
|
||||
</td>
|
||||
<td>@item.Note</td>
|
||||
@@ -54,17 +53,18 @@
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public int MatrOpr { get; set; } = 0;
|
||||
[Parameter]
|
||||
public int MatrOpr { get; set; } = 0;
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration config { get; set; } = null!;
|
||||
[Inject]
|
||||
protected IConfiguration config { get; set; } = null!;
|
||||
|
||||
protected int SearchMinChar = 3;
|
||||
protected string CodArt = "";
|
||||
@@ -72,6 +72,11 @@
|
||||
protected string BaseAddr = "";
|
||||
protected bool isLoading = false;
|
||||
|
||||
protected int PageSize = 10;
|
||||
protected int TotalCount = 0;
|
||||
protected int PageNum = 1;
|
||||
|
||||
protected List<ODLExpModel> ListComplete { get; set; } = new List<ODLExpModel>();
|
||||
protected List<ODLExpModel> ListODL { get; set; } = new List<ODLExpModel>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -102,7 +107,17 @@
|
||||
var rawData = await Http.GetFromJsonAsync<List<ODLExpModel>>(ApiUrl);
|
||||
if (rawData != null)
|
||||
{
|
||||
ListODL = rawData;
|
||||
ListComplete = rawData;
|
||||
TotalCount = ListComplete.Count;
|
||||
// esegue paginazione
|
||||
if(TotalCount>PageSize)
|
||||
{
|
||||
ListODL = ListComplete.Skip((PageNum - 1) * PageSize).Take(PageSize).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
ListODL = ListComplete;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception exc)
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace MP.Data.Services
|
||||
/// <param name="CodArt">Cod articolo</param>
|
||||
/// <param name="IdxMacchina">Macchina selezionata</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ODLExpModel>> ListODLFilt(string CodArt, string IdxMacchina)
|
||||
public async Task<List<ODLExpModel>> ListODLFilt(string CodArt, string IdxMacchina="*")
|
||||
{
|
||||
// setup parametri costanti
|
||||
bool inCorso = false;
|
||||
|
||||
Reference in New Issue
Block a user