- modificati parametri in ingresso del componente

- modificata interfaccia della tab general
This commit is contained in:
Annamaria Sassi
2025-07-16 15:13:28 +02:00
parent 173d605593
commit f3e82c300f
6 changed files with 86 additions and 95 deletions
+50 -50
View File
@@ -72,61 +72,61 @@
}
</tbody>
</table>
@foreach (FrameDimension dimension in m_frame.DimensionList)
{
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">@dimension.nIndex</span>
<span class="input-group-text" id="basic-addon1">@dimension.sName</span>
<input type="number" class="form-control" aria-label="@dimension.dValue" @bind="@dimension.dValue">
</div>
}
<div class="input-group mb-3 w-25">
<label class="input-group-text" for="inputGroupSelect01">Shape</label>
<select class="form-select" @bind="@m_frame.SelShapeIndex">
<option value="0">Rettangolo</option>
<option value="1">Right Chamfer</option>
<option value="2">Left Chamfer</option>
<option value="3">Double Chamfer</option>
<option value="4">Arc</option>
<option value="5">Arc Full</option>
<option value="6">Double Arc</option>
<option value="7">Triangle</option>
</select>
</div>
<div class="input-group w-50">
@foreach (Joint joint in m_frame.JointList)
{
<div class="input-group mb-3 w-50">
<label class="input-group-text" for="inputGroupSelect02">Giunzioni telaio @joint.nIndex</label>
<select class="form-select" @bind="@joint.SelJointTypeIndex">
<option value="0">Angled</option>
<option value="1">Full H</option>
<option value="2">Full V</option>
</select>
</div>
}
</div>
<div class="d-flex justify-content-start fs-5 mb-3 w-25">
<div class="p-2">
<input class="form-check-input ml-auto" type="checkbox" name="BottomRail" id="BottomRail" @bind="@m_frame.BottomRail">
</div>
<div class="p-2">
<label class="form-check-label" for="checkDefault">BottomRail</label>
</div>
</div>
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">BottomRailQty</span>
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@m_frame.BottomRailQty">
</div>
@*<button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
}
else if (currStep == CompileStep.Sash)
{
<div class="alert alert-light text-center display-4">
@*<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">SashQty</span>
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@m_TemplateList">
</div> *@
@foreach (FrameDimension dimension in m_frame.DimensionList)
{
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">@dimension.nIndex</span>
<span class="input-group-text" id="basic-addon1">@dimension.sName</span>
<input type="number" class="form-control" aria-label="@dimension.dValue" @bind="@dimension.dValue">
</div>
}
<div class="input-group mb-3 w-25">
<label class="input-group-text" for="inputGroupSelect01">Shape</label>
<select class="form-select" @bind="@m_frame.SelShapeIndex">
<option value="0">Rettangolo</option>
<option value="1">Right Chamfer</option>
<option value="2">Left Chamfer</option>
<option value="3">Double Chamfer</option>
<option value="4">Arc</option>
<option value="5">Arc Full</option>
<option value="6">Double Arc</option>
<option value="7">Triangle</option>
</select>
</div>
<div class="input-group w-50">
@foreach (Joint joint in m_frame.JointList)
{
<div class="input-group mb-3 w-50">
<label class="input-group-text" for="inputGroupSelect02">Giunzioni telaio @joint.nIndex</label>
<select class="form-select" @bind="@joint.SelJointTypeIndex">
<option value="0">Angled</option>
<option value="1">Full H</option>
<option value="2">Full V</option>
</select>
</div>
}
</div>
<div class="d-flex justify-content-start fs-5 mb-3 w-25">
<div class="p-2">
<input class="form-check-input ml-auto"
type="checkbox"
name="BottomRail"
id="BottomRail"
@bind="@m_frame.BottomRail">
</div>
<div class="p-2">
<label class="form-check-label" for="checkDefault">BottomRail</label>
</div>
</div>
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">BottomRailQty</span>
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@m_frame.BottomRailQty">
</div>
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
</div>
}
+31 -39
View File
@@ -22,14 +22,25 @@ namespace WebWindowConfigurator
[Parameter]
public EventCallback<TemplateSelectDTO> EC_OnSelectedTemplate { get; set; }
[Parameter]
public string OUT_CurrJwd { get; set; } = null!;
[Parameter]
public List<TemplateSelectDTO> IN_TemplateDTOList { get; set; } = null!;
[Parameter]
public Template IN_SelTemplate { get; set; } = null!;
public Template IN_SelTemplate
{
get => mSelTemplate;
set {
if (value != null && !string.IsNullOrEmpty(value.JWD))
{
mSelTemplate = value;
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(mSelTemplate.JWD, new PolymorphicJsonConverter());
m_CurrWindow = WindowFromJson.Deserialize();
}
}
}
private Template mSelTemplate { get; set; } = null!;
public TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
@@ -40,13 +51,6 @@ namespace WebWindowConfigurator
#region Public Methods
public void ReadJwd()
{
if (IN_SelTemplate == null || string.IsNullOrEmpty(IN_SelTemplate.JWD)) { return; }
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(IN_SelTemplate.JWD, new PolymorphicJsonConverter());
m_CurrWindow = WindowFromJson.Deserialize();
}
#endregion Public Methods
#region Protected Enums
@@ -54,7 +58,7 @@ namespace WebWindowConfigurator
protected enum CompileStep
{
General = 0,
Sash=1,
Sash = 1,
Split,
Fill
}
@@ -71,35 +75,30 @@ namespace WebWindowConfigurator
#endregion Protected Properties
#region Protected Methods
protected async Task DoClose()
protected override void OnInitialized()
{
await EC_OnClose.InvokeAsync(true);
}
protected async Task DoSave()
{
OUT_CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
await EC_OnUpdate.InvokeAsync(OUT_CurrJwd);
//base.OnInitialized();
//m_CurrWindow = new Window();
//Frame NewFrame = (Frame)Frame.CreateFrame(m_CurrWindow);
//m_CurrWindow.AreaList.Add(NewFrame);
//m_SelArea = NewFrame;
//Sash NewSash = Sash.CreateSash(NewFrame);
//NewFrame.AreaList.Add(NewSash);
}
protected async void DoSelect(TemplateSelectDTO newSel)
{
SelTemplateDTO = newSel;
await EC_OnSelectedTemplate.InvokeAsync(newSel);
// carico template
ReadJwd();
}
protected override void OnInitialized()
protected async Task DoSave()
{
//base.OnInitialized();
m_CurrWindow = new Window();
Frame NewFrame = (Frame)Frame.CreateFrame(m_CurrWindow);
m_CurrWindow.AreaList.Add(NewFrame);
m_SelArea = NewFrame;
Sash NewSash = Sash.CreateSash(NewFrame);
NewFrame.AreaList.Add(NewSash);
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
await EC_OnUpdate.InvokeAsync(CurrJwd);
}
protected async Task DoClose()
{
await EC_OnClose.InvokeAsync(true);
}
#endregion Protected Methods
@@ -121,13 +120,6 @@ namespace WebWindowConfigurator
private void AdvStep(CompileStep newStep)
{
currStep = newStep;
//switch(newStep)
//{
// case CompileStep.General:
// {
// break;
// }
//}
}
#endregion Private Methods
+1 -1
View File
@@ -1096,7 +1096,7 @@ namespace WebWindowConfigurator
internal override JsonArea Serialize()
{
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_SelHardware.sId);
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType/*, m_SelHardware.sId*/);
foreach (var SashDimension in SashList)
JsonSash.SashList.Add(SashDimension.Serialize());
foreach (var Joint in JointList)