Sposstato toggler in componenti
This commit is contained in:
@@ -7,8 +7,3 @@
|
||||
<span class="@rightStringCSS">@rightString</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace GPW.CORE.WRKLOG.Components
|
||||
namespace GPW.CORE.Comp
|
||||
{
|
||||
public partial class Toggler
|
||||
{
|
||||
@@ -205,6 +205,7 @@ namespace GPW.CORE.WRKLOG.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (isActive)
|
||||
@@ -1,7 +1,7 @@
|
||||
using BlazorCalendar;
|
||||
using BlazorCalendar.Models;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using static GPW.CORE.WRKLOG.Components.Toggler;
|
||||
using static GPW.CORE.Comp.Toggler;
|
||||
|
||||
namespace GPW.CORE.WRKLOG.Components
|
||||
{
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>3.0.2301.1307</Version>
|
||||
<Version>3.0.2301.1613</Version>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="chartJsData.cs" />
|
||||
<Compile Remove="Components\Toggler.razor.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -16,6 +17,7 @@
|
||||
<Content Remove="Components\Chart.razor" />
|
||||
<Content Remove="Components\ChartHist.razor" />
|
||||
<Content Remove="Components\ChartTS.razor" />
|
||||
<Content Remove="Components\Toggler.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using BlazorCalendar;
|
||||
using BlazorCalendar.Models;
|
||||
using GPW.CORE.Data.DbModels;
|
||||
using GPW.CORE.WRKLOG.Data;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using static GPW.CORE.WRKLOG.Components.Toggler;
|
||||
using static GPW.CORE.Comp.Toggler;
|
||||
|
||||
namespace GPW.CORE.WRKLOG.Pages
|
||||
{
|
||||
@@ -32,35 +31,18 @@ namespace GPW.CORE.WRKLOG.Pages
|
||||
protected int idxDipendente
|
||||
{
|
||||
get => AppMServ.IdxDipendente;
|
||||
//set => AppMServ.IdxDipendente = value;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
private bool showMalattie { get; set; } = false;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ToggleData = new SelectGlobalToggle()
|
||||
{
|
||||
leftString = "Malattie",
|
||||
rightString = "Ferie e Permessi",
|
||||
placardCss = "bg-light border-light text-dark",
|
||||
};
|
||||
initToggler();
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
private async Task evToggled(SelectGlobalToggle newTogData)
|
||||
{
|
||||
ToggleData = newTogData;
|
||||
showMalattie = !ToggleData.isActive;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private SelectGlobalToggle ToggleData { get; set; } = new SelectGlobalToggle();
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
@@ -77,8 +59,10 @@ namespace GPW.CORE.WRKLOG.Pages
|
||||
private List<Tasks> CalendarTasksList { get; set; } = new List<Tasks>();
|
||||
|
||||
private List<CalFesteFerieModel> ListFermateAzienda { get; set; } = new List<CalFesteFerieModel>();
|
||||
private List<RegRichiesteModel> ListRichiesteDip { get; set; } = new List<RegRichiesteModel>();
|
||||
private List<RegMalattieModel> ListMalattie { get; set; } = new List<RegMalattieModel>();
|
||||
private List<RegRichiesteModel> ListRichiesteDip { get; set; } = new List<RegRichiesteModel>();
|
||||
private bool showMalattie { get; set; } = false;
|
||||
private SelectGlobalToggle ToggleData { get; set; } = new SelectGlobalToggle();
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -104,11 +88,13 @@ namespace GPW.CORE.WRKLOG.Pages
|
||||
case "MAL":
|
||||
answ = conf ? "#000" : "#696969";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private string colorTextByGiustStato(string codGiust, bool conf)
|
||||
{
|
||||
string answ = "#EDEDED";
|
||||
@@ -136,11 +122,28 @@ namespace GPW.CORE.WRKLOG.Pages
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async Task evToggled(SelectGlobalToggle newTogData)
|
||||
{
|
||||
ToggleData = newTogData;
|
||||
showMalattie = !ToggleData.isActive;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private async Task ForceReloadCal()
|
||||
{
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
private void initToggler()
|
||||
{
|
||||
ToggleData = new SelectGlobalToggle()
|
||||
{
|
||||
leftString = "Malattie",
|
||||
rightString = "Ferie e Permessi",
|
||||
placardCss = "bg-light border-light text-dark",
|
||||
};
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
Reference in New Issue
Block a user