From afac6d4d6236e60bbe545f0ea0cbe765a960cbb1 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 2 Sep 2026 14:57:28 +0200 Subject: [PATCH] - Modifica modale per stampa file - Modifica componente filtro - Modifica interfaccia risorse e cicli --- Lux.API/Lux.API.csproj | 2 +- .../Components/Compo/Common/PrintModal.razor | 26 ++++--- Lux.UI/Components/Compo/Item/DataFilter.razor | 30 ++++---- .../Components/Compo/Item/DataFilter.razor.cs | 41 +++++----- .../Components/Compo/JobTask/JobStepMan.razor | 16 ++-- .../Compo/JobTask/ResourcesMan.razor | 27 +++++-- .../Compo/JobTask/ResourcesMan.razor.cs | 76 +++++++++++-------- .../Components/Compo/JobTask/TagDisplay.razor | 2 +- .../Compo/Templates/TemplateRowList.razor | 27 +------ .../Compo/Templates/TemplateRowMan.razor | 65 +++++++++------- .../Compo/Templates/TemplateRowMan.razor.cs | 22 ++++++ Lux.UI/Components/Pages/JobRoute.razor | 6 +- Lux.UI/Components/Pages/OffStats.razor | 22 +----- Lux.UI/Components/Pages/OffStats.razor.cs | 74 +++++++++--------- Lux.UI/Components/Pages/Resources.razor | 18 ++++- Lux.UI/Components/Pages/Resources.razor.cs | 63 +++++++++++++++ Lux.UI/Components/Pages/WorkLoadBalance.razor | 3 +- Lux.UI/Lux.UI.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 21 files changed, 310 insertions(+), 218 deletions(-) diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index f2d8538..2bae693 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2608.2817 + 1.1.2609.0214 diff --git a/Lux.UI/Components/Compo/Common/PrintModal.razor b/Lux.UI/Components/Compo/Common/PrintModal.razor index b1ce418..f947410 100644 --- a/Lux.UI/Components/Compo/Common/PrintModal.razor +++ b/Lux.UI/Components/Compo/Common/PrintModal.razor @@ -16,20 +16,24 @@ { @if (repType.Equals("MaterialReqOrd")) { -
-
- - +
+
+
+ + +
@if (!string.IsNullOrEmpty(SelectCodGroup)) { - Lista materiale @Descrizione(SelectCodGroup) + }
} diff --git a/Lux.UI/Components/Compo/Item/DataFilter.razor b/Lux.UI/Components/Compo/Item/DataFilter.razor index 64d8b96..e3a5f84 100644 --- a/Lux.UI/Components/Compo/Item/DataFilter.razor +++ b/Lux.UI/Components/Compo/Item/DataFilter.razor @@ -1,7 +1,7 @@ @inherits BaseComp -
-
+
+
@@ -10,7 +10,7 @@
@if (ShowItemsBuy) { -
+
@Traduci("gruppo")
-
+
@Traduci("tipo") @@ -51,13 +51,13 @@
} -
-@if (AddEnabled()) -{ -
- -
-} \ No newline at end of file + @if (AddEnabled) + { +
+ +
+ } +
\ No newline at end of file diff --git a/Lux.UI/Components/Compo/Item/DataFilter.razor.cs b/Lux.UI/Components/Compo/Item/DataFilter.razor.cs index 130655c..554d720 100644 --- a/Lux.UI/Components/Compo/Item/DataFilter.razor.cs +++ b/Lux.UI/Components/Compo/Item/DataFilter.razor.cs @@ -33,20 +33,6 @@ #endregion Protected Methods - private bool AddEnabled() - { - bool answ = false; - if (ShowItemsBuy) - { - answ = (!string.IsNullOrEmpty(SelCodGroup) && SelType != Enums.ItemClassType.ND); - } - else - { - answ = (SelEnvir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.NULL); - } - return answ; - } - #region Private Properties [Inject] @@ -104,6 +90,23 @@ } } + private bool AddEnabled + { + get + { + bool answ = false; + if (ShowItemsBuy) + { + answ = (!string.IsNullOrEmpty(SelCodGroup) && SelType != Enums.ItemClassType.ND); + } + else + { + answ = (SelEnvir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.NULL); + } + return answ; + } + } + #endregion Private Properties #region Private Methods @@ -127,16 +130,6 @@ get => string.IsNullOrEmpty(CurrFilt.SearchVal) ? "btn-outline-secondary" : "btn-primary"; } - private string searchDim() - { - string ans = ""; - if (ShowItemsBuy) - ans = "col-4"; - else - ans = "col-6"; - return ans; - } - #endregion Private Methods } } \ No newline at end of file diff --git a/Lux.UI/Components/Compo/JobTask/JobStepMan.razor b/Lux.UI/Components/Compo/JobTask/JobStepMan.razor index 9731a49..d6e9664 100644 --- a/Lux.UI/Components/Compo/JobTask/JobStepMan.razor +++ b/Lux.UI/Components/Compo/JobTask/JobStepMan.razor @@ -101,19 +101,16 @@ - - - + - + @@ -152,14 +149,14 @@ - } else { @@ -175,8 +172,7 @@ - } diff --git a/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor b/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor index ea3b797..8e67d8f 100644 --- a/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor +++ b/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor @@ -21,9 +21,11 @@ else - + @if (selRecord == null) + { + + + } @@ -36,6 +38,11 @@ else + @if (selRecord == null) + { + + + } } + @if (totalCount > numRecord) + { + + + + + + }
+ @Traduci("ord")@Traduci("ord") @Traduci("cicli_fase") @Traduci("cicli_risorsa") @Traduci("descrizione") @Traduci("cicli_tags") @Traduci("cicli_resa") - @* *@ -
+ - + @* *@ @item.Index @($"{item.ProductivityRate:P2}") - + @Traduci("cod") @Traduci("nome") @Traduci("risorsa_driver") - - Prezzo unitarioCosto unitario
@item.CodResource @item.Name @item.DriverNav.Name@($"{item.BasePrice:C2}")@($"{item.BaseRockBottomCost:C2}") @if (!item.IsUsed) { @@ -49,6 +56,16 @@ else
+ +
@if (selRecord != null) @@ -59,9 +76,9 @@ else } else { -
+ @*
← selezionare una risorsa per visualizzare dettaglio costing e simulazione -
+
*@ }
} diff --git a/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor.cs b/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor.cs index 82ce2e5..08def6f 100644 --- a/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor.cs +++ b/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor.cs @@ -9,11 +9,17 @@ namespace Lux.UI.Components.Compo.JobTask [Parameter] public string CurrSearch { get; set; } = string.Empty; + [Parameter] + public List AllRecords { get; set; } = null!; + + [Parameter] + public EventCallback EC_Update { get; set; } + #endregion Public Properties #region Protected Fields - protected List AllRecords = new List(); + //protected List AllRecords = new List(); protected List ListCostDriver = new List(); protected List ListRecords = new List(); protected List SearchRecords = new List(); @@ -39,10 +45,6 @@ namespace Lux.UI.Components.Compo.JobTask private int currPage = 1; -#if false - private ResourceModel? editRecord = null; -#endif - private bool isLoading = false; private int numRecord = 10; @@ -72,7 +74,7 @@ namespace Lux.UI.Components.Compo.JobTask private string mainCss { - get => selRecord == null ? "col-6" : "col-4"; + get => selRecord == null ? "col-12" : "col-4"; } [Inject] @@ -97,33 +99,34 @@ namespace Lux.UI.Components.Compo.JobTask return answ; } - private async Task DoAdd() - { - mTitle = "Attenzione"; - mMessage = "Confermi di voler aggiungere un nuovo record risorsa?"; - mMode = BootstrapModal.ModalMode.Confirm; - modalOpt = new(); - modalOpt.Add(true, "Si"); - modalOpt.Add(false, "No"); - if (!await Modal!.ShowAsync()) - return; + //private async Task DoAdd() + //{ + // mTitle = "Attenzione"; + // mMessage = "Confermi di voler aggiungere un nuovo record risorsa?"; + // mMode = BootstrapModal.ModalMode.Confirm; + // modalOpt = new(); + // modalOpt.Add(true, "Si"); + // modalOpt.Add(false, "No"); + // if (!await Modal!.ShowAsync()) + // return; - isLoading = true; - var newRecord = new ResourceModel() - { - Name = $"Nuova Risorsa | {DateTime.Now:yyyy.MM.dd-HH.mm.ss}", - CostDriverID = 1 - }; + // isLoading = true; + // var newRecord = new ResourceModel() + // { + // Name = $"Nuova Risorsa | {DateTime.Now:yyyy.MM.dd-HH.mm.ss}", + // CostDriverID = 1 + // }; - await ResService.UpsertAsync(newRecord); - AllRecords = new List(); - await Task.Delay(100); - await ReloadBaseData(); - ReloadData(); - } + // await ResService.UpsertAsync(newRecord); + // AllRecords = new List(); + // await Task.Delay(100); + // await ReloadBaseData(); + // ReloadData(); + //} private async Task DoDelete(ResourceModel rec2del) { + mTitle = "Attenzione"; mMessage = $"Confermi di voler eliminare il record {rec2del.Name}?"; mMode = BootstrapModal.ModalMode.Confirm; @@ -136,8 +139,7 @@ namespace Lux.UI.Components.Compo.JobTask isLoading = true; // elimino e ricarico... await ResService.DeleteAsync(rec2del); - await ReloadBaseData(); - ReloadData(); + await EC_Update.InvokeAsync(true); } /// @@ -182,7 +184,7 @@ namespace Lux.UI.Components.Compo.JobTask private async Task ReloadBaseData() { - AllRecords = await ResService.GetAllAsync(); + //AllRecords = await ResService.GetAllAsync(); ListCostDriver = await CDService.GetAllAsync(); } @@ -211,6 +213,18 @@ namespace Lux.UI.Components.Compo.JobTask isLoading = false; } + private void SaveNumRec(int newNum) + { + numRecord = newNum; + ReloadData(); + } + + private void SavePage(int newNum) + { + currPage = newNum; + ReloadData(); + } + #endregion Private Methods } } \ No newline at end of file diff --git a/Lux.UI/Components/Compo/JobTask/TagDisplay.razor b/Lux.UI/Components/Compo/JobTask/TagDisplay.razor index 3113f05..9d55655 100644 --- a/Lux.UI/Components/Compo/JobTask/TagDisplay.razor +++ b/Lux.UI/Components/Compo/JobTask/TagDisplay.razor @@ -7,7 +7,7 @@ } @if (EnableEdit) { - + + } }
diff --git a/Lux.UI/Components/Compo/Templates/TemplateRowList.razor b/Lux.UI/Components/Compo/Templates/TemplateRowList.razor index face0b6..dcfe7b6 100644 --- a/Lux.UI/Components/Compo/Templates/TemplateRowList.razor +++ b/Lux.UI/Components/Compo/Templates/TemplateRowList.razor @@ -32,7 +32,7 @@ } else { - + } } else @@ -121,32 +121,9 @@ else } - @*
    -
  • - @item.Name -
  • -
  • -
    @item.SellingItemNav?.Description
    -
  • -
  • -
    @item.TemplateRowUID
    -
  • - @if (item.HasFile) - { - @if (item.Envir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW || !string.IsNullOrEmpty(item.FileName)) - { -
  • -
    -
    @item.FileName
    -
    - @fSize(item.FileSize) -
  • - } - } -
