Ancora update ricerca

This commit is contained in:
Samuele Locatelli
2023-04-03 19:36:28 +02:00
parent 11b1b3fc0c
commit 9eda0dbd12
3 changed files with 38 additions and 7 deletions
-2
View File
@@ -38,8 +38,6 @@ namespace MP.SPEC.Components.Chart
set
{
_DataTS = value;
//var pUpd = Task.Run(async () => await renderChart());
//pUpd.Wait();
}
}
+22 -4
View File
@@ -13,7 +13,7 @@ else
<h4>Ricetta Assegnata</h4>
</div>
<div class="text-danger">
@if(string.IsNullOrEmpty(RecipeCode))
@if (string.IsNullOrEmpty(RecipeCode))
{
<span>Manca ricetta!</span>
<i class="fa-solid fa-triangle-exclamation fa-2x"></i>
@@ -33,15 +33,33 @@ else
@if (showSearch)
{
<ul class="list-group small">
@foreach(var fileName in list2show)
<li class="list-group-item active">
<div class="d-flex justify-content-between">
<div>
search
</div>
<div>
<input class="form-control" @bind="@searchVal" type="text" title="Filtro ricerca" placeholder="ricerca">
</div>
</div>
</li>
@foreach (var fileName in list2show)
{
<li class="list-group-item">
<b>@Path.GetFileName(fileName)</b>
<div class="d-flex justify-content-between">
<div>
<button class="btn btn-sm btn-primary"><i class="fa-solid fa-file-import"></i></button>
</div>
<div>
<b>@fileName</b>
</div>
</div>
@*<b>@Path.GetFileName(fileName)</b>*@
</li>
}
<li class="list-group-item">
<div class="d-flex justify-content-between">
<div>show</div>
<div>show max</div>
<div>
<select @bind="@numShow">
<option>10</option>
+16 -1
View File
@@ -110,6 +110,21 @@ namespace MP.SPEC.Components
await Task.Delay(1);
}
protected string _searchVal = "";
protected string searchVal
{
get => _searchVal;
set
{
if (_searchVal != value)
{
_searchVal = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
protected int _numShow = 10;
protected int numShow
{
@@ -132,7 +147,7 @@ namespace MP.SPEC.Components
if (IdxPODL != 0 && !string.IsNullOrEmpty(RecipeArchPath))
{
recipeList = Directory.GetFiles(RecipeArchPath).ToList();
list2show = recipeList.Take(numShow).ToList();
list2show = recipeList.Where(x => string.IsNullOrEmpty(searchVal) || x.Contains(searchVal)).Take(numShow).ToList();
#if false
CurrRecipe = new RecipeModel();
// effettua ricerca ricetta su MongoDb