Merge branch 'Feature/TabPageTC' into develop
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2308.216" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2308.216" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.1.23421.29" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -17,18 +16,43 @@
|
||||
<th>TCiclo</th>
|
||||
<th>Note</th>
|
||||
<th>Periodo</th>
|
||||
<th>Impianto</th>
|
||||
<th class="text-end">Impianto</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (isLoading)
|
||||
{
|
||||
<i>...loading...</i>
|
||||
@for (int i = 0; i < NumRecPage; i++)
|
||||
{
|
||||
<tr class="placeholder-glow">
|
||||
<td>
|
||||
<div class="placeholder col-4"></div>
|
||||
<small class="placeholder col-8"></small>
|
||||
</td>
|
||||
<td>
|
||||
<div class="placeholder col-6"></div>
|
||||
<small class="placeholder col-6"></small>
|
||||
</td>
|
||||
<td><span class="placeholder col-12"></span></td>
|
||||
<td><span class="placeholder col-12"></span></td>
|
||||
<td class="text-end">
|
||||
<div class="placeholder col-10"></div>
|
||||
<small class="placeholder col-10"></small>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<b>griglia risultati</b>
|
||||
@if (ListODL != null && ListODL.Count > 0)
|
||||
@if (ListODL == null || ListODL.Count == 0)
|
||||
{
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<div class="alert alert-warning fs-5 w-100">Nessun record trovato</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in ListODL)
|
||||
{
|
||||
@@ -38,12 +62,12 @@
|
||||
<small class="text-secondary">@item.DescArticolo</small>
|
||||
</td>
|
||||
<td>
|
||||
@item.Tcassegnato
|
||||
<small class="text-secondary">@item.Tcassegnato</small>
|
||||
<div>@item.Tcassegnato.ToString("N3")</div>
|
||||
<small class="text-secondary">@item.Tcassegnato.ToString("N3")</small>
|
||||
</td>
|
||||
<td>@item.Note</td>
|
||||
<td>@item.DataInizio --> @item.DataFine</td>
|
||||
<td>
|
||||
<td class="text-end">
|
||||
<div>@item.IdxMacchina</div>
|
||||
<small class="text-secondary">@item.NumPezzi pz</small>
|
||||
</td>
|
||||
@@ -54,8 +78,9 @@
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -72,6 +97,11 @@
|
||||
protected string BaseAddr = "";
|
||||
protected bool isLoading = false;
|
||||
|
||||
protected int NumRecPage = 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,10 +132,20 @@
|
||||
var rawData = await Http.GetFromJsonAsync<List<ODLExpModel>>(ApiUrl);
|
||||
if (rawData != null)
|
||||
{
|
||||
ListODL = rawData;
|
||||
ListComplete = rawData;
|
||||
TotalCount = ListComplete.Count;
|
||||
// esegue paginazione
|
||||
if (TotalCount > NumRecPage)
|
||||
{
|
||||
ListODL = ListComplete.Skip((PageNum - 1) * NumRecPage).Take(NumRecPage).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
ListODL = ListComplete;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception exc)
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Error on dataload{Environment.NewLine}{exc}");
|
||||
}
|
||||
@@ -113,5 +153,17 @@
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected async Task SavePage(int newNum)
|
||||
{
|
||||
PageNum = newNum;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected async Task SaveNumRec(int newNum)
|
||||
{
|
||||
NumRecPage = newNum;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
}
|
||||
|
||||
@@ -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