Update in display dettaglio macchina

This commit is contained in:
Samuele Locatelli
2023-10-02 12:33:34 +02:00
parent e65c36f538
commit f05ab648c2
3 changed files with 20 additions and 14 deletions
+18 -5
View File
@@ -1,13 +1,17 @@
@attribute [RenderModeAuto]
@using MP.Data.Services;
@inject MessageService MsgServ
<h1>Machine Detail</h1>
<h2><b>@IdxMacc</b></h2>
@if (MachineMSE == null)
@if (CurrMSE == null)
{
<MP_TAB.Client.Components.MachineBlock FullMode="false"></MP_TAB.Client.Components.MachineBlock>
}
else
{
<MP_TAB.Client.Components.MachineBlock RecMSE="MachineMSE" FullMode="false"></MP_TAB.Client.Components.MachineBlock>
<MP_TAB.Client.Components.MachineBlock RecMSE="CurrMSE" FullMode="false"></MP_TAB.Client.Components.MachineBlock>
}
@code {
@@ -16,6 +20,15 @@ else
[SupplyParameterFromQuery]
public string? IdxMacc { get; set; }
[Parameter]
public MappaStatoExpl? MachineMSE { get; set; } = null;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
// return base.OnAfterRenderAsync(firstRender);
}
protected MappaStatoExpl? CurrMSE { get; set; } = null;
}
@@ -37,7 +37,6 @@
{
// salvo in LocalStorage...
await MsgServ.SaveMse(ListMSE);
//return base.OnAfterRenderAsync(firstRender);
}
}
}
@@ -3,7 +3,7 @@
<!-- Temporary workaround until MapRazorComponents supports AddAdditionalAssemblies -->
<!-- Once that is implemented, the main project won't need to include this file -->
<MP_TAB.Client.Pages.MachineDetail MachineMSE="CurrMSE"></MP_TAB.Client.Pages.MachineDetail>
<MP_TAB.Client.Pages.MachineDetail ></MP_TAB.Client.Pages.MachineDetail>
@code {
@@ -11,12 +11,6 @@
[SupplyParameterFromQuery]
public string? IdxMacc { get; set; }
protected override Task OnAfterRenderAsync(bool firstRender)
{
// recupero MSE macchina....
return base.OnAfterRenderAsync(firstRender);
}
protected MappaStatoExpl? CurrMSE { get; set; } = null;
}