- Correzioni
- Aggiunte icone tipologie di apertura anta
This commit is contained in:
@@ -2,18 +2,22 @@
|
||||
<div class="col-lg-12 col-md-12">
|
||||
@if (!SashDimEditList.Contains(IndexSash))
|
||||
{
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="col-md-12 col-lg-4 d-grid px-2 d-md-flex justify-content-md-start flex-wrap">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<div class="col-md-12 col-lg-8 px-0 d-grid justify-content-start">
|
||||
<h6 class="fw-bold text-nowrap">Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))</h6>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-8 d-grid px-4 d-md-flex justify-content-md-end align-items-center flex-wrap">
|
||||
<div class="col-md-12 col-lg-3 px-0">
|
||||
@if(!User && CurrSashGroup.SashList.Count > 1)
|
||||
{
|
||||
<div class="dropdown px-4">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle btn-sm" type="button" @onclick="ToggleDropdown">
|
||||
<div class="dropdown px-4 w-100">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle btn-sm w-100"
|
||||
type="button"
|
||||
@onclick="ToggleDropdown"
|
||||
aria-expanded="@isOpen">
|
||||
Copy content
|
||||
</button>
|
||||
<ul class="dropdown-menu @(isOpen ? "show" : "")" style="min-width:5rem; max-width:10rem">
|
||||
<ul class="dropdown-menu w-100 @(isOpen ? "show" : "")"
|
||||
style="min-width:0rem; max-width:10rem">
|
||||
@for (int k = 0; k <= CurrSashGroup.SashList.Count - 1; k++)
|
||||
{
|
||||
@if (k != IndexSash)
|
||||
@@ -30,28 +34,49 @@
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-1 px-0 align-items-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" type="button" @onclick="() => doEdit(IndexSash)">
|
||||
<i class="fa-solid fa-pen"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-12 my-2">
|
||||
<div class="row align-items-center justify-content-start">
|
||||
<div class="col-lg-2 col-md-12 my-2">
|
||||
<div class="input-group mb-2">
|
||||
@if(User)
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashDim.OpeningTypeList.ElementAt(OpeningTypeIndex - 1))">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="@OpeningTypeIndex">
|
||||
@foreach (var openingType in CurrSashDim.OpeningTypeList)
|
||||
{
|
||||
<option value=@(openingType.Id)>@(openingType.Name)</option>
|
||||
}
|
||||
</select>
|
||||
<div class="dropdown" @onfocusout="HandleFocusOut" tabindex="0">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle d-flex align-items-center gap-2"
|
||||
type="button"
|
||||
@onclick="ToggleDropdownOpening"
|
||||
aria-expanded="@isOpenDropdown">
|
||||
<span class="d-flex align-items-center">
|
||||
<img class="img-fluid" src="@GetImageOpeningPath(CurrOpening)" title="@(CurrOpening)" width="50" />
|
||||
</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu p-2 @(isOpenDropdown ? "show" : "")"
|
||||
style="position: absolute; min-width: 20em;">
|
||||
<div class="row g-2 row-cols-4 m-0">
|
||||
@foreach (var openingType in CurrSashDim.OpeningTypeList)
|
||||
{
|
||||
<div class="col p-0">
|
||||
<button type="button"
|
||||
class="dropdown-item d-flex flex-column align-items-center justify-content-center p-2 rounded text-center h-100 @ButtonOpeningCss(openingType.Id)"
|
||||
@onclick="() => SelOpeningSash(openingType.Id, openingType.Name)">
|
||||
<img class="img-fluid" src="@GetImageOpeningPath(openingType.Name)"
|
||||
title="@(openingType.Name)" width="100" />
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -101,28 +126,32 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<div class="col-md-12 col-lg-6 d-grid px-2 d-md-flex justify-content-md-start flex-wrap">
|
||||
<div class="d-flex justify-content-start align-items-center mb-2">
|
||||
<div class="col-md-12 col-lg-7 d-grid px-0 justify-content-md-start">
|
||||
<h6 class="fw-bold text-nowrap">Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))</h6>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 d-grid px-4 d-md-flex justify-content-md-end align-items-center flex-wrap">
|
||||
<div class="col-md-12 col-lg-2 px-0">
|
||||
@if (!User && !(CurrAnta.AreaList[0] is Split))
|
||||
{
|
||||
<div class="col-md-4">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AddSplitToSash()">Split</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-0">
|
||||
@if (!User && CurrAnta.AreaList[0].AreaList.Count == 0)
|
||||
{
|
||||
<div class="col-md-4 px-2">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AddInglesinaToSash()">Inglesina</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-1 px-0">
|
||||
<button type="button" class="btn-close" aria-label="Close" @onclick="() => ClosePopup(IndexSash)"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-12 my-2">
|
||||
<div class="row align-items-center justify-content-start">
|
||||
<div class="col-lg-2 col-md-12 my-2">
|
||||
<div class="input-group mb-2">
|
||||
@if (User)
|
||||
{
|
||||
@@ -131,13 +160,32 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="@OpeningTypeIndex">
|
||||
@foreach (var openingType in CurrSashDim.OpeningTypeList)
|
||||
{
|
||||
<option value=@(openingType.Id)>@(openingType.Name)</option>
|
||||
}
|
||||
</select>
|
||||
<div class="dropdown" @onfocusout="HandleFocusOut" tabindex="0">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle d-flex align-items-center gap-2"
|
||||
type="button"
|
||||
@onclick="ToggleDropdownOpening"
|
||||
aria-expanded="@isOpenDropdown">
|
||||
<span class="d-flex align-items-center">
|
||||
<img class="img-fluid" src="@GetImageOpeningPath(CurrOpening)" title="@(CurrOpening)" width="50" />
|
||||
</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu p-2 @(isOpenDropdown ? "show" : "")"
|
||||
style="position: absolute; min-width: 20em;">
|
||||
<div class="row g-2 row-cols-4 m-0">
|
||||
@foreach (var openingType in CurrSashDim.OpeningTypeList)
|
||||
{
|
||||
<div class="col p-0">
|
||||
<button type="button"
|
||||
class="dropdown-item d-flex flex-column align-items-center justify-content-center p-2 rounded text-center h-100 @ButtonOpeningCss(openingType.Id)"
|
||||
@onclick="() => SelOpeningSash(openingType.Id, openingType.Name)">
|
||||
<img class="img-fluid" src="@GetImageOpeningPath(openingType.Name)"
|
||||
title="@(openingType.Name)" width="100" />
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,6 +23,12 @@ namespace WebWindowComplex.Compo
|
||||
[Parameter]
|
||||
public SashDimension CurrSashDim { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Apertura sash dimension corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CurrOpening { get; set; } = null!;
|
||||
|
||||
///// <summary>
|
||||
///// Lista di ante che si stanno editando
|
||||
///// </summary>
|
||||
@@ -86,6 +92,11 @@ namespace WebWindowComplex.Compo
|
||||
//{
|
||||
// base.OnParametersSet();
|
||||
//}
|
||||
|
||||
//protected override void OnInitialized()
|
||||
//{
|
||||
// CurrOpening = CurrSashDim.OpeningTypeList.FirstOrDefault(x => x.Id == CurrSashDim.SelOpeningTypeIndex).Name;
|
||||
//}
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
@@ -103,10 +114,16 @@ namespace WebWindowComplex.Compo
|
||||
|
||||
private ModeView mode { get; set; } = ModeView.View;
|
||||
|
||||
private bool isOpenDropdown = false;
|
||||
|
||||
//private string currOpening = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string GetImageOpeningPath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/sash/opening/{fileName}.svg";
|
||||
|
||||
/// <summary>
|
||||
/// Anta corrente
|
||||
/// </summary>
|
||||
@@ -159,15 +176,15 @@ namespace WebWindowComplex.Compo
|
||||
private int OpeningTypeIndex
|
||||
{
|
||||
get => CurrSashDim.SelOpeningTypeIndex;
|
||||
set
|
||||
{
|
||||
if (CurrSashDim.SelOpeningTypeIndex != value)
|
||||
{
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetHwOpt });
|
||||
CurrSashDim.SelOpeningTypeIndex = value;
|
||||
_ = EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
}
|
||||
}
|
||||
//set
|
||||
//{
|
||||
// if (CurrSashDim.SelOpeningTypeIndex != value)
|
||||
// {
|
||||
// _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetHwOpt });
|
||||
// CurrSashDim.SelOpeningTypeIndex = value;
|
||||
// _ = EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -464,6 +481,42 @@ namespace WebWindowComplex.Compo
|
||||
ForceChangeAll = !ForceChangeAll;
|
||||
}
|
||||
|
||||
private async Task SelOpeningSash(int index, string name)
|
||||
{
|
||||
if (CurrSashDim.SelOpeningTypeIndex != index)
|
||||
{
|
||||
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetHwOpt});
|
||||
CurrSashDim.SelOpeningTypeIndex = index;
|
||||
await EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
}
|
||||
CurrOpening = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per la visualizzazione dei pulsanti tipology
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
private string ButtonOpeningCss(int index)
|
||||
{
|
||||
string ans = "";
|
||||
if (OpeningTypeIndex == index)
|
||||
ans = "active";
|
||||
return ans;
|
||||
}
|
||||
|
||||
private void ToggleDropdownOpening()
|
||||
{
|
||||
isOpenDropdown = !isOpenDropdown;
|
||||
}
|
||||
|
||||
// Chiude il dropdown quando l'utente clicca all'esterno dell'elemento
|
||||
private async Task HandleFocusOut()
|
||||
{
|
||||
// Un piccolo delay assicura che l'evento @onclick dell'item venga eseguito prima di chiudere il menu
|
||||
await Task.Delay(150);
|
||||
isOpen = false;
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace WebWindowComplex.Compo
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
private string GetImageShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/shape/{fileName}.svg";
|
||||
private string GetImageShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/frame/shape/{fileName}.svg";
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per selezionare shape
|
||||
|
||||
@@ -21,7 +21,41 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="row pt-2">
|
||||
<div class="row pb-3">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@if (User)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashGroup.OrientationSashTypeList.FirstOrDefault(x => x.Id == OrientationSashTypeIndex).Name)">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-start align-items-center" style="min-height: 2.5rem;">
|
||||
<h6 class="fw-bold">Tipology</h6>
|
||||
</div>
|
||||
<div class="row">
|
||||
@foreach (var i in CurrSashGroup.OrientationSashTypeList)
|
||||
{
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn @ButtonTipologyCss(i.Id) shadow-sm mx-1 px-1 py-1" @onclick="() => SelTipologySash(i.Id)">
|
||||
<img class="img-fluid" src="@GetImageTipologyPath(i.Name)" title="@(i.Name)" width="40" />
|
||||
</button>
|
||||
</div>
|
||||
@* <label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="@OrientationSashTypeIndex">
|
||||
@foreach (var orientationSash in CurrSashGroup.OrientationSashTypeList)
|
||||
{
|
||||
<option value="@(orientationSash.Id)">@(orientationSash.Name)</option>
|
||||
}
|
||||
</select> *@
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Qty sash</span>
|
||||
@@ -35,25 +69,6 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashGroup.OrientationSashTypeList.FirstOrDefault(x => x.Id == OrientationSashTypeIndex).Name)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="@OrientationSashTypeIndex">
|
||||
@foreach (var orientationSash in CurrSashGroup.OrientationSashTypeList)
|
||||
{
|
||||
<option value="@(orientationSash.Id)">@(orientationSash.Name)</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Qty bottom rail</span>
|
||||
@@ -214,6 +229,7 @@
|
||||
<div class="@AreaSashCss(i)">
|
||||
<AreaSash CurrSashDim="CurrSashGroup.SashList[i]"
|
||||
IndexSash="i"
|
||||
CurrOpening="@GetCurrOpening(CurrSashGroup.SashList[i])"
|
||||
EC_UpdateSash="UpdateSash"
|
||||
EC_UpdateSashDim="UpdateSashDimension"
|
||||
EC_ReqResetDict="ResetDict"
|
||||
|
||||
@@ -92,6 +92,8 @@ namespace WebWindowComplex.Compo
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
private string GetImageTipologyPath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/sash/tipology/{fileName}.svg";
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
currSashDimEdit = SashDimEditList;
|
||||
@@ -164,18 +166,18 @@ namespace WebWindowComplex.Compo
|
||||
private int OrientationSashTypeIndex
|
||||
{
|
||||
get => CurrSashGroup.SelOrientationSashTypeIndex;
|
||||
set
|
||||
{
|
||||
if (CurrSashGroup.SelOrientationSashTypeIndex != value)
|
||||
{
|
||||
CurrSashGroup.SelOrientationSashTypeIndex = value;
|
||||
var args = new DataUpdateSash()
|
||||
{
|
||||
currSash = CurrSashGroup
|
||||
};
|
||||
_ = EC_UpdateSashGroup.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
//set
|
||||
//{
|
||||
// if (CurrSashGroup.SelOrientationSashTypeIndex != value)
|
||||
// {
|
||||
// CurrSashGroup.SelOrientationSashTypeIndex = value;
|
||||
// var args = new DataUpdateSash()
|
||||
// {
|
||||
// currSash = CurrSashGroup
|
||||
// };
|
||||
// _ = EC_UpdateSashGroup.InvokeAsync(args);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -286,6 +288,35 @@ namespace WebWindowComplex.Compo
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Selezione tipo di orientamento della sash
|
||||
/// </summary>
|
||||
private async Task SelTipologySash( int index)
|
||||
{
|
||||
if (CurrSashGroup.SelOrientationSashTypeIndex != index)
|
||||
{
|
||||
CurrSashGroup.SelOrientationSashTypeIndex = index;
|
||||
var args = new DataUpdateSash()
|
||||
{
|
||||
currSash = CurrSashGroup
|
||||
};
|
||||
await EC_UpdateSashGroup.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per la visualizzazione dei pulsanti tipology
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
private string ButtonTipologyCss(int index)
|
||||
{
|
||||
string ans = "";
|
||||
if (OrientationSashTypeIndex == index)
|
||||
ans = "active";
|
||||
return ans;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per rimuovere area corrente
|
||||
/// </summary>
|
||||
@@ -547,6 +578,11 @@ namespace WebWindowComplex.Compo
|
||||
return "dropdown-item fw-bold";
|
||||
return "dropdown-item";
|
||||
}
|
||||
|
||||
private string GetCurrOpening(SashDimension currSashDim)
|
||||
{
|
||||
return currSashDim.OpeningTypeList.FirstOrDefault(x => x.Id == currSashDim.SelOpeningTypeIndex).Name;
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace WebWindowComplex.Compo
|
||||
//}
|
||||
}
|
||||
|
||||
private string GetImageShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/split/{fileName}.svg";
|
||||
private string GetImageShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/split/shape/{fileName}.svg";
|
||||
|
||||
private bool SearchSash(Area area)
|
||||
{
|
||||
@@ -203,17 +203,17 @@ namespace WebWindowComplex.Compo
|
||||
{
|
||||
currSplit = CurrSplit
|
||||
};
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
|
||||
await 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 });
|
||||
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
if (SearchSash(CurrSplit))
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt });
|
||||
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt });
|
||||
}
|
||||
_ = EC_ReqElement.InvokeAsync(CurrSplit);
|
||||
_ = EC_UpdateSplit.InvokeAsync(args);
|
||||
await EC_ReqElement.InvokeAsync(CurrSplit);
|
||||
await EC_UpdateSplit.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user