From cf7eccb3baff01bf64b9f0b8305d2df0c8643086 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 11 Nov 2025 09:49:24 +0100 Subject: [PATCH] fix catena update hwopt --- Test.UI/Components/Compo/ChildObj.razor.cs | 2 +- Test.UI/Components/Pages/EditJWD.razor.cs | 4 ++ WebWindowComplex/Compo/AreaHwOption.razor.cs | 2 +- WebWindowComplex/TableComp.razor.cs | 66 +++++++++++++++++-- WebWindowComplex/WebWindowComplex.csproj | 6 ++ .../WebWindowConfigurator.csproj | 6 ++ 6 files changed, 77 insertions(+), 9 deletions(-) diff --git a/Test.UI/Components/Compo/ChildObj.razor.cs b/Test.UI/Components/Compo/ChildObj.razor.cs index 6693058..2a8a4ac 100644 --- a/Test.UI/Components/Compo/ChildObj.razor.cs +++ b/Test.UI/Components/Compo/ChildObj.razor.cs @@ -19,7 +19,7 @@ namespace Test.UI.Components.Compo public string LoadPar { get; set; } = ""; [CascadingParameter(Name = "CurrLoading")] - public List CurrLoading { get; set; } + public List CurrLoading { get; set; } = new List(); #endregion Public Properties diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 0bae3ae..3891743 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -239,6 +239,10 @@ namespace Test.UI.Components.Pages CurrData.DictShape = new Dictionary(); break; + case TableComp.DataAction.ResetHwOpt: + CurrData.DictOptionsXml = new Dictionary(); + break; + default: break; } diff --git a/WebWindowComplex/Compo/AreaHwOption.razor.cs b/WebWindowComplex/Compo/AreaHwOption.razor.cs index 3fa1a38..86b36de 100644 --- a/WebWindowComplex/Compo/AreaHwOption.razor.cs +++ b/WebWindowComplex/Compo/AreaHwOption.razor.cs @@ -33,7 +33,7 @@ namespace WebWindowComplex.Compo public EventCallback EC_FirstHwOptionList { get; set; } [CascadingParameter(Name = "IsLoading")] - public List IsLoading { get; set; } + public List IsLoading { get; set; } = new List(); private bool hwOptCollapsed { get; set; } = false; diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 3d982a4..0d1b445 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -25,7 +25,11 @@ namespace WebWindowComplex /// /// Reset dizionario shape /// - ResetDictShape + ResetDictShape, + /// + /// Reset dizionario HwOptions + /// + ResetHwOpt } public enum DataReq @@ -34,14 +38,17 @@ namespace WebWindowComplex /// Nessuna richiesta /// None = 0, + /// /// Richiesta hardware opzioni /// ReqHwOpt, + /// /// Richiesta svg /// ReqSvg, + /// /// Richiesta shape sash group /// @@ -121,6 +128,8 @@ namespace WebWindowComplex #region Protected Fields + protected List currLoading = new List(); + /// /// Dati live precedenti x comparazione /// @@ -164,7 +173,6 @@ namespace WebWindowComplex get => m_SashList; } - protected List currLoading = new List(); protected string SelColorMaterial { get; set; } = ""; protected string SelFamilyHardware { get; set; } = ""; protected string SelGlass { get; set; } = ""; @@ -503,7 +511,7 @@ namespace WebWindowComplex { if (m_CurrWindow != null) { - currLoading.Add("LoadHwOpt"); + loadListAdd("LoadHwOpt"); #if DEBUG var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); #else @@ -719,7 +727,7 @@ namespace WebWindowComplex if (SashList.Count > 0) currAnta = 0; #if false - _ = InvokeAsync(StateHasChanged); + _ = InvokeAsync(StateHasChanged); #endif // Aggiorno window con dati shape e hw option UpdateDict(); @@ -744,7 +752,7 @@ namespace WebWindowComplex // se ho le opzioni hw le aggiungo if (LiveData.DictOptionsXml.Count > 0) { - currLoading.Remove("LoadHwOpt"); + loadListRem("LoadHwOpt"); foreach (var item in SashList) { if (LiveData.DictOptionsXml.ContainsKey(item.GroupId)) @@ -793,11 +801,17 @@ namespace WebWindowComplex #region Private Fields private int currAnta = 0; + private int currFill = -1; + private int currSash = -1; + private int currSplit = -1; + private CompileStep currStep; + private bool editLock = false; + private bool firstDisplay = true; /// @@ -1085,9 +1099,36 @@ namespace WebWindowComplex await DoPreviewSvg(); } + /// + /// Helper aggiunta elemento a lista caricamento + /// + /// + private void loadListAdd(string loadCode) + { + if (!currLoading.Contains(loadCode)) + { + currLoading.Add(loadCode); + } + } + + /// + /// Helper rimozione elemento a lista caricamento + /// + /// + private void loadListRem(string loadCode) + { + if (currLoading.Contains(loadCode)) + { + currLoading.Remove(loadCode); + } + } + private void M_CurrWindow_OnHwOption(object? sender, OnReqHwOptEventArgs e) { - currLoading.Add("LoadHwOpt"); + // chiamo reset dizionario + ReqResetHwOpt(true); + // setto che sto chiedendo update opzioni + loadListAdd("LoadHwOpt"); _ = InvokeAsync(StateHasChanged); Dictionary Args = new Dictionary(); Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWARE}"); @@ -1182,12 +1223,20 @@ namespace WebWindowComplex /// Richiesta reset dizionario Shape con action /// /// - /// private void ReqResetDict(bool args) { _ = EC_ActionReq.InvokeAsync(DataAction.ResetDictShape); } + /// + /// Richiesta reset dizionario options con action + /// + /// + private void ReqResetHwOpt(bool args) + { + _ = EC_ActionReq.InvokeAsync(DataAction.ResetHwOpt); + } + /// /// Ritorno step Tree /// @@ -1339,11 +1388,14 @@ namespace WebWindowComplex /// private async Task UpdateHwOptions(Sash newSash) { + // resetto hw lst + await EC_ActionReq.InvokeAsync(DataAction.ResetHwOpt); // richiesta calcolo opzioni hardware per la singola sash group //string req = newSash.SelHardware.Id; List reqList = new List() { newSash.GroupId }; // chiamo con gruppo della nuova sash await DoReqOptHardware(reqList); + //ReqResetHwOpt(); } /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 2bfee79..bf62610 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -50,6 +50,12 @@ + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 646b079..4240629 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -76,6 +76,12 @@ + + + + + +