Ancora memory leak

- diminuito problema di refresh automatico
- inizio gestione dispose oggetti
This commit is contained in:
Samuele Locatelli
2022-10-18 16:53:00 +02:00
parent a21cd16362
commit f6406f833f
7 changed files with 49 additions and 66 deletions
+8 -14
View File
@@ -19,10 +19,10 @@ else
</div>
<div class="col-6 col-lg-4 text-end">
@*<div class="px-2 input-group" title="Selezionare Data-Ora chiusura ODL">
<label class="input-group-text" for="dtMax"><i class="fa-regular fa-calendar-minus"></i></label>
<input class="form-control" @bind="@selDtFine" id="dtMax" type="datetime-local">
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
</div>*@
<label class="input-group-text" for="dtMax"><i class="fa-regular fa-calendar-minus"></i></label>
<input class="form-control" @bind="@selDtFine" id="dtMax" type="datetime-local">
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
</div>*@
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
</div>
}
@@ -99,9 +99,8 @@ else
else
{
<div class="text-secondary">
@*<div><b>@($"{DateTime.Now:yyyy/MM/dd}")</b></div>
<div>@($"{DateTime.Now:ddd HH:mm:ss}")</div>*@
<div><b>NOW</b></div>
<div><b>@($"{DateTime.Now:yyyy/MM/dd}")</b></div>
<div>@($"{DateTime.Now:ddd HH:mm:ss}")</div>
</div>
}
</div>
@@ -173,18 +172,13 @@ else
else
{
<div class="text-secondary">
@*<div><b>@($"{DateTime.Now:yyyy/MM/dd}")</b></div>
<div>@($"{DateTime.Now:ddd HH:mm:ss}")</div>*@
<div><b>NOW</b></div>
<div><b>@($"{DateTime.Now:yyyy/MM/dd}")</b></div>
<div>@($"{DateTime.Now:ddd HH:mm:ss}")</div>
</div>
}
</div>
</div>
</td>
<td>
<!-- Modal -->
</td>
</tr>
</tbody>
</table>
+9 -5
View File
@@ -6,7 +6,7 @@ using MP.SPEC.Services;
namespace MP.SPEC.Components
{
public partial class ListODL
public partial class ListODL: IDisposable
{
#region Public Properties
@@ -53,10 +53,14 @@ namespace MP.SPEC.Components
[Inject]
protected MpDataService MDService { get; set; } = null!;
#if false
[Inject]
protected MessageService MessageService { get; set; } = null!;
#endif
public void Dispose()
{
currRecord = null;
SearchRecords = null;
ListRecords= null;
}
[Inject]
protected IOApiService MpIoApiCall { get; set; } = null!;
+1 -1
View File
@@ -13,7 +13,7 @@ namespace MP.SPEC.Components
[Parameter]
public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams();
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams();
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 };
[Parameter]
public EventCallback<bool> PagerResetReq { get; set; }
+26 -22
View File
@@ -1,7 +1,4 @@
using MP.Data;
using System.Runtime.CompilerServices;
namespace MP.SPEC.Data
namespace MP.SPEC.Data
{
public class SelectPOdlParams
{
@@ -10,6 +7,28 @@ namespace MP.SPEC.Data
public SelectPOdlParams()
{ }
#endregion Public Constructors
#region Public Properties
public string CodFase { get; set; } = "*";
public int CurrPage { get; set; } = 1;
public string IdxMacchina { get; set; } = "*";
public int MaxRecord { get; set; } = 100;
public int NumRec { get; set; } = 10;
public string SearchVal { get; set; } = "*";
public int TotCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
public SelectPOdlParams clone()
{
SelectPOdlParams clonedData = new SelectPOdlParams()
@@ -25,28 +44,12 @@ namespace MP.SPEC.Data
return clonedData;
}
#endregion Public Constructors
#region Public Properties
public string CodFase { get; set; } = "*";
public string IdxMacchina { get; set; } = "*";
public int CurrPage { get; set; } = 1;
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public int MaxRecord { get; set; } = 100;
public string SearchVal { get; set; } = "*";
#endregion Public Properties
#region Public Methods
public override bool Equals(object obj)
{
if (!(obj is SelectOdlParams item))
if (!(obj is SelectPOdlParams item))
return false;
if (CodFase != item.CodStato)
if (CodFase != item.CodFase)
return false;
if (MaxRecord != item.MaxRecord)
@@ -54,6 +57,7 @@ namespace MP.SPEC.Data
if (NumRec != item.NumRec)
return false;
if (TotCount != item.TotCount)
return false;
+2 -13
View File
@@ -26,7 +26,7 @@ namespace MP.SPEC.Pages
#region Protected Fields
protected DataPager pagerODL;
protected DataPager pagerODL = null!;
#endregion Protected Fields
@@ -44,11 +44,6 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
#if false
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endif
protected DateTime selDtEnd
{
get => currFilter.DtEnd;
@@ -91,10 +86,6 @@ namespace MP.SPEC.Pages
{
ListStati = await MDService.AnagStatiComm();
ListMacchine = await MDService.MacchineWithFlux();
#if false
// carico dati
await reloadData();
#endif
}
protected async Task pgResetReq(bool doReset)
@@ -114,9 +105,7 @@ namespace MP.SPEC.Pages
protected void UpdateTotCount(int newTotCount)
{
#if false
totalCount = newTotCount;
#endif
totalCount = newTotCount;
}
#endregion Protected Methods
+2 -5
View File
@@ -226,9 +226,6 @@
}
</div>
<div class="card-footer py-1">
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="@isLoading" />
</div>
</div>
</div>
+1 -6
View File
@@ -11,7 +11,7 @@ namespace MP.SPEC.Pages
{
#region Protected Fields
protected DataPager pagerODL;
protected DataPager pagerODL = null!;
protected bool reqNew = false;
@@ -153,11 +153,6 @@ namespace MP.SPEC.Pages
await Task.Delay(1);
}
protected void updateTotal(int newTotCount)
{
totalCount = newTotCount;
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;