@if (isLoading)
@@ -15,10 +13,6 @@
{
if (MaccSelValid)
{
- if (ShowCharts == true)
- {
-
- }
@if (ListRecords == null)
{
@@ -29,6 +23,7 @@
}
else
{
+
@@ -39,7 +34,7 @@
| Articolo |
Inizio |
Fine |
- @if (dynMode)
+ @if (DynMode)
{
@Traduci("MP-STATS_TotCount01") |
@if (numCount > 1)
@@ -87,7 +82,7 @@
@record.DataInizio |
@record.DataFine |
- @if (dynMode)
+ @if (DynMode)
{
@($"{record.TotCount01:N0}") @GetUM("TotCount01") |
@if (numCount > 1)
diff --git a/MP.Stats/Pages/Energy.razor.cs b/MP.Stats/Pages/Energy.razor.cs
index 433178ec..7bf013a5 100644
--- a/MP.Stats/Pages/Energy.razor.cs
+++ b/MP.Stats/Pages/Energy.razor.cs
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DbModels;
using MP.Data.Services;
+using MP.Stats.Components;
using MP.Stats.Data;
using System;
using System.Collections.Generic;
@@ -18,6 +19,8 @@ namespace MP.Stats.Pages
public void Dispose()
{
MServ.EA_SearchUpdated -= OnSeachUpdated;
+ ListRecords.Clear();
+ SearchRecords.Clear();
}
public async void OnSeachUpdated()
@@ -47,7 +50,7 @@ namespace MP.Stats.Pages
protected IJSRuntime JSRuntime { get; set; }
///
- /// Verifica validità selezione macchine
+ /// Verifica validit� selezione macchine
///
protected bool MaccSelValid
{
@@ -71,7 +74,7 @@ namespace MP.Stats.Pages
#region Protected Methods
///
- /// Verifica: se è nullo il valore pz totali --> current --> indico non confermato
+ /// Verifica: se � nullo il valore pz totali --> current --> indico non confermato
///
///
///
@@ -112,14 +115,15 @@ namespace MP.Stats.Pages
protected override async Task OnInitializedAsync()
{
+ isLoading = true;
clearFile();
- numRecord = 10;
MServ.ShowSearch = false;
MServ.PageName = "ENERGY";
MServ.PageIcon = "oi oi-bar-chart";
MServ.EA_SearchUpdated += OnSeachUpdated;
await LoadConfData();
await ReloadData();
+ isLoading = false;
}
protected void ResetData()
@@ -161,14 +165,6 @@ namespace MP.Stats.Pages
DisplayData();
}
- protected async Task ToggleChart(bool doShow)
- {
- ShowCharts = !ShowCharts;
- if (ShowCharts)
- {
- await ReloadData();
- }
- }
///
/// Traduzione lemma richeisto (lingua default="IT")
@@ -193,7 +189,7 @@ namespace MP.Stats.Pages
private List ConfigList;
private OdlEnergyModel currRecord = null;
- private bool dynMode = false;
+ private bool DynMode = true;
private List ListRecords;
private int MaxDisplay = 20;
private int numCount = 1;
@@ -208,11 +204,11 @@ namespace MP.Stats.Pages
{
get
{
- return MServ.ODL_Filter;
+ return MServ.EnergyOdl_Filter;
}
set
{
- MServ.ODL_Filter = value;
+ MServ.EnergyOdl_Filter = value;
}
}
@@ -225,7 +221,6 @@ namespace MP.Stats.Pages
private bool isLoading { get; set; } = false;
private int numRecord { get; set; } = 10;
- private bool ShowCharts { get; set; } = true;
#endregion Private Properties
@@ -270,11 +265,11 @@ namespace MP.Stats.Pages
private async Task LoadConfData()
{
+ isLoading = true;
ConfigList = await StatService.ConfigGetAll();
ListMacchine = await StatService.MachineList(true);
NumMacc = ListMacchine.Count();
- dynMode = confVal("STATS_EnergyMode") == "Dynamic";
- var sNumCount = confVal("STATS_EnergyNumCount");
+ DynMode = confVal("STATS_EnergyMode") == "Dynamic";
int.TryParse(confVal("STATS_EnergyNumCount"), out numCount);
int.TryParse(confVal("STATS_EnergyNumTotEn"), out numTotEn);
int.TryParse(confVal("STATS_EnergyMaxSelect"), out MaxDisplay);
@@ -282,6 +277,7 @@ namespace MP.Stats.Pages
private async Task ReloadData()
{
+ isLoading = true;
if (SearchRecords != null)
{
SearchRecords.Clear();
@@ -291,11 +287,7 @@ namespace MP.Stats.Pages
SearchRecords = new List();
}
// se seleziona tutte...
- if (currFilter.ListIdxMaccSel == null || currFilter.ListIdxMaccSel.Count == 0)
- {
- SearchRecords = await StatService.StatOdlEnergyGetAll(currFilter, MServ.SearchVal);
- }
- else
+ if (currFilter.ListIdxMaccSel != null && currFilter.ListIdxMaccSel.Count > 0)
{
foreach (var idxMacc in currFilter.ListIdxMaccSel)
{
@@ -307,6 +299,7 @@ namespace MP.Stats.Pages
}
TotalCount = SearchRecords.Count;
DisplayData();
+ isLoading = false;
}
///
@@ -315,7 +308,7 @@ namespace MP.Stats.Pages
///
private async Task RemoveMachine(string idxMacc)
{
- // in primis se contiene spazio --> prendo prima aprte che è idxMacc...
+ // in primis se contiene spazio --> prendo prima aprte che � idxMacc...
if (idxMacc.Contains(" "))
{
var sVals = idxMacc.Split(' ');
diff --git a/MP.Stats/Pages/TrendAnalysis.razor b/MP.Stats/Pages/TrendAnalysis.razor
index 6c1aa347..dfa634c6 100644
--- a/MP.Stats/Pages/TrendAnalysis.razor
+++ b/MP.Stats/Pages/TrendAnalysis.razor
@@ -1,7 +1,6 @@
@page "/TrendAnalysis"
@page "/trend-analysis"
-@using MP.Stats.Components