corretto recupero dati x scarti (pareto)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="col-6">
|
||||
<ul>
|
||||
|
||||
@foreach (var item in CurrData)
|
||||
@foreach (var item in @CurrData)
|
||||
{
|
||||
<li>@item.label: @item.value</li>
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
[Parameter]
|
||||
public SelectData currFilter { get; set; }
|
||||
|
||||
protected List<ChartKV> CurrData = new List<ChartKV>();
|
||||
protected List<ChartKV> CurrData { get; set; } = new List<ChartKV>();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
@@ -274,12 +274,12 @@ namespace MP.Stats.Data
|
||||
else
|
||||
{
|
||||
// recupero dal DB (eventualmente con cache)
|
||||
var dbResult = StatScartiGetAll(CurrFilter, searchVal);
|
||||
var dbResult = await StatScartiGetAll(CurrFilter, searchVal);
|
||||
// faccio conteggio...
|
||||
statResult = dbResult
|
||||
.Result
|
||||
.GroupBy(x => x.Causale)
|
||||
.Select(y => new ChartKV() { label = y.First().Causale, value = y.Sum(c => c.Qta) })
|
||||
.Select(y => new ChartKV() { label = y.First().Descrizione, value = y.Sum(c => c.Qta) })
|
||||
.OrderByDescending(x => x.value)
|
||||
.ToList();
|
||||
|
||||
rawData = JsonConvert.SerializeObject(statResult);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter"></SelectionFilter>
|
||||
</div>
|
||||
<div class="card-body py-0 px-1">
|
||||
@*<ChartScarti></ChartScarti>*@
|
||||
<ChartScarti currFilter="@currFilter"></ChartScarti>
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
|
||||
Reference in New Issue
Block a user