144 lines
3.8 KiB
Plaintext
144 lines
3.8 KiB
Plaintext
@using GPW.CORE.Data.DbModels
|
|
@using CORE.Data.DbModels
|
|
@using UI.Data
|
|
|
|
@inject IJSRuntime JSRuntime
|
|
@inject GpwDataService GDataServ
|
|
@inject MessageService AppMServ
|
|
|
|
@if (ListRecords == null)
|
|
{
|
|
<LoadingData></LoadingData>
|
|
}
|
|
else
|
|
{
|
|
|
|
<table class="table table-sm table-striped table-responsive-md border border-dark">
|
|
<thead>
|
|
<tr class="bg-dark text-light">
|
|
<th>Progetto</th>
|
|
<th class="text-right">ore</th>
|
|
<th class="text-right">sel</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in ListRecords)
|
|
{
|
|
<tr class="@cssRiga(item.idxFase)">
|
|
<td>
|
|
<div class="d-flex">
|
|
<div class="px-2">
|
|
(@item.RowNum.ToString("00"))
|
|
</div>
|
|
<div class="px-2">
|
|
<b>@item.nomeProj</b> | @item.nomeComm - @item.nomeFase
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td class="text-right">@item.qty.ToString("N2")</td>
|
|
<td class="text-right"><button @onclick="() => SelectRecord(item.idxFase)" class="btn btn-sm btn-success"><i class="fas fa-arrow-alt-circle-right"></i></button></td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-2">
|
|
<label class="small">giorni precedenti da considerare</label>
|
|
<div class="input-group input-group-sm mb-2">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"># days</span>
|
|
</div>
|
|
<input type="number" class="form-control text-right" placeholder="Giorni Precedenti" @bind-value="@ggPrec">
|
|
</div>
|
|
</div>
|
|
<div class="px-2">
|
|
<label class="small">Risultati Max</label>
|
|
<div class="input-group input-group-sm mb-2">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"># res</span>
|
|
</div>
|
|
<input type="number" class="form-control text-right" placeholder="Max Suggerimenti" @bind-value="@maxSugg">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
|
|
private int _maxSugg = 10;
|
|
private int _ggPrec = 60;
|
|
private int idxFaseSel = 0;
|
|
|
|
|
|
[Parameter]
|
|
public EventCallback<int> ItemSelected { get; set; }
|
|
[Parameter]
|
|
public int idxFase
|
|
{
|
|
get
|
|
{
|
|
return idxFaseSel;
|
|
}
|
|
set
|
|
{
|
|
idxFaseSel = value;
|
|
}
|
|
}
|
|
|
|
private int maxSugg
|
|
{
|
|
get
|
|
{
|
|
return _maxSugg;
|
|
}
|
|
set
|
|
{
|
|
_maxSugg = value;
|
|
var pUpd = Task.Run(async () => await ReloadData());
|
|
pUpd.Wait();
|
|
}
|
|
}
|
|
private int ggPrec
|
|
{
|
|
get
|
|
{
|
|
return _ggPrec;
|
|
}
|
|
set
|
|
{
|
|
_ggPrec = value;
|
|
var pUpd = Task.Run(async () => await ReloadData());
|
|
pUpd.Wait();
|
|
}
|
|
}
|
|
|
|
protected List<ParetoRegAttModel>? ListRecords { get; set; } = null;
|
|
|
|
protected string cssRiga(int idxFase)
|
|
{
|
|
string answ = "";
|
|
if (idxFase == idxFaseSel)
|
|
{
|
|
answ = "bg-info text-light";
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await ReloadData();
|
|
}
|
|
|
|
protected async Task ReloadData()
|
|
{
|
|
idxFaseSel = 0;
|
|
ListRecords = await GDataServ.ParetoRegAtt(AppMServ.IdxDipendente, ggPrec, maxSugg);
|
|
}
|
|
|
|
protected async Task SelectRecord(int idxFase)
|
|
{
|
|
idxFaseSel = idxFase;
|
|
await ItemSelected.InvokeAsync(idxFase);
|
|
}
|
|
}
|