Fix comportamento caricamento condizionale filtro
This commit is contained in:
@@ -4,44 +4,9 @@
|
||||
@inject HttpClient Http
|
||||
|
||||
<div class="row small">
|
||||
<div class="col-12 col-md-3 mb-2">
|
||||
<div class="form-floating small">
|
||||
<input type="text" class="form-control" @bind="SearchVal" @bind:after="ReloadArticoli">
|
||||
<label><i class="fa-solid fa-magnifying-glass"></i> Articolo (3+ char)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 mb-2">
|
||||
<div class="row">
|
||||
<div class="col-10 pe-0">
|
||||
<div class="form-floating">
|
||||
<select class="form-select form-select-sm" disabled="@ListArtDisabled" @bind="@CodArtSel" @bind:after="ReloadMacchine">
|
||||
<option value="" selected>-- Nessuno --</option>
|
||||
@if (ListArticoli == null)
|
||||
{
|
||||
<option value="" disabled>No record found</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in ListArticoli)
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="floatingSelect">Selezione Articolo (@DisplayCount / <b>@TotalCount</b>)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 ps-0">
|
||||
<div class="form-floating small">
|
||||
<input type="number" class="form-control text-end" @bind="Num2Displ" disabled="@ListArtDisabled">
|
||||
<label>Max Displ</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-3 mb-2">
|
||||
<div class="col-12 col-sm-6 col-xl-3 mb-2">
|
||||
<div class="form-floating">
|
||||
<select class="form-select form-select-sm" disabled="@ListMacDisabled" @bind="@IdxMaccSel">
|
||||
<select class="form-select form-select-sm" @bind="@IdxMaccSel">
|
||||
<option value="" selected>-- Tutti --</option>
|
||||
@if (ListMacchineAll == null)
|
||||
{
|
||||
@@ -58,6 +23,41 @@
|
||||
<label for="floatingSelect">Selezione Impianto (ODL/ART)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-xl-3 mb-2">
|
||||
<div class="row">
|
||||
<div class="col-8 col-md-9 pe-0">
|
||||
<div class="form-floating small">
|
||||
<input type="text" class="form-control" @bind="SearchVal" @bind:after="ReloadArticoli">
|
||||
<label><i class="fa-solid fa-magnifying-glass"></i> Articolo (3+ char)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 col-md-3 ps-0">
|
||||
<div class="form-floating small">
|
||||
<input type="number" class="form-control text-end" @bind="Num2Displ">
|
||||
<label># Displ</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-xl-6 mb-2">
|
||||
<div class="form-floating">
|
||||
<select class="form-select form-select-sm" disabled="@ListArtDisabled" @bind="@CodArtSel">
|
||||
<option value="" selected>-- Nessuno --</option>
|
||||
@if (ListArticoli == null)
|
||||
{
|
||||
<option value="" disabled>No record found</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in ListArticoli)
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="floatingSelect">Selezione Articolo (@DisplayCount / <b>@TotalCount</b>)</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
BaseAddr = config.GetValue<string>("OptConf:BaseAddr");
|
||||
BaseAddr = config.GetValue<string>("OptConf:BaseAddr") ?? "";
|
||||
await ReloadAllData();
|
||||
}
|
||||
|
||||
@@ -130,14 +130,11 @@
|
||||
}
|
||||
protected async Task ReloadMacchine()
|
||||
{
|
||||
if (!ListMacDisabled)
|
||||
string ApiUrl = $"{BaseAddr}api/ListSelect/GetDictMacc?MatrOpr={MatrOpr}";
|
||||
var rawData = await Http.GetFromJsonAsync<Dictionary<string, string>>(ApiUrl);
|
||||
if (rawData != null)
|
||||
{
|
||||
string ApiUrl = $"{BaseAddr}api/ListSelect/GetDictMacc?MatrOpr={MatrOpr}";
|
||||
var rawData = await Http.GetFromJsonAsync<Dictionary<string, string>>(ApiUrl);
|
||||
if (rawData != null)
|
||||
{
|
||||
ListMacchineAll = rawData;
|
||||
}
|
||||
ListMacchineAll = rawData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,10 +142,6 @@
|
||||
{
|
||||
get => string.IsNullOrEmpty(SearchVal) || SearchVal.Length < SearchMinChar;
|
||||
}
|
||||
protected bool ListMacDisabled
|
||||
{
|
||||
get => string.IsNullOrEmpty(CodArtSel);
|
||||
}
|
||||
|
||||
protected string SearchVal
|
||||
{
|
||||
@@ -158,14 +151,6 @@
|
||||
if (searchVal != value)
|
||||
{
|
||||
searchVal = value;
|
||||
// // var pUpd = Task.Run(async () =>
|
||||
// // {
|
||||
// // await ReloadArticoli();
|
||||
// // FiltArticoli();
|
||||
// // });
|
||||
// // pUpd.Wait();
|
||||
|
||||
// ReloadArticoli().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,13 +163,6 @@
|
||||
if (codArtSel != value)
|
||||
{
|
||||
codArtSel = value;
|
||||
// var pUpd = Task.Run(async () =>
|
||||
// {
|
||||
// await ReloadMacchine();
|
||||
// });
|
||||
// pUpd.Wait();
|
||||
ReloadMacchine().ConfigureAwait(false);
|
||||
// StateHasChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user