From b662cf2d9c4de54a2b5f93695686a86144a9ff30 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 30 Mar 2026 10:28:30 +0200 Subject: [PATCH] Gestione domande pendenti --- Test.UI/Components/Pages/EditJWD.razor | 15 +-- WebWindowComplex/Compo/General.razor.cs | 14 ++- WebWindowComplex/TableComp.razor | 113 ++++++++++++------ WebWindowComplex/TableComp.razor.cs | 67 +++++++++-- WebWindowComplex/WebWindowComplex.csproj | 11 +- .../WebWindowConfigurator.csproj | 27 ++++- 6 files changed, 189 insertions(+), 58 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index 913d191..8fdf09d 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -4,8 +4,8 @@ EditJWD -
-
+
+ @*
FamilyHw
-
- +
*@
Color @@ -61,8 +60,10 @@
-
- +
+
+
+
@@ -76,7 +77,7 @@ EC_ActionReq="DoAction" EC_DoUpdate="ExecRequest" EC_OnClose="CloseObj" - EC_PendantAction="PendAction"> + EC_UpdateReqPend="PendAction"> } else diff --git a/WebWindowComplex/Compo/General.razor.cs b/WebWindowComplex/Compo/General.razor.cs index 32f7944..308aee2 100644 --- a/WebWindowComplex/Compo/General.razor.cs +++ b/WebWindowComplex/Compo/General.razor.cs @@ -35,6 +35,13 @@ namespace WebWindowComplex.Compo [Parameter] public Dictionary ListWarnings { get; set; } = new Dictionary(); + /// + /// Elenco domande pendenti + /// + [Parameter] + public Dictionary DictPendReq { get; set; } = new Dictionary(); + + #endregion Public Properties #region Protected Properties @@ -118,7 +125,12 @@ namespace WebWindowComplex.Compo /// protected string cssValid(string fKey) { - return ListWarnings.ContainsKey(fKey) ? "border border-danger" : ""; + string ans = ""; + if (ListWarnings.ContainsKey(fKey) || DictPendReq.ContainsKey(fKey)) + ans = "border border-danger"; + else + ans = ""; + return ans; } protected override void OnParametersSet() diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index d6ef827..f96204b 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -36,46 +36,36 @@ { if (listErrPre != null && listErrPre.Count > 0) { -
-
Errori validazione!
-
+
+
+
Errori validazione!
+
-
    - @foreach (var item in listErrPre) - { -
  • @item.Value
  • - } -
+
    + @foreach (var item in listErrPre) + { +
  • @item.Value
  • + } +