*@ @item.Name
@item.SellingItemNav?.Description
-
@item.TemplateRowUID
+
@item.TemplateRowUID
diff --git a/Lux.UI/Components/Compo/Templates/TemplateRowMan.razor b/Lux.UI/Components/Compo/Templates/TemplateRowMan.razor index 1da1899..1319b6a 100644 --- a/Lux.UI/Components/Compo/Templates/TemplateRowMan.razor +++ b/Lux.UI/Components/Compo/Templates/TemplateRowMan.razor @@ -1,37 +1,48 @@ @using EgwCoreLib.Lux.Core +@using static EgwCoreLib.Lux.Core.Enums @inherits BaseComp
-
-
- - -
-
-
-
- - -
-
- @if (ShowImgUpload(CurrRecord.SellingItemID)) + @if (CurrRecord.Envir == EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW) { -
-
- - -
-
-
- +
+
} +
+
+
+ + +
+
+
+
+ + +
+
+ @if (ShowImgUpload(CurrRecord.SellingItemID)) + { +
+
+
+ + @* *@ +
+
+
+ +
+
+ } +
diff --git a/Lux.UI/Components/Compo/Templates/TemplateRowMan.razor.cs b/Lux.UI/Components/Compo/Templates/TemplateRowMan.razor.cs index 994c1f0..f6009bf 100644 --- a/Lux.UI/Components/Compo/Templates/TemplateRowMan.razor.cs +++ b/Lux.UI/Components/Compo/Templates/TemplateRowMan.razor.cs @@ -25,6 +25,18 @@ [Parameter] public List ListSellinglItems { get; set; } = null!; + /// + /// Modello dell'offerta corrente (bindato dal genitore). + /// + [Parameter] + public string ApiUrl { get; set; } = null!; + + /// + /// Modello dell'offerta corrente (bindato dal genitore). + /// + [Parameter] + public string ImgBasePath { get; set; } = null!; + #endregion Public Properties #region Private Fields @@ -66,6 +78,16 @@ return EC_Updated.InvokeAsync(CurrRecord); } + /// + /// Calcola src immagine direttamente da modello dati + base path + /// + /// + /// + private string imgSrc(string imgUrl) + { + return $"{ApiUrl}/{ImgBasePath}/{imgUrl}"; + } + /// /// Check visibilità upload dato il selling item ID corrente /// diff --git a/Lux.UI/Components/Pages/JobRoute.razor b/Lux.UI/Components/Pages/JobRoute.razor index d2175e1..9d68e0e 100644 --- a/Lux.UI/Components/Pages/JobRoute.razor +++ b/Lux.UI/Components/Pages/JobRoute.razor @@ -48,7 +48,7 @@
- +
@@ -59,9 +59,9 @@ else {
-
+@*
@Traduci("cicli_elencoCicliAtt")
-
+
*@
diff --git a/Lux.UI/Components/Pages/OffStats.razor b/Lux.UI/Components/Pages/OffStats.razor index baf4ef3..ea4fd2d 100644 --- a/Lux.UI/Components/Pages/OffStats.razor +++ b/Lux.UI/Components/Pages/OffStats.razor @@ -3,26 +3,8 @@
-
-
- Da: - - - A: - - - -
+
+
diff --git a/Lux.UI/Components/Pages/OffStats.razor.cs b/Lux.UI/Components/Pages/OffStats.razor.cs index fceb4cb..0e0c428 100644 --- a/Lux.UI/Components/Pages/OffStats.razor.cs +++ b/Lux.UI/Components/Pages/OffStats.razor.cs @@ -1,13 +1,43 @@  +using EgwCoreLib.Razor; + namespace Lux.UI.Components.Pages { public partial class OffStats { + + #region Protected Methods + protected override Task OnInitializedAsync() { return ReloadDataAsync(); } + protected override void OnParametersSet() + { + // preparo sel periodo custom (traduzioni)... + CustomSelDict = Enum.GetValues(typeof(DtUtils.PeriodSet)) + .Cast() + .ToDictionary(e => e, e => Traduci("periodo_" + e.ToString())); + } + + #endregion Protected Methods + + #region Private Fields + private List AllOfferRecords { get; set; } = new(); + private List WinOffRecords { get; set; } = new(); + + private DtUtils.Periodo PeriodoSel = new DtUtils.Periodo(DtUtils.PeriodSet.ThisYear); + + /// + /// Periodo custom selezione valori + /// + private Dictionary? CustomSelDict = new(); + + #endregion Private Fields + + #region Private Properties + [Inject] private IJSRuntime JSRuntime { get; set; } = null!; @@ -17,56 +47,28 @@ namespace Lux.UI.Components.Pages [Inject] private NavigationManager NavigationManager { get; set; } = null!; - private List AllOfferRecords { get; set; } = new(); - private List WinOffRecords { get; set; } = new(); + #endregion Private Properties - private bool needReload = false; - private DtUtils.Periodo periodoLimit = new DtUtils.Periodo(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)); - private DtUtils.Periodo periodoSel = new DtUtils.Periodo(DateTime.Today.AddMonths(-5), DateTime.Today.AddHours(DateTime.Now.Hour + 1)); - - private string btnReload => needReload ? "btn-primary" : "btn-secondary"; + #region Private Methods private async Task ReloadDataAsync() { await OffService.CheckExpiredAsync(); - AllOfferRecords = await OffService.GetFiltAsync(periodoSel.Inizio, periodoSel.Fine); + AllOfferRecords = await OffService.GetFiltAsync(PeriodoSel.Inizio, PeriodoSel.Fine); WinOffRecords = AllOfferRecords.Where(x => x.Envir == EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW).ToList(); } /// - /// Caricamento dati + /// Imposta periodo da filtro /// + /// /// - private Task DoReload() + private Task SetPeriodo(DtUtils.Periodo newPeriod) { + PeriodoSel = newPeriod; return ReloadDataAsync(); } - private DateTime dtFrom - { - get => periodoSel.Inizio; - set - { - if (periodoSel.Inizio != value) - { - periodoSel.Inizio = value; - needReload = true; - } - } - } - - private DateTime dtTo - { - get => periodoSel.Fine; - set - { - if (periodoSel.Fine != value) - { - periodoSel.Fine = value; - needReload = true; - } - } - } + #endregion Private Methods } } \ No newline at end of file diff --git a/Lux.UI/Components/Pages/Resources.razor b/Lux.UI/Components/Pages/Resources.razor index 48f3f3b..10e1b8b 100644 --- a/Lux.UI/Components/Pages/Resources.razor +++ b/Lux.UI/Components/Pages/Resources.razor @@ -8,9 +8,21 @@
+
+ +
-
-
@Traduci("risorsa_configAttive")
- +
+ @if (isLoading) + { + + } + else + { + @*
@Traduci("risorsa_configAttive")
*@ + + }
+ + diff --git a/Lux.UI/Components/Pages/Resources.razor.cs b/Lux.UI/Components/Pages/Resources.razor.cs index d7d4855..d90f28d 100644 --- a/Lux.UI/Components/Pages/Resources.razor.cs +++ b/Lux.UI/Components/Pages/Resources.razor.cs @@ -1,10 +1,40 @@ +using EgwCoreLib.Lux.Data.Services.General; +using EgwCoreLib.Razor; +using Radzen.Blazor.Markdown; + namespace Lux.UI.Components.Pages { public partial class Resources { + #region Protected Methods + + protected override Task OnInitializedAsync() + { + return ReloadDataAsync(); + } + + #endregion Protected Methods + + #region Private Fields + + private List AllRecords = new List(); + + private bool isLoading = false; + + private BootstrapModal Modal = new(); + private string mTitle = ""; + private string mMessage = ""; + private BootstrapModal.ModalMode mMode = BootstrapModal.ModalMode.ND; + private Dictionary modalOpt = new Dictionary(); + + #endregion Private Fields + #region Private Properties + [Inject] + private IResourceService ResService { get; set; } = null!; + private string searchVal { get; set; } = string.Empty; private string btnResetCss @@ -28,11 +58,44 @@ namespace Lux.UI.Components.Pages #region Private Methods + private async Task ReloadDataAsync() + { + isLoading = true; + AllRecords = await ResService.GetAllAsync(); + isLoading = false; + } + private void ResetSearch() { SearchVal = ""; } + private async Task DoAdd() + { + mTitle = "Attenzione"; + mMessage = "Confermi di voler aggiungere un nuovo record risorsa?"; + mMode = BootstrapModal.ModalMode.Confirm; + modalOpt = new(); + modalOpt.Add(true, "Si"); + modalOpt.Add(false, "No"); + if (!await Modal!.ShowAsync()) + return; + + var newRecord = new ResourceModel() + { + Name = $"Nuova Risorsa | {DateTime.Now:yyyy.MM.dd-HH.mm.ss}", + CostDriverID = 1 + }; + + await ResService.UpsertAsync(newRecord); + await ReloadDataAsync(); + } + + private Task DoDelete(bool args) + { + return ReloadDataAsync(); + } + #endregion Private Methods } diff --git a/Lux.UI/Components/Pages/WorkLoadBalance.razor b/Lux.UI/Components/Pages/WorkLoadBalance.razor index 847dab1..5942195 100644 --- a/Lux.UI/Components/Pages/WorkLoadBalance.razor +++ b/Lux.UI/Components/Pages/WorkLoadBalance.razor @@ -3,7 +3,7 @@
-
+
@Traduci("ambiente") @@ -16,7 +16,6 @@ } -
diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index 0162c10..1dd6734 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 1.1.2608.2817 + 1.1.2609.0214 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 537ef08..abdb79a 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 1.1.2608.2817

+

Versione: 1.1.2609.0214


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 3623e69..5e0802f 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2608.2817 +1.1.2609.0214 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 2f2e943..8503a18 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2608.2817 + 1.1.2609.0214 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false