From 2952046ae25ff311aa5f4e35ef0c950116cbad7c Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 21 May 2021 13:38:10 +0200 Subject: [PATCH] COmpletata review pagiazione --- MP.Stats/Components/DataPager.razor | 37 ++++++++++++-- MP.Stats/Components/LoadingData.razor | 4 +- MP.Stats/Pages/Index.razor | 2 +- MP.Stats/Pages/Oee.razor | 70 +++++++++++++-------------- 4 files changed, 71 insertions(+), 42 deletions(-) diff --git a/MP.Stats/Components/DataPager.razor b/MP.Stats/Components/DataPager.razor index 03cdd0d5..424d7640 100644 --- a/MP.Stats/Components/DataPager.razor +++ b/MP.Stats/Components/DataPager.razor @@ -9,7 +9,12 @@ - + + + + + + @for (int i = @startPage; i <= endPage; ++i) @@ -21,9 +26,14 @@ } + + + + + - + @@ -79,7 +89,7 @@ { get { - int answ = (int)(currPage / numPages) * numPages - 2; + int answ = (int)(currPage / numPages) * numPages; answ = answ > 0 ? answ : 1; return answ; } @@ -88,7 +98,26 @@ { get { - int answ = (int)(currPage / numPages) * numPages + numPages + 2; + int answ = (int)(currPage / numPages) * numPages + numPages; + answ = answ < LastPage ? answ : LastPage; + return answ; + } + } + + private int prevBlock + { + get + { + int answ = currPage - numPages; + answ = answ > 0 ? answ : 1; + return answ; + } + } + private int nextBlock + { + get + { + int answ = currPage + numPages; answ = answ < LastPage ? answ : LastPage; return answ; } diff --git a/MP.Stats/Components/LoadingData.razor b/MP.Stats/Components/LoadingData.razor index 4eb9ffb3..2ffebab8 100644 --- a/MP.Stats/Components/LoadingData.razor +++ b/MP.Stats/Components/LoadingData.razor @@ -1,5 +1,5 @@ -
-
+
+

loading data

diff --git a/MP.Stats/Pages/Index.razor b/MP.Stats/Pages/Index.razor index f2d91a2f..8466112e 100644 --- a/MP.Stats/Pages/Index.razor +++ b/MP.Stats/Pages/Index.razor @@ -28,7 +28,7 @@
- + diff --git a/MP.Stats/Pages/Oee.razor b/MP.Stats/Pages/Oee.razor index 97424547..3b2527fa 100644 --- a/MP.Stats/Pages/Oee.razor +++ b/MP.Stats/Pages/Oee.razor @@ -16,48 +16,48 @@
- @if (totalCount == 0 || ListRecords == null || ListRecords.Count() == 0) + @if (totalCount == 0 || ListRecords == null) { - + } else { -
-
- - - - - - - - - - - - - - @foreach (var record in ListRecords) +
+
+
DataTurnoMacchinaArticoloDurataPezziOEE %
+ + + + + + + + + + + + + @foreach (var record in ListRecords) { - - - - - - - - - + + + + + + + + + } - -
DataTurnoMacchinaArticoloDurataPezziOEE %
-
@record.DataRif.ToString("yyyy.MM.dd")
-
@record.Turno -
@record.CodMacchina
-
@record.IdxMacchina
-
@record.CodArticolo@record.TotPeriodo.ToString("N2")@record.TotPz@record.OEE.ToString("P2")
+
@record.DataRif.ToString("yyyy.MM.dd")
+
@record.Turno +
@record.CodMacchina
+
@record.IdxMacchina
+
@record.CodArticolo@record.TotPeriodo.ToString("N2")@record.TotPz@record.OEE.ToString("P2")
+ + +
-
}