Cambio display datapager
This commit is contained in:
@@ -28,7 +28,16 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
@totalCount records
|
||||
@if (showLoading)
|
||||
{
|
||||
<Progress>
|
||||
<ProgressBar Value="75" Striped="true" Animated="true" />
|
||||
</Progress>
|
||||
}
|
||||
else
|
||||
{
|
||||
@totalCountrecords
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,6 +96,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public bool showLoading { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public int totalCount { get; set; } = 0;
|
||||
|
||||
|
||||
+36
-36
@@ -18,50 +18,50 @@
|
||||
</div>
|
||||
@if (totalCount == 0 || ListRecords == null || ListRecords.Count() == 0)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Stato</th>
|
||||
<th class="text-right">Durata</th>
|
||||
<th class="text-right">Pezzi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Stato</th>
|
||||
<th class="text-right">Durata</th>
|
||||
<th class="text-right">Pezzi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.IdxMacchina, record.CodArticolo, record.InizioStato)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.InizioStato.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.InizioStato.ToString("ddd HH:mm.ss")</div>
|
||||
</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">@record.Descrizione</td>
|
||||
<td class="text-right">@record.DurataMin</td>
|
||||
<td class="text-right">@record.TotPzProd</td>
|
||||
</tr>
|
||||
<tr class="@checkSelect(@record.IdxMacchina, record.CodArticolo, record.InizioStato)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.InizioStato.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.InizioStato.ToString("ddd HH:mm.ss")</div>
|
||||
</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">@record.Descrizione</td>
|
||||
<td class="text-right">@record.DurataMin</td>
|
||||
<td class="text-right">@record.TotPzProd</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" />
|
||||
<DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" showLoading="@isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,6 +23,7 @@ namespace MP.Stats.Pages
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private int currPage { get; set; } = 1;
|
||||
private bool isLoading { get; set; } = false;
|
||||
private int numRecord { get; set; } = 10;
|
||||
|
||||
#endregion Private Properties
|
||||
@@ -60,10 +61,10 @@ namespace MP.Stats.Pages
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
isLoading = true;
|
||||
SearchRecords = await StatService.StatDdbGetAll(currFilter, MessageService.SearchVal);
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
@@ -72,6 +73,8 @@ namespace MP.Stats.Pages
|
||||
|
||||
protected async Task DoFilter(SelectData newFilter)
|
||||
{
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = newFilter;
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
+35
-35
@@ -18,49 +18,49 @@
|
||||
</div>
|
||||
@if (totalCount == 0 || ListRecords == null || ListRecords.Count() == 0)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data</th>
|
||||
<th>Turno</th>
|
||||
<th>Macchina</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Durata</th>
|
||||
<th class="text-right">Pezzi</th>
|
||||
<th class="text-right">OEE %</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data</th>
|
||||
<th>Turno</th>
|
||||
<th>Macchina</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Durata</th>
|
||||
<th class="text-right">Pezzi</th>
|
||||
<th class="text-right">OEE %</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(record.DataRif, record.Turno, @record.IdxMacchina)">
|
||||
<td>
|
||||
<div>@record.DataRif.ToString("yyyy.MM.dd")</div>
|
||||
</td>
|
||||
<td>@record.Turno</td>
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">@record.TotPeriodo.ToString("N2")</td>
|
||||
<td class="text-right">@record.TotPz</td>
|
||||
<td class="text-right">@record.OEE.ToString("P2")</td>
|
||||
</tr>
|
||||
<tr class="@checkSelect(record.DataRif, record.Turno, @record.IdxMacchina)">
|
||||
<td>
|
||||
<div>@record.DataRif.ToString("yyyy.MM.dd")</div>
|
||||
</td>
|
||||
<td>@record.Turno</td>
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">@record.TotPeriodo.ToString("N2")</td>
|
||||
<td class="text-right">@record.TotPz</td>
|
||||
<td class="text-right">@record.OEE.ToString("P2")</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" />
|
||||
<DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" showLoading="@isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,6 +24,7 @@ namespace MP.Stats.Pages
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private int currPage { get; set; } = 1;
|
||||
private bool isLoading { get; set; } = false;
|
||||
private int numRecord { get; set; } = 10;
|
||||
|
||||
#endregion Private Properties
|
||||
@@ -61,8 +62,10 @@ namespace MP.Stats.Pages
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await StatService.StatTurniOeeGetAllCached(currFilter, MessageService.SearchVal);
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
Reference in New Issue
Block a user