From a3273ad3ea9493f206b04fae83bf8a5ce354800c Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 9 Dec 2021 15:10:39 +0100 Subject: [PATCH] OK selezione week --- GPW.CORE.Data/WeekData.cs | 13 ++++ GPW.CORE.UI/Components/WeekStat.razor | 106 ++++++++++++++++++++------ GPW.CORE.UI/Pages/Planner.razor | 75 ++++++++++-------- GPW.CORE.UI/Pages/Planner.razor.cs | 18 +++++ 4 files changed, 156 insertions(+), 56 deletions(-) diff --git a/GPW.CORE.Data/WeekData.cs b/GPW.CORE.Data/WeekData.cs index 8da3037..682c897 100644 --- a/GPW.CORE.Data/WeekData.cs +++ b/GPW.CORE.Data/WeekData.cs @@ -29,6 +29,19 @@ namespace GPW.CORE.Data this.fine = dtRif.Date.AddDays(7 - (int)day); } + /// + /// Calcola estremi settimana dato numero + anno + /// + /// + public WeekData(int year, int numWeek) + { + this.anno = year; + this.weekNumber = numWeek; + DateTime dtRif = new DateTime(year, 1, 4).AddDays(7 * numWeek); + DayOfWeek day = CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(dtRif); + this.inizio = dtRif.Date.AddDays(1 - (int)day); + this.fine = dtRif.Date.AddDays(7 - (int)day); + } /// /// Calcolo settimana dell'anno ISO 8601 diff --git a/GPW.CORE.UI/Components/WeekStat.razor b/GPW.CORE.UI/Components/WeekStat.razor index fe5cea5..d55dcbe 100644 --- a/GPW.CORE.UI/Components/WeekStat.razor +++ b/GPW.CORE.UI/Components/WeekStat.razor @@ -1,28 +1,40 @@ 
-
-
-
- @currData?.Inizio.ToString("ddd dd.MM") +
+
+
-
- T: @currData?.SumOreLav.ToString("N2") +
+
+
+ +
+ @currData?.SumOreLav.ToString("N2") +
-
- C: @currData?.SumOreComm.ToString("N2") +
+
+
+ +
+ @currData?.SumOreComm.ToString("N2") +
@@ -31,22 +43,63 @@
-@code { + @code { [Parameter] public CORE.Data.DTO.WeekStatDTO? currData { get; set; } + [Parameter] + public int WeekSel { get; set; } = 0; + + + [Parameter] + public EventCallback weekSelected { get; set; } + + protected int currWeekNum + { + get + { + int answ = 0; + if (currData != null) + { + answ = currData.WeekNumber; + } + return answ; + } + } + + protected void reportSelect() + { + weekSelected.InvokeAsync(currWeekNum); + } + + protected string selStyle + { + get + { + string currCss = "bg-secondary"; + if (currData != null) + { + currCss = currData.WeekNumber == WeekSel ? "btn-primary" : "btn-secondary"; + } + return currCss; + } + } + protected string styleLav { get { double valPerc = 0; - try + if (currData != null) { - valPerc = currData.SumOreLav / 64; + try + { + valPerc = currData.SumOreLav / 64; + } + catch + { } } - catch - { } return $"width: {valPerc:P0};"; } } @@ -55,14 +108,17 @@ get { double valPerc = 0; - try + if (currData != null) { - valPerc = currData.SumOreComm / 64; + try + { + valPerc = currData.SumOreComm / 64; + } + catch + { } } - catch - { } return $"width: {valPerc:P0};"; } } -} + } diff --git a/GPW.CORE.UI/Pages/Planner.razor b/GPW.CORE.UI/Pages/Planner.razor index 386e33d..c5b9b90 100644 --- a/GPW.CORE.UI/Pages/Planner.razor +++ b/GPW.CORE.UI/Pages/Planner.razor @@ -2,41 +2,40 @@ @using GPW.CORE.UI.Components -Pagina principale formato "agenda": -
    -
  • in testa elenco 5 settimane (corrente a dx, le 4 precedenti a sx) cliccabile con resoconto tot h lavorate e ore progetti (con segnale errore se delta > limite)
  • -
  • schema agenda settimanale x la settimana corrente / selezionata
  • -
  • per ogni giorno (stile google) nome + numero gg in testa
  • -
  • blocco verticale (configirabile, default 7-21) ogni 30'
  • -
  • click --> modal compilazione record (selettore gerarchico + ricerca ultimi progetti pareto a dx)
  • -
  • click + trascina?!?!? da verificare
  • -
  • in testa 2 icone x indicare OK temperatura e OK x check C19
  • -
  • sulla dx una colonna di "tempo timbrato"
  • -
-
+
-
+

Week Plan

+
+
+ @currWeekSel.inizio.ToString("ddd dd.MM") +
+
+ W@currWeekNum +
+
+ @currWeekSel.fine.ToString("ddd dd.MM") +
+
-
- @**@ +
+ @if (weekStatList != null) + { +
+ @foreach (var item in weekStatList) + { +
+ +
+ } +
+ }
- @if (weekStatList != null) - { -
- @foreach (var item in weekStatList) - { -
- -
- } -
- } @@ -89,15 +88,29 @@ Pagina principale formato "agenda":
} + +
+ Pagina principale formato "agenda": +
    +
  • schema agenda settimanale x la settimana corrente / selezionata
  • +
  • per ogni giorno (stile google) nome + numero gg in testa
  • +
  • blocco verticale (configirabile, default 7-21) ogni 30'
  • +
  • click --> modal compilazione record (selettore gerarchico + ricerca ultimi progetti pareto a dx)
  • +
  • click + trascina?!?!? da verificare
  • +
  • in testa 2 icone x indicare OK temperatura e OK x check C19
  • +
  • sulla dx una colonna di "tempo timbrato"
  • +
  • in testa elenco 5 settimane cliccabile
  • +
+
-