From 3e6ab708071f89c1e530bf60914c7cf7d8d65090 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 10 Mar 2026 16:57:39 +0100 Subject: [PATCH] Aggiornata interfaccia tabella --- WebWindowComplex/Compo/CardTree.razor | 53 +++-- WebWindowComplex/Compo/CardTree.razor.cs | 214 ++---------------- WebWindowComplex/TableComp.razor | 3 +- WebWindowComplex/TableComp.razor.cs | 22 ++ WebWindowComplex/WebWindowComplex.csproj | 10 +- .../WebWindowConfigurator.csproj | 25 +- 6 files changed, 109 insertions(+), 218 deletions(-) diff --git a/WebWindowComplex/Compo/CardTree.razor b/WebWindowComplex/Compo/CardTree.razor index a6b0fc4..da9a186 100644 --- a/WebWindowComplex/Compo/CardTree.razor +++ b/WebWindowComplex/Compo/CardTree.razor @@ -1,6 +1,12 @@ @using static WebWindowComplex.LayoutConst - +
+ + @for (int i = 0; i < maxCol; i++) + { + + } + @for (int i = 0; i < ItemTableList.Count; i++) { @@ -43,40 +49,43 @@ ind = ItemTableList[i].IndexItem; s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : ""); } - } else { - + @* *@ + } } } diff --git a/WebWindowComplex/Compo/CardTree.razor.cs b/WebWindowComplex/Compo/CardTree.razor.cs index de22354..e4543b5 100644 --- a/WebWindowComplex/Compo/CardTree.razor.cs +++ b/WebWindowComplex/Compo/CardTree.razor.cs @@ -40,6 +40,12 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_NextStep { get; set; } + /// + /// Evento richiesta prossimo step + /// + [Parameter] + public EventCallback EC_Remove { get; set; } + /// /// Evento aggiornamento dizionari per collasso righe /// @@ -60,55 +66,6 @@ namespace WebWindowComplex.Compo return EC_NextStep.InvokeAsync(Args); } - //private Dictionary RowCollapsedDict { get; set; } = new Dictionary(); - //private Dictionary Child { get; set; } = new Dictionary(); - - //protected override void OnAfterRender(bool firstRender) - //{ - // if (firstRender) - // { - // foreach (var key in RowCollapsedDict.Keys.ToList()) - // { - // RowCollapsedDict[key] = false; - // Child[key] = -1; - // } - // //for (int i = 0; i < ItemTableList.Count; i++) - // //{ - // // for (int j = 0; j < maxCol; j++) - // // { - // // if (j + 1 == ItemTableList[i].Col) - // // { - // // TableList.Add(new DataTable - // // { - // // item = ItemTableList[i], - // // row = i, - // // col = j, - // // hidden = false - // // }); - // // } - // // else - // // { - // // FillTable(i, j); - // // } - // // } - // //} - // } - //} - - //protected override void OnParametersSet() - //{ - // RowCollapsedDict.Clear(); - // Child.Clear(); - // foreach (var item in ItemTableList) - // { - // if(item.NumChild > 4) - // { - // RowCollapsedDict.Add(item.Row, false); - // Child.Add(item.Row, item.NumChild); - // } - // } - //} - /// /// Metodo per aprire/chiudere sottorighe /// @@ -124,15 +81,21 @@ namespace WebWindowComplex.Compo return RowCollapsedDict[row] ? "fa-solid fa-chevron-down" : "fa-solid fa-chevron-up"; } - //private async Task Remove(CompileStep cs, int indexStep) - //{ - // var Args = new DataNextStep - // { - // currCompileStep = cs, - // index = indexStep, - // }; - // await EC_NextStep.InvokeAsync(Args); - //} + /// + /// Metodo per rimuovere area + /// + /// + /// + /// + private Task Remove(CompileStep cs, int indexStep) + { + var Args = new DataNextStep + { + currCompileStep = cs, + index = indexStep, + }; + return EC_Remove.InvokeAsync(Args); + } /// /// Metodo per riempire tabella con contenuto vuoto o con i simboli per rappresentare la struttura @@ -238,141 +201,6 @@ namespace WebWindowComplex.Compo } return false; } - - // private void FillTable(int row, int col) - // { - // List itemSameCol = new List(); - // for (int k = 0; k < row; k++) - // { - // if (ItemTableList[k].Col == col + 1) - // { - // itemSameCol.Add(ItemTableList[k]); - // } - // continue; - // } - // int numItemNextCol = 0; - // for (int k = 0; k < row; k++) - // { - // if (ItemTableList[k].Row <= row && ItemTableList[k].Col == col + 2) - // { - // numItemNextCol++; - // } - // continue; - // } - // if (itemSameCol.Count > 1) - // { - // for (int i = 0; i <= itemSameCol.Count - 2; i++) - // { - // if (itemSameCol[i].NumChild > 0) - // numItemNextCol = numItemNextCol - itemSameCol[i].NumChild; - // } - // } - // if (itemSameCol.Count > 0) - // { - // // Sono alla riga successiva di un elemento e nella stessa colonna - // if (itemSameCol.Last().Row == row) - // { - // // se ha un solo figlio - // if (itemSameCol.Last().NumChild == 1) - // { - // TableList.Add(new DataTable - // { - // symbol = "└", - // row = row, - // col = col, - // hidden = false - // }); - // } - // else if (itemSameCol.Last().NumChild == 0) - // { - // TableList.Add(new DataTable - // { - // symbol = " ", - // row = row, - // col = col, - // hidden = false - // }); - // } - // else - // { - // TableList.Add(new DataTable - // { - // symbol = "├", - // row = row, - // col = col, - // hidden = false - // }); - // } - // } - // // Non sono alla riga successiva - // else - // { - // // se ha un solo figlio - // if (itemSameCol.Last().NumChild == 1) - // { - // TableList.Add(new DataTable - // { - // symbol = " ", - // row = row, - // col = col, - // hidden = false - // }); - // } - // else if (col + 2 <= maxCol && ItemTableList[row].Col == col + 2) - // { - // if (numItemNextCol < itemSameCol.Last().NumChild && numItemNextCol != (itemSameCol.Last().NumChild - 1)) - // { - // TableList.Add(new DataTable - // { - // symbol = "├", - // row = row, - // col = col, - // hidden = false - // }); - // } - // TableList.Add(new DataTable - // { - // symbol = "└", - // row = row, - // col = col, - // hidden = false - // }); - // } - // else if (numItemNextCol < itemSameCol.Last().NumChild) - // { - // TableList.Add(new DataTable - // { - // symbol = "│", - // row = row, - // col = col, - // hidden = false - // }); - // } - // else - // { - // TableList.Add(new DataTable - // { - // symbol = " ", - // row = row, - // col = col, - // hidden = false - // }); - // } - // } - // } - // else - // { - // TableList.Add(new DataTable - // { - // symbol = " ", - // row = row, - // col = col, - // hidden = false - // }); - // } - // } - //} - } /// diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index a069e23..eb7b669 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -104,7 +104,8 @@ RowCollapsedDict="RowCollapsed" ChildDict="Child" EC_NextStep="NextStepArgs" - EC_Collapsed="CollapsedRowTree"> + EC_Collapsed="CollapsedRowTree" + EC_Remove="RemoveArea"> } else if (currStep == CompileStep.Frame) diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 6a9f609..d1c6d2f 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1932,6 +1932,28 @@ namespace WebWindowComplex } } + private async Task RemoveArea(DataNextStep remove) + { + if (remove.currCompileStep is CompileStep.Sash) + { + SashList.ElementAt(remove.index).Remove(); + if (FrameWindow.SelThreshold.Name.Contains("Threshold") && remove.index == 0) + { + Threshold? updThreshold = FrameWindow.ThresholdList.FirstOrDefault(x => x.Name != "Threshold"); + if (updThreshold != null) + FrameWindow.SelThresholdFromName = updThreshold.Name; + } + SashList.RemoveAt(remove.index); + } + else if(remove.currCompileStep is CompileStep.Split) + { + SplitList.ElementAt(remove.index).Remove(); + SplitList.RemoveAt(remove.index); + } + await EC_ActionReq.InvokeAsync(DataAction.ResetDimElem); + await DoPreviewSvg(); + } + /// /// Calcola bottone per tutti i Fill /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 032a03c..1f4b9ce 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.1009 + 3.1.3.1016 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -317,6 +317,14 @@ + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 60edf00..e1403c8 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.1009 + 3.1.3.1016 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -342,6 +342,29 @@ + + + + + + + + + + + + + + + + + + + + + + +
-
-
-
+ @*
*@ +
+
+ -
- @if (ItemTableList[row].NumChild > 4) - { -
+ @if (ItemTableList[row].NumChild > 4) + { -
- } + } + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH || + ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) + { + + } +
+
@*
*@ - - @* @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH || - ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) - { - - } *@ + @* *@
@FillTable(i, j)@FillTable(i, j)