Gestione componente AreaSplit in CardFill

This commit is contained in:
Annamaria Sassi
2025-10-13 10:41:03 +02:00
parent 566dc8cf04
commit bd0e3536fb
9 changed files with 109 additions and 52 deletions
+15 -15
View File
@@ -1,30 +1,30 @@
<div class="border mb-2 shadow-sm rounded">
<div class="card shadow-sm rounded">
<div class="card-body py-2">
<div class="row my-2">
<div class="col-sm-4 justify-content-center">
<div class="d-flex justify-content-between align-items-center">
<div class="col d-flex justify-content-center">
@if (CurrSplittedList.Count > 1)
{
<h3 class="card-title text-center">Area split @(CurrSplittedList.IndexOf(CurrSplitted) + 1)</h3>
<h6>Area split @(CurrSplittedList.IndexOf(CurrSplitted) + 1)</h6>
}
else
{
<h3 class="card-title text-center">Area split</h3>
<h6>Area split</h6>
}
</div>
<div class="col-4">
<div class="col d-flex justify-content-center">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CurrSplitted.AddFirstSash()">Add Sash</button>
</div>
</div>
@for (int j = 0; j < CurrSashList.Count; j++)
{
int Index = j;
<div class="col-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopySash(Index)">Copy Sash @(CurrSashList.Count == 1 ? "" : (Index + 1))</button>
</div>
</div>
}
<div class="col d-flex justify-content-center">
@for (int j = 0; j < CurrSashList.Count; j++)
{
int Index = j;
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopySash(CurrSplitted,Index)">Copy Sash @(CurrSashList.Count == 1 ? "" : (Index + 1))</button>
</div>
}
</div>
</div>
</div>
</div>
+17 -4
View File
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Egw.Window.Data;
using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
@@ -17,7 +18,7 @@ namespace WebWindowComplex.Compo
public List<Splitted> CurrSplittedList { get; set; } = null;
[Parameter]
public EventCallback<int> EC_CopySash { get; set; }
public EventCallback<Data> EC_CopySash { get; set; }
#endregion Public Properties
@@ -27,11 +28,23 @@ namespace WebWindowComplex.Compo
/// Sollevo evento richiesta copia sash
/// </summary>
/// <returns></returns>
private async Task RaiseCopySash(int indexCurrSash)
private async Task RaiseCopySash(Splitted item, int indexCurrSash)
{
await EC_CopySash.InvokeAsync(indexCurrSash);
var Args = new Data
{
splitted = item,
index = indexCurrSash,
};
await EC_CopySash.InvokeAsync(Args);
}
#endregion Private Methods
}
public class Data
{
public Splitted splitted { get; set; }
public int index { get; set; }
}
}
+23 -17
View File
@@ -1,34 +1,41 @@
<div class="card shadow-sm">
<div class="card shadow-sm rounded mb-4">
<div class="card-header bg-light bg-opacity-25">
<div class="row my-2">
<div class="col-sm-4 justify-content-center">
<h3 class="card-title text-center">Fill @(CurrIndex + 1)</h3>
<div class="d-flex justify-content-between align-middle">
<div class="px-2">
<h5>Fill @(CurrIndex + 1)</h5>
</div>
<div class="col-sm-4 justify-content-center">
<div class="px-2">
<button class="btn btn-close" @onclick="ReqClose"></button>
</div>
</div>
</div>
<div class="card-body py-2">
<div class="d-flex justify-content-between align-center my-2">
<div class="col d-flex justify-content-center">
<h6>Select only current fill</h6>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@buttonFillCss(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)" @onclick="() => ChangeOneFill(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)">Glass</button>
</div>
</div>
<div class="col-sm-4 justify-content-center">
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@buttonFillCss(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)" @onclick="() => ChangeOneFill(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)">Wood</button>
</div>
</div>
</div>
</div>
<div class="card-body py-2">
<hr />
<div class="row">
<div class="col-sm-4">
<h5 class="text-center">Selected all fill</h5>
<div class="d-flex justify-content-between align-items-center">
<div class="col d-flex justify-content-center">
<h6 class="text-center">Selected all fill</h6>
</div>
<div class="col-sm-4">
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllFill(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)">All glass</button>
</div>
</div>
<div class="col-sm-4">
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllFill(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)">All wood</button>
</div>
@@ -38,7 +45,7 @@
</div>
@foreach (var currSplitted in SplittedList)
{
@if (currSplitted.AreaList[0].Equals(CurrItem))
@if (currSplitted.AreaList.First().Equals(CurrItem))
{
@* <div class="border mb-2 shadow-sm rounded">
<div class="card-body py-2">
@@ -69,8 +76,7 @@
</div>
</div>
</div> *@
<AreaSplit CurrSashList="SashList" CurrSplittedList="SplittedList" CurrSplitted="currSplitted"></AreaSplit>
@* <AreaSplit CurrSashList="SashList" CurrSplittedList="SplittedList" CurrSplitted="currSplitted" EC_CopySash="() => CopySash()"></AreaSplit> *@
<AreaSplit CurrSashList="SashList" CurrSplittedList="SplittedList" CurrSplitted="currSplitted" EC_CopySash="CopySash"></AreaSplit>
}
}
+17 -7
View File
@@ -20,6 +20,12 @@ namespace WebWindowComplex.Compo
[Parameter]
public EventCallback<FillTypes> EC_ChangeType { get; set; }
[Parameter]
public EventCallback<Data> EC_CopySash { get; set; }
[Parameter]
public EventCallback<bool> EC_ReqClose { get; set; }
[Parameter]
public List<Fill> FillList { get; set; } = null!;
@@ -29,6 +35,7 @@ namespace WebWindowComplex.Compo
[Parameter]
public List<Splitted> SplittedList { get; set; } = null!;
#endregion Public Properties
#region Protected Methods
@@ -43,6 +50,11 @@ namespace WebWindowComplex.Compo
await EC_ChangeType.InvokeAsync(reqFillType);
}
protected async Task CopySash(Data Args)
{
await EC_CopySash.InvokeAsync(Args);
}
#endregion Protected Methods
#region Private Methods
@@ -54,15 +66,13 @@ namespace WebWindowComplex.Compo
private string buttonFillCss(FillTypes reqFillTypes)
{
return (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm";
#if false
if (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes)
return "btn btn-secondary btn-sm";
else
return "btn btn-outline-secondary btn-sm";
#endif
}
#endregion Private Methods
private void ReqClose()
{
_ = EC_ReqClose.InvokeAsync(true);
}
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
<div class="card shadow-sm">
<div class="card shadow-sm rounded">
<div class="card-header bg-light bg-opacity-25">
<div class="d-flex justify-content-between align-middle">
<div class="px-2">
+5 -5
View File
@@ -40,7 +40,7 @@
<div class="@mainCss()">
<div class="card text-center table-svg shadow rounded">
<div class="card-header" style="background-color: #d5f1f2;">
<div class="row">
<div class="d-flex justify-content-between align-middle">
<div class="@headerCss()">
<ul class="nav nav-tabs card-header-tabs">
@if (string.IsNullOrEmpty(LiveData.CurrJwd))
@@ -68,16 +68,16 @@
</ul>
</div>
<div class="@buttonCss()">
<div class="col-4">
<div class="col d-flex">
@if (currStep != CompileStep.Template)
{
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoReset">Reset</button>
}
</div>
<div class="col-4">
<div class="col d-flex">
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoSave">Save</button>
</div>
<div class="col-4">
<div class="col d-flex">
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoClose">Close</button>
</div>
</div>
@@ -696,7 +696,7 @@
else
{
Fill item = FillList[currFill];
<CardFill CurrIndex="currFill" CurrItem="item" FillList="m_FillList" SashList="m_SashList" SplittedList="m_SplittedList" EC_ChangeAllType="ChangeAllFill" EC_ChangeType="ChangeOneFill"></CardFill>
<CardFill CurrIndex="currFill" CurrItem="item" FillList="m_FillList" SashList="m_SashList" SplittedList="m_SplittedList" EC_ChangeAllType="ChangeAllFill" EC_ChangeType="ChangeOneFill" EC_CopySash="CopySash" EC_ReqClose="ReturnTree"></CardFill>
}
}
else if (currStep == CompileStep.General)
+4 -1
View File
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using System.Reflection.Metadata;
using WebWindowComplex.Compo;
using WebWindowComplex.DTO;
using WebWindowComplex.Json;
using WebWindowComplex.Models;
@@ -974,8 +975,10 @@ namespace WebWindowComplex
/// <param name="currSplitted"> Area Splitted corrente </param>
/// <param name="numSash"> Indice della Sash che si vuole copiare </param>
/// <returns></returns>
private async Task CopySash(Splitted currSplitted, int numSash)
private async Task CopySash(Data Args)
{
Splitted currSplitted = Args.splitted;
int numSash = Args.index;
//Rimuovo contenuto di Splitted e rimuovo area da conteggio gruppi
currSplitted.AreaList.RemoveAll(i => i != null);
//Area.DelCounterGroup();
+12 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.10.1017</Version>
<Version>2.7.10.1310</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -49,6 +49,17 @@