Gestione componente AreaSplit in CardFill
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,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">
|
||||
|
||||
Reference in New Issue
Block a user