Modificato header con titolo pagina e prova pagina Customer
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.1.2606.0417</Version>
|
||||
<Version>1.1.2606.0515</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<div class="d-flex w-100 align-items-center">
|
||||
<div class="col-3 px-0 text-start">
|
||||
<a href="https://www.egalware.com" target="_blank">About Egalware</a>
|
||||
@inherits BaseComp
|
||||
|
||||
<div class="d-flex w-100 align-items-center px-3 py-2">
|
||||
<div class="flex-grow-1">
|
||||
<h3 class="mb-0">
|
||||
<span class="text-start fw-bold">@title</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="col-8 px-0">
|
||||
</div>
|
||||
<div class="col-1 px-2 text-end">
|
||||
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<i class="fa-solid fa-user-circle fa-lg text-dark"></i>
|
||||
<span class="text-dark fw-medium pe-3">User</span>
|
||||
<select class="form-select form-select-sm" @bind="CurrLang" @bind:after="() => SaveLang()">
|
||||
@* <option disabled>Sel →</option> *@
|
||||
<option value="IT">IT</option>
|
||||
<option value="EN">EN</option>
|
||||
</select>
|
||||
|
||||
@@ -5,11 +5,44 @@ namespace Lux.UI.Components.Compo.Common
|
||||
[Parameter]
|
||||
public string CurrLang { get; set; } = null!;
|
||||
|
||||
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_LangSelected { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string TitlePage { get; set; } = null!;
|
||||
|
||||
|
||||
private string title
|
||||
{
|
||||
get
|
||||
{
|
||||
string currentPageName = TitlePage switch
|
||||
{
|
||||
"Home" => @Traduci("navMan_home"),
|
||||
"" => @Traduci("navMan_home"),
|
||||
"Items" => @Traduci("navMan_artAcquisto"),
|
||||
"SellItems" => @Traduci("navMan_artVendita"),
|
||||
"Resources" => @Traduci("navMan_risorse"),
|
||||
"JobRoute" => @Traduci("navMan_cicli"),
|
||||
"Customer" => @Traduci("navMan_clienti"),
|
||||
"Dealer" => @Traduci("navMan_venditori"),
|
||||
"Template" => @Traduci("navMan_cataloghi"),
|
||||
"Offers" => @Traduci("navMan_offerte"),
|
||||
"Orders" => @Traduci("navMan_ordini"),
|
||||
"BuyOrder" => @Traduci("navMan_ordiniFornitore"),
|
||||
"WorkLoadBalance" => @Traduci("navMan_caricoMacchine"),
|
||||
"ProdPlanner" => @Traduci("navMan_pianificazione"),
|
||||
"GenList" => @Traduci("navMan_anagrafiche"),
|
||||
"ConfList" => @Traduci("navMan_config01"),
|
||||
"ConfListNew" => @Traduci("navMan_config02"),
|
||||
"stats" => @Traduci("navMan_stats"),
|
||||
"OffStats" => @Traduci("navMan_offerStats"),
|
||||
_ => "Pagina non definita"
|
||||
};
|
||||
return currentPageName;
|
||||
}
|
||||
}
|
||||
|
||||
private Task SaveLang()
|
||||
{
|
||||
return EC_LangSelected.InvokeAsync(CurrLang);
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<div class="page">
|
||||
<CascadingValue Value="currLang" Name="LangSel">
|
||||
<div class="@sideClass">
|
||||
<NavMenu EC_compressUpdated="UpdateNavDisplay" />
|
||||
<NavMenu EC_compressUpdated="UpdateNavDisplay" EC_titleUpdated="TitlePage" />
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<div class="top-row px-4">
|
||||
<CmpHeader CurrLang="@currLang" EC_LangSelected="SetLang"></CmpHeader>
|
||||
<CmpHeader CurrLang="@currLang" TitlePage="@titlePage" EC_LangSelected="SetLang"></CmpHeader>
|
||||
</div>
|
||||
|
||||
<article class="content px-4" style="padding-bottom: 40px;">
|
||||
|
||||
@@ -16,6 +16,11 @@ namespace Lux.UI.Components.Layout
|
||||
sideClass = navLarge ? "sidebar" : "sidebarSmall";
|
||||
}
|
||||
|
||||
protected void TitlePage(string title)
|
||||
{
|
||||
titlePage = title;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
@@ -24,6 +29,8 @@ namespace Lux.UI.Components.Layout
|
||||
|
||||
private bool navLarge = true;
|
||||
|
||||
private string titlePage = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace Lux.UI.Components.Layout
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_compressUpdated { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_titleUpdated { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
@@ -38,6 +41,7 @@ namespace Lux.UI.Components.Layout
|
||||
currentUrl = NavigationManager.ToBaseRelativePath(NavigationManager.Uri);
|
||||
NavigationManager.LocationChanged += OnLocationChanged;
|
||||
UpdateDict();
|
||||
AggiornaNomePagina();
|
||||
}
|
||||
|
||||
protected void ToggleCompress()
|
||||
@@ -62,6 +66,8 @@ namespace Lux.UI.Components.Layout
|
||||
private bool onlyIcon = false;
|
||||
private Dictionary<string, List<string>> PageDict = new Dictionary<string, List<string>>();
|
||||
|
||||
private string currentPageName = string.Empty;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
@@ -75,8 +81,17 @@ namespace Lux.UI.Components.Layout
|
||||
private void OnLocationChanged(object? sender, LocationChangedEventArgs e)
|
||||
{
|
||||
currentUrl = NavigationManager.ToBaseRelativePath(e.Location);
|
||||
AggiornaNomePagina();
|
||||
StateHasChanged();
|
||||
}
|
||||
private Task AggiornaNomePagina()
|
||||
{
|
||||
// Estrae solo il percorso (es. "Home", "Template") senza query/hash
|
||||
var path = NavigationManager.ToBaseRelativePath(NavigationManager.Uri);
|
||||
currentPageName = path.Split('?')[0].Split('#')[0].TrimStart('/');
|
||||
|
||||
return EC_titleUpdated.InvokeAsync(currentPageName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento dizionari per pagine raggruppate in sottomenu
|
||||
|
||||
@@ -1,6 +1,39 @@
|
||||
@page "/OffStats"
|
||||
|
||||
<div class="card shadow">
|
||||
<div class="d-flex align-items-center justify-content-between px-4">
|
||||
<a href="@NavigationManager.ToAbsoluteUri("Offers")"
|
||||
class="btn btn-primary shadow-sm rounded-4 d-flex align-items-center gap-2"
|
||||
style="width:7em; height:3em;">
|
||||
<i class="fa-solid fa-list ms-1"></i> Offerte
|
||||
</a>
|
||||
<div class="input-group input-group rounded-2 border-2 shadow-sm" style="width:35em;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">Da:</span>
|
||||
<input type="datetime-local"
|
||||
class="form-control"
|
||||
min="@periodoLimit.Inizio.AddHours(-1).ToString("yyyy-MM-ddTHH:mm")"
|
||||
max="@DateTime.Now.Hour.ToString("yyyy-MM-ddTHH:mm")"
|
||||
@bind="@dtFrom" />
|
||||
|
||||
<span class="input-group-text">A:</span>
|
||||
<input type="datetime-local"
|
||||
class="form-control"
|
||||
min="@periodoLimit.Inizio.ToString("yyyy-MM-ddTHH:mm")"
|
||||
max="@DateTime.Now.Hour.ToString("yyyy-MM-ddTHH:mm")"
|
||||
@bind="@dtTo" />
|
||||
|
||||
<button class="btn btn-sm @btnReload" @onclick="DoReload">
|
||||
Carica <i class="fa-solid fa-arrows-rotate"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1 overflow-auto m-2 p-3 shadow rounded-2 border-2">
|
||||
<OfferStats AllRecords="AllOfferRecords"></OfferStats>
|
||||
</div>
|
||||
|
||||
|
||||
@* <div class="card shadow">
|
||||
<div class="card-header">
|
||||
<div class="card-title m-1">
|
||||
<div class="d-flex align-items-center justify-content-between fs-4">
|
||||
@@ -38,85 +71,4 @@
|
||||
<div class="card-body">
|
||||
<OfferStats AllRecords="AllOfferRecords"></OfferStats>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* <div class="card shadow">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<div class="px-0">
|
||||
<div class="fw-bold fs-4">Offerte</div>
|
||||
</div>
|
||||
<div class="px-0 small d-flex">
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text">Da:</span>
|
||||
<input type="datetime-local"
|
||||
class="form-control"
|
||||
min="@periodoLimit.Inizio.AddHours(-1).ToString("yyyy-MM-ddTHH:mm")"
|
||||
max="@DateTime.Now.Hour.ToString("yyyy-MM-ddTHH:mm")"
|
||||
@bind="@dtFrom" />
|
||||
|
||||
<span class="input-group-text">A:</span>
|
||||
<input type="datetime-local"
|
||||
class="form-control"
|
||||
min="@periodoLimit.Inizio.ToString("yyyy-MM-ddTHH:mm")"
|
||||
max="@DateTime.Now.Hour.ToString("yyyy-MM-ddTHH:mm")"
|
||||
@bind="@dtTo" />
|
||||
|
||||
<button class="btn btn-sm @btnReload" @onclick="DoReload">
|
||||
Carica <i class="fa-solid fa-arrows-rotate"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row px-2">
|
||||
<div class="col-2 px-2">
|
||||
<div class="card border-0 rounded-3 shadow">
|
||||
<div class="card-header bg-primary bg-gradient bg-opacity-25 p-2 rounded">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<span class="fw-bold text-dark fs-5">Stato offerte</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<PieChart CanvasId="pieOfferCount" PieDict="@DatasetCount" DictColorFill="@FillColors" DictColorBorder="@BorderColors" Label="# Richieste" />
|
||||
</div>
|
||||
<div class="col-2 px-2">
|
||||
<div class="card border-0 rounded-3 shadow">
|
||||
<div class="card-header bg-primary bg-gradient bg-opacity-25 p-2 rounded">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<span class="fw-bold text-dark fs-5">Venditori</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<PieChart CanvasId="pieDealerCount" PieDict="@DatasetDealerCount" DictColorFill="@FillDealerColors" DictColorBorder="@BorderDealerColors" Label="# Offerte" />
|
||||
</div>
|
||||
<div class="col-7 ps-5">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<div class="card border-0 rounded-3 shadow">
|
||||
<div class="card-header bg-primary bg-gradient bg-opacity-25 p-4 rounded">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<span class="text-primary"><i class="fa-solid fa-coins fa-2x"></i></span>
|
||||
<span class="fw-bold text-dark fs-5 ps-1">Margine medio:</span>
|
||||
<span class="text-primary fs-5 fw-semibold">@MargineMedio() %</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pt-3">
|
||||
<div class="col-5">
|
||||
<div class="card border-0 rounded-3 shadow">
|
||||
<div class="card-header bg-primary bg-gradient bg-opacity-25 p-4 rounded">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<span class="text-primary"><i class="fa-solid fa-home fa-2x"></i></span>
|
||||
<span class="fw-bold text-dark fs-5 ps-1">Finestre per offerta:</span>
|
||||
<span class="text-primary fs-5 fw-semibold">@NumFinestreMedio()</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
</div> *@
|
||||
@@ -22,12 +22,6 @@ namespace Lux.UI.Components.Pages
|
||||
private List<OfferModel> AllOfferRecords { get; set; } = new();
|
||||
|
||||
private bool isLoading = false;
|
||||
//private Dictionary<string, string> FillColors = new();
|
||||
//private Dictionary<string, string> BorderColors = new();
|
||||
//private Dictionary<string, double> DatasetCount = new();
|
||||
//private Dictionary<string, string> FillDealerColors = new();
|
||||
//private Dictionary<string, string> BorderDealerColors = new();
|
||||
//private Dictionary<string, double> DatasetDealerCount = new();
|
||||
private bool needReload = false;
|
||||
private EgwCoreLib.Utils.DtUtils.Periodo periodoLimit = new EgwCoreLib.Utils.DtUtils.Periodo(EgwCoreLib.Utils.DtUtils.PeriodSet.LastYear);
|
||||
////private EgwCoreLib.Utils.DtUtils.Periodo periodoSel = new EgwCoreLib.Utils.DtUtils.Periodo(DateTime.Today.AddHours(DateTime.Now.Hour - 24 * 7), DateTime.Today.AddHours(DateTime.Now.Hour + 1));
|
||||
@@ -75,88 +69,5 @@ namespace Lux.UI.Components.Pages
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//private double MargineMedio()
|
||||
//{
|
||||
// var filtRecord = AllRecords.Where(x => x.OffertState.Equals(OfferStates.Confirmed));
|
||||
// return Math.Round((filtRecord.Sum(x=>x.TotalPrice) - filtRecord.Sum(x => x.TotalCost)) / filtRecord.Sum(x => x.TotalPrice) * 100, 2);
|
||||
//}
|
||||
|
||||
//private double NumFinestreMedio()
|
||||
//{
|
||||
// var filtRecord = AllRecords.Where(x => x.OffertState.Equals(OfferStates.Confirmed));
|
||||
// return Math.Ceiling(filtRecord.Sum(x => x.NumItems) / filtRecord.Count());
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Caricamento dati
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//private async Task DoReloadAsync()
|
||||
//{
|
||||
// await ReloadDataAsync();
|
||||
// ReloadStats();
|
||||
// ReloadDealerStats();
|
||||
// needReload = false;
|
||||
//}
|
||||
//private void ReloadStats()
|
||||
//{
|
||||
// var allStates = Enum.GetNames(typeof(Enums.OfferStates)).ToList();
|
||||
|
||||
// FillColors.Clear();
|
||||
// BorderColors.Clear();
|
||||
|
||||
// for (int i = 0; i < allStates.Count; i++)
|
||||
// {
|
||||
// switch (allStates[i])
|
||||
// {
|
||||
// case "Open":
|
||||
// FillColors[allStates[i]] = "hsla(180, 70%, 50%, 0.5)";
|
||||
// break;
|
||||
// case "Confirmed":
|
||||
// FillColors[allStates[i]] = "hsla(90, 70%, 50%, 0.5)";
|
||||
// break;
|
||||
// case "Expired":
|
||||
// FillColors[allStates[i]] = "hsla(0, 70%, 50%, 0.5)";
|
||||
// break;
|
||||
// case "Lost":
|
||||
// FillColors[allStates[i]] = "hsla(270, 70%, 50%, 0.5)";
|
||||
// break;
|
||||
// }
|
||||
// //FillColors[allStates[i]] = palette[i];
|
||||
// BorderColors[allStates[i]] = ColorHelper.ToOpaque(FillColors[allStates[i]]);
|
||||
// }
|
||||
|
||||
// DatasetCount = AllRecords
|
||||
// .Where(p => p.OffertState != null)
|
||||
// .GroupBy(p => p.OffertState.ToString())
|
||||
// .ToDictionary(g => g.Key, g => (double)g.Count());
|
||||
|
||||
// if (DatasetCount == null || DatasetCount.Count == 0)
|
||||
// DatasetCount = new Dictionary<string, double> { ["Nessuna Offerta"] = 1 };
|
||||
//}
|
||||
|
||||
//private void ReloadDealerStats()
|
||||
//{
|
||||
// var allDealer = AllRecords.Select(x=>x.DealerNav.LastName).Distinct().ToList();
|
||||
// var palette = ColorHelper.GeneratePalette(allDealer.Count, 0.5);
|
||||
|
||||
// FillDealerColors.Clear();
|
||||
// BorderDealerColors.Clear();
|
||||
|
||||
// for (int i = 0; i < allDealer.Count; i++)
|
||||
// {
|
||||
// FillDealerColors[allDealer[i]] = palette[i];
|
||||
// BorderDealerColors[allDealer[i]] = ColorHelper.ToOpaque(palette[i]);
|
||||
// }
|
||||
|
||||
// DatasetDealerCount = AllRecords
|
||||
// .Where(p => p.OffertState != null)
|
||||
// .GroupBy(p => p.DealerNav.LastName)
|
||||
// .ToDictionary(g => g.Key, g => (double)g.Count());
|
||||
|
||||
// if (DatasetDealerCount == null || DatasetDealerCount.Count == 0)
|
||||
// DatasetDealerCount = new Dictionary<string, double> { ["Nessun venditore"] = 1 };
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
|
||||
<Version>1.1.2606.0417</Version>
|
||||
<Version>1.1.2606.0515</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>LUX - Web Windows MES</i>
|
||||
<h4>Versione: 1.1.2606.0417</h4>
|
||||
<h4>Versione: 1.1.2606.0515</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2606.0417
|
||||
1.1.2606.0515
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2606.0417</version>
|
||||
<version>1.1.2606.0515</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user