Update display cone vento ritorno sel giorno da week
This commit is contained in:
@@ -8,6 +8,12 @@
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
|
||||
<div class="row bg-dark py-3">
|
||||
<div class="col">
|
||||
<CalendarWeek DateList="@ListDate" EventList="@EventListWeek" PercY="60" backToCalendar="ForceReloadWeek" EC_HeadDateSel="SetDayDetail"></CalendarWeek>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row bg-dark">
|
||||
<div class="col">
|
||||
<CircleGauge maxVal="480" currVal="240" Titolo="4:00" Testo="Lavorate"></CircleGauge>
|
||||
@@ -29,12 +35,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row bg-dark py-3">
|
||||
<div class="col">
|
||||
<CalendarWeek DateList="@ListDate" EventList="@EventListWeek" PercY="90"></CalendarWeek>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<b>@($"{dtCurr:ddd dd.MM.yyyy}")</b>
|
||||
|
||||
@@ -34,6 +34,46 @@ namespace EgwCoreLib.BlazorTest.Pages
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Forza ricaricamento week
|
||||
/// </summary>
|
||||
protected void ForceReloadWeek()
|
||||
{
|
||||
// preparo calendario settimanale...
|
||||
setupWeekSim();
|
||||
}
|
||||
|
||||
protected void SetDayDetail(DateTime selDate)
|
||||
{
|
||||
var tmpDays = new List<DateTime>();
|
||||
var tmpEv = new List<CalendarEvent>();
|
||||
|
||||
tmpDays.Add(selDate);
|
||||
// genero qualche evento da 0 a 6...
|
||||
int numEv = rnd.Next(0, 8);
|
||||
if (numEv > 0)
|
||||
{
|
||||
for (int e = 0; e < numEv; e++)
|
||||
{
|
||||
double duration = 9 + 8 * rnd.NextDouble();
|
||||
CalendarEvent newEv = new CalendarEvent()
|
||||
{
|
||||
CssClass = "bg-success opacity-25",
|
||||
Description = $"Permesso #{e}",
|
||||
Type = "PERM",
|
||||
Inizio = selDate.AddHours(8),
|
||||
Fine = selDate.AddHours(duration),
|
||||
Title = "O.S.",
|
||||
ToolTip = $"O.S. {selDate.AddHours(8)} - {selDate.AddHours(duration)}"
|
||||
};
|
||||
tmpEv.Add(newEv);
|
||||
}
|
||||
}
|
||||
// salvo valori simulati
|
||||
ListDate = tmpDays;
|
||||
EventListWeek = tmpEv;
|
||||
}
|
||||
|
||||
protected Random rnd = new Random();
|
||||
private void setupWeekSim()
|
||||
{
|
||||
@@ -53,9 +93,9 @@ namespace EgwCoreLib.BlazorTest.Pages
|
||||
{
|
||||
CssClass = "bg-success opacity-25",
|
||||
Description = $"Permesso #{e}",
|
||||
Type = "FER",
|
||||
Type = "PERM",
|
||||
Inizio = oggi.AddDays(i).AddHours(8),
|
||||
Fine = oggi.AddDays(i).AddHours(17),
|
||||
Fine = oggi.AddDays(i).AddHours(9 + 8 * rnd.NextDouble()),
|
||||
Title = "O.S.",
|
||||
ToolTip = $"O.S. {oggi.AddDays(i).AddHours(8)} - {oggi.AddDays(i).AddHours(17)}"
|
||||
};
|
||||
|
||||
@@ -7,10 +7,10 @@ else
|
||||
<table class="cssTable" style="@HeadStyle">
|
||||
<thead>
|
||||
<tr class="">
|
||||
<th class="text-center text-light" @onclick="()=>openCalendarMonth()" style="width: @lblWidth;"><i class="fa-regular fa-circle-xmark"></i></th>
|
||||
<th class="text-center text-light" @onclick="()=>OpenCalendarMonth()" style="width: @lblWidth;"><i class="fa-regular fa-circle-xmark"></i></th>
|
||||
@foreach (var item in DateList)
|
||||
{
|
||||
<th class="text-center" style="width: @dataWidth;">
|
||||
<th class="text-center" style="width: @dataWidth;" @onclick="()=>SelectDate(item)">
|
||||
<div>
|
||||
@($"{item:ddd}".Substring(0, 1).ToUpper())
|
||||
</div>
|
||||
|
||||
@@ -41,6 +41,13 @@ namespace EgwCoreLib.Razor
|
||||
[Parameter]
|
||||
public EventCallback<bool> backToCalendar{ get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Evento selezione data singola giornata da header
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DateTime> EC_HeadDateSel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ora fine visualizzazione calendario
|
||||
/// </summary>
|
||||
@@ -221,10 +228,17 @@ namespace EgwCoreLib.Razor
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task openCalendarMonth()
|
||||
protected async Task OpenCalendarMonth()
|
||||
{
|
||||
await backToCalendar.InvokeAsync(true);
|
||||
}
|
||||
|
||||
protected async Task SelectDate( DateTime selDate)
|
||||
{
|
||||
await EC_HeadDateSel.InvokeAsync(selDate);
|
||||
}
|
||||
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user