OK selezione week
This commit is contained in:
@@ -29,6 +29,19 @@ namespace GPW.CORE.Data
|
||||
this.fine = dtRif.Date.AddDays(7 - (int)day);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola estremi settimana dato numero + anno
|
||||
/// </summary>
|
||||
/// <param name="numWeek"></param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcolo settimana dell'anno ISO 8601
|
||||
|
||||
@@ -1,28 +1,40 @@
|
||||
|
||||
<div class="card text-center">
|
||||
<div class="card-header py-1">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="py-0 px-1">
|
||||
<sub>@currData?.Inizio.ToString("ddd dd.MM")</sub>
|
||||
<div class="card-header p-0">
|
||||
<button class="btn btn-block @selStyle text-light py-1" @onclick="reportSelect">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="py-0 px-1">
|
||||
<sub>@currData?.Inizio.ToString("ddd dd.MM")</sub>
|
||||
</div>
|
||||
<div class="py-0 px-1">
|
||||
W<b>@currData?.WeekNumber</b>
|
||||
</div>
|
||||
<div class="py-0 px-1">
|
||||
<sub>@currData?.Fine.ToString("ddd dd.MM")</sub>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-0 px-1">
|
||||
W<b>@currData?.WeekNumber</b>
|
||||
</div>
|
||||
<div class="py-0 px-1">
|
||||
<sub>@currData?.Fine.ToString("ddd dd.MM")</sub>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
T: <span class="font-weight-bold text-primary">@currData?.SumOreLav.ToString("N2")</span>
|
||||
<div class="col-6 pr-1">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"<i class="far fa-calendar-alt"></i></span>
|
||||
</div>
|
||||
<span class="form-control disabled text-primary" title="Ore Lavorate"><b>@currData?.SumOreLav.ToString("N2")</b></span>
|
||||
</div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" style="@styleLav"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
C: <span class="font-weight-bold text-success">@currData?.SumOreComm.ToString("N2")</span>
|
||||
<div class="col-6 pl-1">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"<i class="far fa-hourglass"></i></span>
|
||||
</div>
|
||||
<span class="form-control disabled text-success" title="Ore Caricate"><b>@currData?.SumOreComm.ToString("N2")</b></span>
|
||||
</div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-success" style="@styleCom"></div>
|
||||
</div>
|
||||
@@ -31,22 +43,63 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public CORE.Data.DTO.WeekStatDTO? currData { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public int WeekSel { get; set; } = 0;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> 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};";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,41 +2,40 @@
|
||||
@using GPW.CORE.UI.Components
|
||||
|
||||
|
||||
Pagina principale formato "agenda":
|
||||
<ul>
|
||||
<li>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)</li>
|
||||
<li>schema agenda settimanale x la settimana corrente / selezionata</li>
|
||||
<li>per ogni giorno (stile google) nome + numero gg in testa</li>
|
||||
<li>blocco verticale (configirabile, default 7-21) ogni 30'</li>
|
||||
<li> click --> modal compilazione record (selettore gerarchico + ricerca ultimi progetti pareto a dx)</li>
|
||||
<li>click + trascina?!?!? da verificare</li>
|
||||
<li> in testa 2 icone x indicare OK temperatura e OK x check C19</li>
|
||||
<li> sulla dx una colonna di "tempo timbrato"</li>
|
||||
</ul>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header table-primary">
|
||||
<div class="card-header table-primary py-1">
|
||||
<div class="row">
|
||||
<div class="col-6 col-lg-8 col-xl-9">
|
||||
<div class="col-12 col-lg-2 text-center">
|
||||
<h3>Week Plan</h3>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="py-0 px-1">
|
||||
<sub>@currWeekSel.inizio.ToString("ddd dd.MM")</sub>
|
||||
</div>
|
||||
<div class="py-0 px-1">
|
||||
W<b>@currWeekNum</b>
|
||||
</div>
|
||||
<div class="py-0 px-1">
|
||||
<sub>@currWeekSel.fine.ToString("ddd dd.MM")</sub>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-lg-4 col-xl-3">
|
||||
@*<button class="btn btn-block btn-success" @onclick="CreateNew">Aggiunta Consegna <i class="far fa-calendar-plus"></i></button>*@
|
||||
<div class="col-12 col-lg-10">
|
||||
@if (weekStatList != null)
|
||||
{
|
||||
<div class="row">
|
||||
@foreach (var item in weekStatList)
|
||||
{
|
||||
<div class="col px-1">
|
||||
<WeekStat currData="@item" WeekSel="@currWeekNum" weekSelected="setWeekNumber"></WeekStat>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (weekStatList != null)
|
||||
{
|
||||
<div class="row">
|
||||
@foreach (var item in weekStatList)
|
||||
{
|
||||
<div class="col">
|
||||
<WeekStat currData="@item"></WeekStat>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -89,15 +88,29 @@ Pagina principale formato "agenda":
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="small">
|
||||
Pagina principale formato "agenda":
|
||||
<ul>
|
||||
<li>schema agenda settimanale x la settimana corrente / selezionata</li>
|
||||
<li>per ogni giorno (stile google) nome + numero gg in testa</li>
|
||||
<li>blocco verticale (configirabile, default 7-21) ogni 30'</li>
|
||||
<li> click --> modal compilazione record (selettore gerarchico + ricerca ultimi progetti pareto a dx)</li>
|
||||
<li>click + trascina?!?!? da verificare</li>
|
||||
<li> in testa 2 icone x indicare OK temperatura e OK x check C19</li>
|
||||
<li> sulla dx una colonna di "tempo timbrato"</li>
|
||||
<li>in testa elenco 5 settimane cliccabile</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="card-footer py-1">
|
||||
<div class="row small">
|
||||
<div class="col-3">
|
||||
Selezione range orario:
|
||||
@*<input @bind="startHour" style="width: 2em;" />
|
||||
<input @bind="startHour" style="width: 2em;" />
|
||||
|
||||
<i class="fas fa-angle-double-right"></i>
|
||||
<input @bind="endHour" style="width: 2em;" />*@
|
||||
<i class="fas fa-angle-double-right"></i>
|
||||
<input @bind="endHour" style="width: 2em;" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,6 +14,7 @@ using Microsoft.JSInterop;
|
||||
using GPW.CORE.UI;
|
||||
using GPW.CORE.UI.Shared;
|
||||
using GPW.CORE.UI.Data;
|
||||
using GPW.CORE.Data;
|
||||
|
||||
namespace GPW.CORE.UI.Pages
|
||||
{
|
||||
@@ -189,6 +190,22 @@ namespace GPW.CORE.UI.Pages
|
||||
}
|
||||
}
|
||||
|
||||
protected WeekData currWeekSel
|
||||
{
|
||||
get
|
||||
{
|
||||
int anno = DateTime.Today.Year;
|
||||
return new WeekData(anno, currWeekNum);
|
||||
}
|
||||
}
|
||||
|
||||
protected int currWeekNum { get; set; } = 0;
|
||||
|
||||
protected void setWeekNumber(int newNum)
|
||||
{
|
||||
currWeekNum = newNum;
|
||||
}
|
||||
|
||||
private void checkHourRange()
|
||||
{
|
||||
int minHour = 7;
|
||||
@@ -216,6 +233,7 @@ namespace GPW.CORE.UI.Pages
|
||||
{
|
||||
isLoading = true;
|
||||
weekStatList = await DataService.LastWeeks(1,DateTime.Today, 4);
|
||||
currWeekNum = weekStatList.Last().WeekNumber;
|
||||
#if false
|
||||
ListRecords = await DataService.WeekPlanGet();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user