From ea64a73bb8298f9902648a7d5811b5fccf37bafe Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 5 Aug 2026 12:34:16 +0200 Subject: [PATCH] - Modificata interfaccia card split - Aggiunte icone shape per split --- WebWindowComplex/Compo/CardFrame.razor | 2 +- WebWindowComplex/Compo/CardFrame.razor.cs | 2 +- WebWindowComplex/Compo/CardSplit.razor | 283 +++++++----------- WebWindowComplex/Compo/CardSplit.razor.cs | 82 +++-- .../Compo/EditSplitDimensions.razor | 3 +- .../Compo/EditSplitDimensions.razor.cs | 24 +- WebWindowComplex/Models/AreaDimension.cs | 11 +- WebWindowComplex/WebWindowComplex.csproj | 157 +--------- .../wwwroot/icone/split/Custom.svg | 26 ++ WebWindowComplex/wwwroot/icone/split/Grid.svg | 23 ++ .../wwwroot/icone/split/Horizontal.svg | 21 ++ .../wwwroot/icone/split/Vertical.svg | 20 ++ .../WebWindowConfigurator.csproj | 4 +- 13 files changed, 280 insertions(+), 378 deletions(-) create mode 100644 WebWindowComplex/wwwroot/icone/split/Custom.svg create mode 100644 WebWindowComplex/wwwroot/icone/split/Grid.svg create mode 100644 WebWindowComplex/wwwroot/icone/split/Horizontal.svg create mode 100644 WebWindowComplex/wwwroot/icone/split/Vertical.svg diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index 9518b11..7b49e88 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -31,7 +31,7 @@ {
@*
diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 83098f0..ba3a224 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -66,7 +66,7 @@ namespace WebWindowComplex.Compo #region Protected Properties - private string GetImagePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/shape/{fileName}.svg"; + private string GetImageShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/shape/{fileName}.svg"; /// /// Metodo per selezionare shape diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor index 708fb7c..ae61036 100644 --- a/WebWindowComplex/Compo/CardSplit.razor +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -3,8 +3,23 @@
-
-
@(descParentSplit())
+
+
@(descParentSplit()) - Split
+
+
+ @if (!User) + { + @if ((CurrSplit.nSplitQtyVert == 1 && CurrSplit.nSplitQtyHoriz == 0) || (CurrSplit.nSplitQtyVert == 0 && CurrSplit.nSplitQtyHoriz == 1)) + { + + } + } +
+
+ @if (!User) + { + + }
@@ -12,26 +27,6 @@
- @*
- - -
*@
-
-
Split
- @if (!User) - { - @if ((CurrSplit.nSplitQtyVert == 1 && CurrSplit.nSplitQtyHoriz == 0) || (CurrSplit.nSplitQtyVert == 0 && CurrSplit.nSplitQtyHoriz == 1)) +
+
+ @if (User) { -
- -
- } -
- -
- } - @* - *@ -
-
-
-
- @if (User) - { +
Shape - } - else - { - - + + } + else + { + + + } +
} - - } -
+
+
+ }
-
- @if (CurrSplit.nSplitQtyVert > 0) - { -
-
- QtyVert - @if (User) - { - - } - else - { - - } -
-
- } - @if (CurrSplit.nSplitQtyHoriz > 0) - { +
+ @if (CurrSplit.nSplitQtyHoriz > 0) + { +
+
Horizontal split
+
+
QtyHoriz @@ -143,103 +105,70 @@ }
- } -
-
- @if (CurrSplit.SplitVertList.Count > 0 && CurrSplit.SplitHorizList.Count > 0) - { -
- @for (int i = 0; i < CurrSplit.SplitVertList.Count; i++) - { - - - } -
-
- @for (int i = 0; i < CurrSplit.SplitHorizList.Count; i++) - { - - - } -
- } - else if (CurrSplit.SplitHorizList.Count > 0) - { +
+
@for (int i = 0; i < CurrSplit.SplitHorizList.Count; i++) { + Name="Height" + Index="i" + EC_Update="UpdateDimension"> } - } - else if (CurrSplit.SplitVertList.Count > 0) - { - @for (int i = 0; i < CurrSplit.SplitVertList.Count; i++) +
+
+ @foreach (var element in horizList()) { - - +
+ +
} - } -
- @if (CurrSplit.SelSplitShape == Json.WindowConst.SplitShapes.GRID) +
+ } + @if (CurrSplit.nSplitQtyVert > 0 && CurrSplit.nSplitQtyHoriz > 0) + { +
+ } + @if (CurrSplit.nSplitQtyVert > 0) {
-
-
-
+
+
Vertical split
+
+
+
+
+ QtyVert @if (User) { - + } else { - + }
-
- -
+
+ @for (int i = 0; i < CurrSplit.SplitVertList.Count; i++) + { + + + } +
+
+ @foreach (var element in vertList()) + { +
+ +
+ } +
} -
-
- @if(CurrSplit.nSplitQtyVert > 0) - { -
-
-
Element vert
-
- @foreach (var element in vertList()) - { - - } -
- } - @if(CurrSplit.nSplitQtyHoriz > 0) - { -
-
-
Element horiz
-
- @foreach (var element in horizList()) - { - - } -
- } -
diff --git a/WebWindowComplex/Compo/CardSplit.razor.cs b/WebWindowComplex/Compo/CardSplit.razor.cs index 09bda92..c28af5d 100644 --- a/WebWindowComplex/Compo/CardSplit.razor.cs +++ b/WebWindowComplex/Compo/CardSplit.razor.cs @@ -113,30 +113,32 @@ namespace WebWindowComplex.Compo protected int SplitShapeIndex { get => CurrSplit.SelSplitShapeIndex; - set - { - if (CurrSplit.SelSplitShapeIndex != value) - { - CurrSplit.SelSplitShapeIndex = value; - var args = new DataUpdateSplit() - { - currSplit = CurrSplit - }; - _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); - if(!(CurrSplit.ParentArea.ParentArea is Sash)) - { - // Se la shape selezionata è grid o custom, richiede reset shape - if (value == (int)SplitShapes.GRID || value == (int)SplitShapes.CUSTOM) - _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); - if (SearchSash(CurrSplit)) - _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt }); - } - _ = EC_ReqElement.InvokeAsync(CurrSplit); - _ = EC_UpdateSplit.InvokeAsync(args); - } - } + //set + //{ + // if (CurrSplit.SelSplitShapeIndex != value) + // { + // CurrSplit.SelSplitShapeIndex = value; + // var args = new DataUpdateSplit() + // { + // currSplit = CurrSplit + // }; + // _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); + // if(!(CurrSplit.ParentArea.ParentArea is Sash)) + // { + // // Se la shape selezionata è grid o custom, richiede reset shape + // if (value == (int)SplitShapes.GRID || value == (int)SplitShapes.CUSTOM) + // _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + // if (SearchSash(CurrSplit)) + // _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt }); + // } + // _ = EC_ReqElement.InvokeAsync(CurrSplit); + // _ = EC_UpdateSplit.InvokeAsync(args); + // } + //} } + private string GetImageShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/split/{fileName}.svg"; + private bool SearchSash(Area area) { if (area is Sash) @@ -192,6 +194,29 @@ namespace WebWindowComplex.Compo } } + private async Task SelShapeSplit(int newShapeIndex) + { + if (CurrSplit.SelSplitShapeIndex != newShapeIndex) + { + CurrSplit.SelSplitShapeIndex = newShapeIndex; + var args = new DataUpdateSplit() + { + currSplit = CurrSplit + }; + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); + if (!(CurrSplit.ParentArea.ParentArea is Sash)) + { + // Se la shape selezionata è grid o custom, richiede reset shape + if (newShapeIndex == (int)SplitShapes.GRID || newShapeIndex == (int)SplitShapes.CUSTOM) + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + if (SearchSash(CurrSplit)) + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt }); + } + _ = EC_ReqElement.InvokeAsync(CurrSplit); + _ = EC_UpdateSplit.InvokeAsync(args); + } + } + /// /// Aggiornamento element /// @@ -444,6 +469,19 @@ namespace WebWindowComplex.Compo } return "btn btn-secondary"; } + + /// + /// Metodo per la visualizzazione dei pulsanti shape + /// + /// + /// + private string ButtonShapeCss(int index) + { + string ans = ""; + if (SplitShapeIndex == index) + ans = "active"; + return ans; + } } /// diff --git a/WebWindowComplex/Compo/EditSplitDimensions.razor b/WebWindowComplex/Compo/EditSplitDimensions.razor index 8bfdee0..2755869 100644 --- a/WebWindowComplex/Compo/EditSplitDimensions.razor +++ b/WebWindowComplex/Compo/EditSplitDimensions.razor @@ -1,6 +1,7 @@ @using EgwCoreLib.Razor -
+@*
*@ +
@(Name + " " + (Index+ 1)) diff --git a/WebWindowComplex/Compo/EditSplitDimensions.razor.cs b/WebWindowComplex/Compo/EditSplitDimensions.razor.cs index 0e249be..7dfc5e7 100644 --- a/WebWindowComplex/Compo/EditSplitDimensions.razor.cs +++ b/WebWindowComplex/Compo/EditSplitDimensions.razor.cs @@ -37,7 +37,7 @@ namespace WebWindowComplex.Compo ///
private double CurrVal { - get => CurrRec.dDimension; + get => Math.Round(CurrRec.dDimension, CssDecimals()); set { if (CurrRec.dDimension != value) @@ -75,17 +75,17 @@ namespace WebWindowComplex.Compo } } - private string SplitDimCss() - { - if(CurrRec.Parent is Split split) - { - if (split.SelSplitShape.Equals(Json.WindowConst.SplitShapes.GRID)) - return ""; - else - return "col-md-12 col-lg-6"; - } - return ""; - } + //private string SplitDimCss() + //{ + // if(CurrRec.Parent is Split split) + // { + // if (split.SelSplitShape.Equals(Json.WindowConst.SplitShapes.GRID)) + // return ""; + // else + // return "col-md-12 col-lg-6"; + // } + // return ""; + //} /// /// Metodo per avere il numero di decimali da usare nella form-input diff --git a/WebWindowComplex/Models/AreaDimension.cs b/WebWindowComplex/Models/AreaDimension.cs index f594617..68fce2b 100644 --- a/WebWindowComplex/Models/AreaDimension.cs +++ b/WebWindowComplex/Models/AreaDimension.cs @@ -222,11 +222,6 @@ namespace WebWindowComplex.Models for(int i = 0; i < itemList.Count; i++) ans.ElementAt(i).SetDimension(Math.Round(absoluteValue.ElementAt(i) / mcdList.FirstOrDefault())); } - - //int inedMin = absoluteValue.IndexOf(absoluteValue.Min()); - //var mcd = CalculateMCD(absoluteValue.ElementAt(indexArea), absoluteValue.ElementAt(inedMin)); - //itemList.ElementAt(inedMin).SetDimension(absoluteValue.ElementAt(inedMin) / mcd); - //itemList.ElementAt(indexArea).SetDimension(absoluteValue.ElementAt(indexArea) / mcd); } else { @@ -351,11 +346,13 @@ namespace WebWindowComplex.Models if (sumPesi == 0) sumPesi = 1; if (newType.Equals(MeasureTypes.ABSOLUTE)) { - return Math.Round(res / sumPesi * dDimension, 2); + return res / sumPesi * dDimension; + //return Math.Round(res / sumPesi * dDimension, 2); } else { - return Math.Round((res / sumPesi * dDimension) / tot * 100); + return (res / sumPesi * dDimension) / tot * 100; + //return Math.Round((res / sumPesi * dDimension) / tot * 100, 2); } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index e95b3b2..b39aec5 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.8.510 + 3.1.8.512 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -54,161 +54,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebWindowComplex/wwwroot/icone/split/Custom.svg b/WebWindowComplex/wwwroot/icone/split/Custom.svg new file mode 100644 index 0000000..5338033 --- /dev/null +++ b/WebWindowComplex/wwwroot/icone/split/Custom.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebWindowComplex/wwwroot/icone/split/Grid.svg b/WebWindowComplex/wwwroot/icone/split/Grid.svg new file mode 100644 index 0000000..2ea3ef4 --- /dev/null +++ b/WebWindowComplex/wwwroot/icone/split/Grid.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/WebWindowComplex/wwwroot/icone/split/Horizontal.svg b/WebWindowComplex/wwwroot/icone/split/Horizontal.svg new file mode 100644 index 0000000..4f78f2b --- /dev/null +++ b/WebWindowComplex/wwwroot/icone/split/Horizontal.svg @@ -0,0 +1,21 @@ + + + + + + + + + + \ No newline at end of file diff --git a/WebWindowComplex/wwwroot/icone/split/Vertical.svg b/WebWindowComplex/wwwroot/icone/split/Vertical.svg new file mode 100644 index 0000000..06e00a4 --- /dev/null +++ b/WebWindowComplex/wwwroot/icone/split/Vertical.svg @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index ed9b3db..c710ecf 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.8.510 + 3.1.8.512 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -342,6 +342,8 @@ + +