+
} else if (listErrLink != null && listErrLink.Count > 0) - { -
-
Errore configurazione:
-
-
    - @foreach (var item in listErrLink) - { -
  • @item.Value
  • - } -
-
-
- } - else if (reqBool) {
-
-
- -
-
-
Domande pendenti
+
+
Errore configurazione:
+
+
    + @foreach (var item in listErrLink) + { +
  • @item.Value
  • + } +
- } else { @@ -268,6 +258,7 @@ @@ -296,17 +287,61 @@
+ if (reqBool) + { +
+
+
Domande pendenti:
+
+ @if (PendReq != null && PendReq.Count > 0) + { + foreach (var item in PendReq) + { +
+
+ + + + +
+
+ } + } + @*
    + @if (PendReq != null && PendReq.Count > 0) + { + foreach (var item in PendReq) + { +
  • +
    +
    + + + + +
    +
    +
  • + } + } +
*@ +
+
+
+ } if (listWarnings != null && listWarnings.Count > 0) { -
-
Mancata corrispondenza valori:
-
-
    - @foreach (var item in listWarnings) - { -
  • @item.Value
  • - } -
+
+
+
Mancata corrispondenza valori:
+
+
    + @foreach (var item in listWarnings) + { +
  • @item.Value
  • + } +
+
} diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 12953e5..9ba38a1 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -94,7 +94,7 @@ namespace WebWindowComplex /// Richiesta azione per le richieste pendenti /// [Parameter] - public EventCallback> EC_PendantAction { get; set; } + public EventCallback> EC_UpdateReqPend { get; set; } /// /// Elenco anagrafiche di base @@ -210,7 +210,7 @@ namespace WebWindowComplex WindowFromJson = BuildWindowDefault(); Log.Info("Ricostruito jwd"); } - UpdateInputList(WindowFromJson); + UpdInputListJson(WindowFromJson); setCurrWindow(WindowFromJson); //SOLO SE non sono in edit... if (!editLock) @@ -290,17 +290,22 @@ namespace WebWindowComplex // Controllo se ci sono domande pendenti if(PendReq != null && PendReq.Count > 0) { - //Implementazione di test - reqBool = true; - PendReq.Remove("Profile"); - await EC_PendantAction.InvokeAsync(PendReq); + if (!string.IsNullOrEmpty(PendReq.GetValueOrDefault("Profile")) && m_CurrWindow != null) + { + reqBool = true; + currStep = CompileStep.General; + } + //PendReq.Remove("Profile"); + //await EC_PendantAction.InvokeAsync(PendReq); } } - private bool reqBool = false; + #endregion Protected Methods #region Private Fields + private bool reqBool = false; + private bool waitShape = false; private static Logger Log = LogManager.GetCurrentClassLogger(); @@ -456,6 +461,32 @@ namespace WebWindowComplex #region Private Methods + /// + /// Metodo per salvare o meno la richiesta pendente + /// + /// richiesta pendente + /// risposta + /// + private async Task DoChangePend(string currPendReq, bool ans) + { + if (PendReq != null && PendReq.Count > 0 && !string.IsNullOrEmpty(PendReq.GetValueOrDefault("Profile")) && m_CurrWindow != null) + { + if (ans) + { + m_CurrWindow.sProfilePath = PendReq.GetValueOrDefault("Profile") ?? ""; + UpdInputListWindow(); + await DoPreviewSvg(true); + } + PendReq.Remove("Profile"); + } + if (PendReq != null && PendReq.Count == 0) + { + reqBool = false; + await DoSave(); + } + await EC_UpdateReqPend.InvokeAsync(PendReq); + } + /// /// Metodo per andare allo step successivo /// @@ -1732,15 +1763,33 @@ namespace WebWindowComplex /// /// Metodo per settare i paramteri di ingresso selezionati /// - private void UpdateInputList(JsonWindow WindowFromJson) + private void UpdInputList(string profile) { - string profile = WindowFromJson.ProfilePath; Window.m_ParameterList = ListPayload.ProfileList?.FirstOrDefault(x => x.ProfileName.Equals(profile))?.ParameterDict ?? new(); Frame.m_AllThresholdList = ListPayload.ProfileList?.FirstOrDefault(x => x.ProfileName.Equals(profile))?.ThresholdList ?? new(); Sash.m_HardwareCompleteList = ListPayload.Hardware; Sash.s_FamilyHardwareList = ListPayload.FamilyHardware; } + /// + /// Metodo per settare i paramteri di ingresso selezionati + /// + private void UpdInputListJson(JsonWindow? WindowFromJson) + { + string profile = ""; + if (WindowFromJson != null) + profile = WindowFromJson.ProfilePath; + UpdInputList(profile); + } + + private void UpdInputListWindow() + { + string profile = ""; + if (m_CurrWindow != null) + profile = m_CurrWindow.sProfilePath; + UpdInputList(profile); + } + /// /// Metodo che resetta le liste (sash, split, splitted, fill e itemTable) e le crea nuovamente /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 6d32daa..9dce1df 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.2718 + 3.1.3.3010 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -83,6 +83,15 @@ + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 0131c67..0f09a0e 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.2718 + 3.1.3.3010 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -83,6 +83,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + +