Fix loop ram

This commit is contained in:
zaccaria.majid
2022-10-18 15:56:14 +02:00
parent 8d0292d789
commit 56c3ba4064
10 changed files with 95 additions and 49 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ namespace MP.SPEC.Components
protected int _numRecord { get; set; } = 10;
protected int percLoading { get; set; } = 0;
protected int percLoading { get; set; } = 0;
#endregion Protected Properties
+14 -2
View File
@@ -261,7 +261,19 @@ namespace MP.SPEC.Components
private bool showStats { get; set; } = false;
private int totalCount { get; set; } = 0;
private int _totalCount { get; set; } = 0;
private int totalCount
{
get => _totalCount;
set
{
if (_totalCount != value)
{
_totalCount = value;
updateRecordCount.InvokeAsync(value);
}
}
}
#endregion Private Properties
@@ -362,7 +374,7 @@ namespace MP.SPEC.Components
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
await updateRecordCount.InvokeAsync(totalCount);
//await updateRecordCount.InvokeAsync(totalCount);
isLoading = false;
}
+37 -23
View File
@@ -38,6 +38,7 @@ namespace MP.SPEC.Components
return answ;
}
#endregion Public Methods
#region Protected Properties
@@ -51,7 +52,7 @@ namespace MP.SPEC.Components
[Inject]
protected IOApiService MpIoApiCall { get; set; } = null!;
#if true
#if false
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endif
@@ -105,11 +106,12 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
#if true
#if false
MsgService.EA_PageUpdated += MessageService_EA_PageUpdated;
MsgService.EA_SearchUpdated += OnSeachUpdated;
MsgService.EA_StatoSearch += MsgService_EA_StatoSearch;
#endif
//await FilterChanged.InvokeAsync(currFilter);
ListStati = await MDService.AnagStatiComm();
}
@@ -209,37 +211,49 @@ namespace MP.SPEC.Components
private List<ListValues>? ListStati;
private List<PODLModel>? SearchRecords;
private SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams();
#endregion Private Fields
#region Private Properties
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private bool isLoading { get; set; } = false;
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private string SearchVal
{
get => string.IsNullOrEmpty(MsgService.SearchVal) ? "*" : MsgService.SearchVal;
get => string.IsNullOrEmpty(currFilter.SearchVal) ? "*" : currFilter.SearchVal;
}
private string StatoSel
{
get => MsgService.StateSel;
set => MsgService.StateSel = value;
get => currFilter.CodStato;
set => currFilter.CodStato = value;
}
private int totalCount { get; set; } = 0;
private int _totalCount { get; set; } = 0;
private int totalCount
{
get => _totalCount;
set
{
if (_totalCount != value)
{
_totalCount = value;
updateRecordCount.InvokeAsync(value);
}
}
}
#endregion Private Properties
@@ -318,16 +332,16 @@ namespace MP.SPEC.Components
await reloadData();
}
private async void MsgService_EA_StatoSearch()
{
await InvokeAsync(() =>
{
PagerResetReq.InvokeAsync(true);
//currPage = 1;
Task task = UpdateData();
StateHasChanged();
});
}
//private async void MsgService_EA_StatoSearch()
//{
// await InvokeAsync(() =>
// {
// PagerResetReq.InvokeAsync(true);
// //currPage = 1;
// Task task = UpdateData();
// StateHasChanged();
// });
//}
/// <summary>
/// processa evento richiesto
@@ -371,7 +385,7 @@ namespace MP.SPEC.Components
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
await updateRecordCount.InvokeAsync(totalCount);
//await updateRecordCount.InvokeAsync(totalCount);
isLoading = false;
}
@@ -388,7 +402,7 @@ namespace MP.SPEC.Components
}
return answ;
}
#endregion Private Methods
}
}
+3
View File
@@ -17,6 +17,7 @@ namespace MP.SPEC.Data
public string IdxMacchina { get; set; } = "*";
public int CurrPage { get; set; } = 1;
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7);
public int MaxRecord { get; set; } = 100;
@@ -46,6 +47,8 @@ namespace MP.SPEC.Data
if (NumRec != item.NumRec)
return false;
if (TotCount != item.TotCount)
return false;
if (DtStart != item.DtStart)
return false;
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2210.1811</Version>
<Version>6.16.2210.1815</Version>
</PropertyGroup>
<ItemGroup>
+5 -7
View File
@@ -44,8 +44,10 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
#if false
[Inject]
protected MessageService MsgService { get; set; } = null!;
protected MessageService MsgService { get; set; } = null!;
#endif
protected DateTime selDtEnd
{
@@ -87,10 +89,6 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
// abilito ricerca...
MsgService.ShowSearch = true;
// resetto search
MsgService.SearchVal = "";
ListStati = await MDService.AnagStatiComm();
ListMacchine = await MDService.MacchineWithFlux();
#if false
@@ -136,8 +134,8 @@ namespace MP.SPEC.Pages
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private bool isLoading { get; set; } = false;
+31 -12
View File
@@ -14,6 +14,7 @@ namespace MP.SPEC.Pages
protected DataPager pagerODL;
protected bool reqNew = false;
private SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams();
#endregion Protected Fields
@@ -27,10 +28,12 @@ namespace MP.SPEC.Pages
[Inject]
protected IOApiService MpIoApiCall { get; set; } = null!;
#if false
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endif
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
@@ -70,10 +73,6 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
// abilito ricerca...
MsgService.ShowSearch = true;
// resetto search
MsgService.SearchVal = "";
ListAziende = await MDService.ElencoAziende();
ListGruppiFase = await MDService.ElencoGruppiFase();
ListMacchine = await MDService.MacchineGetAll();
@@ -239,8 +238,8 @@ namespace MP.SPEC.Pages
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private PODLModel? currRecord
@@ -257,20 +256,25 @@ namespace MP.SPEC.Pages
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private string selStato
{
get => MsgService.StateSel;
set => MsgService.StateSel = value;
get => currFilter.CodStato;
set => currFilter.CodStato = value;
}
private int totalCount
{
get => MsgService.totalCount;
set => MsgService.totalCount = value;
get => currFilter.TotCount;
set => currFilter.TotCount = value;
}
protected void updateTotal(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Private Properties
@@ -305,6 +309,21 @@ namespace MP.SPEC.Pages
isLoading = false;
}
private async Task updateFilter(SelectPOdlParams newParams)
{
isLoading = true;
await Task.Delay(1);
currPage = 1;
if (newParams.CurrPage == 0)
{
newParams.CurrPage = 1;
}
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
currFilter = newParams;
isLoading = false;
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2210.1811</h4>
<h4>Versione: 6.16.2210.1815</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2210.1811
6.16.2210.1815
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2210.1811</version>
<version>6.16.2210.1815</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>