Abbozzato comportamento selezione filtro TC
This commit is contained in:
@@ -0,0 +1,174 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-3 mb-2">
|
||||
<div class="form-floating">
|
||||
<input type="text" class="form-control" @bind="SearchVal">
|
||||
<label for="floatingInput"><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="form-floating">
|
||||
<select class="form-select" disabled="@ListArtDisabled">
|
||||
<option value="0" selected>-- Selezione Articolo --</option>
|
||||
<option value="1">One</option>
|
||||
<option value="2">Two</option>
|
||||
<option value="3">Three</option>
|
||||
</select>
|
||||
<label for="floatingSelect">Selezione Articolo</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-3 mb-2">
|
||||
<div class="form-floating">
|
||||
<select class="form-select" disabled="@ListArtDisabled">
|
||||
<option value="0" selected>-- Selezione Impianto --</option>
|
||||
<option value="1">One</option>
|
||||
<option value="2">Two</option>
|
||||
<option value="3">Three</option>
|
||||
</select>
|
||||
<label for="floatingSelect">Selezione Impianto (ODL/ART)</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* <div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<h4>@Title</h4>
|
||||
</div>
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<div class="px-1">
|
||||
<div class="input-group" title="Filtro Impianto">
|
||||
<span class="input-group-text"><i class="fa-solid fa-industry"></i></span>
|
||||
<select class="form-select" aria-label="Select Macchina" style="width: 15rem;">
|
||||
<option value="0" selected>-- Selezionare Impianto --</option>
|
||||
@if (ListMacchineAll == null || ListMacchineAll.Count == 0)
|
||||
{
|
||||
<b>loading...</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in ListMacchineAll)
|
||||
{
|
||||
<option value="@item.IdxMacchina">@item.CodMacchina | @item.Descrizione</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-1">
|
||||
<div class="input-group" title="Filtro Articolo">
|
||||
<span class="input-group-text"><i class="fa-solid fa-box"></i></span>
|
||||
<input class="form-control" style="width: 4rem;" placeholder="*" title="Ricerca Articolo" @bind="@CurrFilt.SearchVal" />
|
||||
<select class="form-select" aria-label="Select Articolo" style="width: 25rem;">
|
||||
<option value="*" selected>-- Selezionare Articolo --</option>
|
||||
@if (ListArticoli == null || ListArticoli.Count == 0)
|
||||
{
|
||||
<b>loading...</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in ListArticoli)
|
||||
{
|
||||
<option value="@item.CodArticolo">@item.CodArticolo | @item.DescArticolo</option>
|
||||
}
|
||||
<option disabled>...totale @TotalCount rec</option>
|
||||
}
|
||||
</select>
|
||||
<button class="btn btn-primary" @onclick="LoadMore" title="Show more"><b>+10</b</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@code {
|
||||
|
||||
|
||||
protected bool ListArtDisabled
|
||||
{
|
||||
get => string.IsNullOrEmpty(SearchVal) || SearchVal.Length < 3;// ? "disabled" : "";
|
||||
}
|
||||
|
||||
protected async Task FixDisplay()
|
||||
{
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected string SearchVal
|
||||
{
|
||||
get => searchVal;
|
||||
set
|
||||
{
|
||||
if (searchVal != value)
|
||||
{
|
||||
searchVal = value;
|
||||
// InvokeAsync(StateHasChanged).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string searchVal { get; set; } = "";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[Parameter]
|
||||
public List<Macchine> ListMacchineAll { get; set; } = new List<Macchine>();
|
||||
|
||||
[Parameter]
|
||||
public List<AnagArticoli> ListArticoliAll { get; set; } = new List<AnagArticoli>();
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<TcFilt> E_FiltUpdated { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public int MatrOpr { get; set; } = 102;
|
||||
[Parameter]
|
||||
public string Title { get; set; } = "TC History";
|
||||
|
||||
public class TcFilt
|
||||
{
|
||||
public string SearchVal { get; set; } = "";
|
||||
public string Azienda { get; set; } = "*";
|
||||
}
|
||||
|
||||
protected int MaxRec { get; set; } = 100000;
|
||||
protected int Num2Displ { get; set; } = 10;
|
||||
protected int TotalCount { get; set; } = 0;
|
||||
|
||||
|
||||
|
||||
protected List<AnagArticoli>? ListArticoli { get; set; } = null;
|
||||
protected TcFilt CurrFilt { get; set; } = new TcFilt();
|
||||
|
||||
protected void LoadMore()
|
||||
{
|
||||
ListArticoli = null;
|
||||
// await Task.Delay(1);
|
||||
Num2Displ += 10;
|
||||
Num2Displ = Num2Displ < TotalCount ? Num2Displ : TotalCount;
|
||||
ListArticoli = ListArticoliAll.Take(Num2Displ).ToList();
|
||||
}
|
||||
|
||||
|
||||
protected async Task ReloadAllData()
|
||||
{
|
||||
TotalCount = ListArticoliAll.Count;
|
||||
ListArticoli = ListArticoliAll.Take(Num2Displ).ToList();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
// await ReloadAllData();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
@* @attribute [RenderModeAuto] *@
|
||||
@attribute [RenderModeServer]
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<MP_TAB.Client.Components.HistTCFilt Title="Storico Tempi Ciclo"></MP_TAB.Client.Components.HistTCFilt>
|
||||
|
||||
|
||||
@* <MP_TAB.Client.Components.HistTCFilt Title="Storico Tempi Ciclo" ListMacchineAll="@ListMacchine" ListArticoliAll="@SearchArticoli" E_FiltUpdated="UpdatedFilt"></MP_TAB.Client.Components.HistTCFilt> *@
|
||||
|
||||
|
||||
@* <div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<h4>Storico Tempi Ciclo</h4>
|
||||
<button class="btn btn-primary" @onclick="LoadMore" title="Show more"><b>+10</b</button>
|
||||
</div>
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<div class="px-1">
|
||||
<div class="input-group" title="Filtro Impianto">
|
||||
<span class="input-group-text"><i class="fa-solid fa-industry"></i></span>
|
||||
<select class="form-select" aria-label="Select Macchina" style="width: 15rem;">
|
||||
<option value="0" selected>-- Selezionare Impianto --</option>
|
||||
@if (ListMacchine == null || ListMacchine.Count == 0)
|
||||
{
|
||||
<b>loading...</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in ListMacchine)
|
||||
{
|
||||
<option value="@item.IdxMacchina">@item.CodMacchina | @item.Descrizione</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-1">
|
||||
<div class="input-group" title="Filtro Articolo">
|
||||
<span class="input-group-text"><i class="fa-solid fa-box"></i></span>
|
||||
<input class="form-control" style="width: 4rem;" placeholder="*" title="Ricerca Articolo" @bind="@SearchVal" />
|
||||
<select class="form-select" aria-label="Select Articolo" style="width: 25rem;">
|
||||
<option value="*" selected>-- Selezionare Articolo --</option>
|
||||
@if (ListArticoli == null || ListArticoli.Count == 0)
|
||||
{
|
||||
<b>loading...</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in ListArticoli)
|
||||
{
|
||||
<option value="@item.CodArticolo">@item.CodArticolo | @item.DescArticolo</option>
|
||||
}
|
||||
<option disabled>...totale @TotalCount rec</option>
|
||||
}
|
||||
</select>
|
||||
<button class="btn btn-primary" @onclick="LoadMore" title="Show more"><b>+10</b</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (ListArticoli != null)
|
||||
{
|
||||
<b>griglia risultati</b>
|
||||
@* <div style="height: 200px;overflow-y:scroll">
|
||||
<Virtualize Items="@ListArticoli" OverscanCount="6" ItemSize="10">
|
||||
<ItemContent>
|
||||
<p>@context.CodArticolo | @context.DescArticolo</p>
|
||||
</ItemContent>
|
||||
<Placeholder>
|
||||
<p>Loading...</p>
|
||||
</Placeholder>
|
||||
<EmptyContent>
|
||||
<p>
|
||||
There are no strings to display.
|
||||
</p>
|
||||
</EmptyContent>
|
||||
</Virtualize>
|
||||
</div> *@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public List<AnagArticoli>? ListArticoli { get; set; }
|
||||
}
|
||||
@@ -1,113 +1,11 @@
|
||||
@page "/tc-history"
|
||||
@inject OprFiltData MDataService
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<h4>Storico Tempi Ciclo</h4>
|
||||
</div>
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<div class="px-1">
|
||||
<div class="input-group" title="Filtro Impianto">
|
||||
<span class="input-group-text"><i class="fa-solid fa-industry"></i></span>
|
||||
<select class="form-select" aria-label="Select Macchina" style="width: 15rem;">
|
||||
<option value="0" selected>-- Selezionare Impianto --</option>
|
||||
@if (ListMacchine == null || ListMacchine.Count == 0)
|
||||
{
|
||||
<b>loading...</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in ListMacchine)
|
||||
{
|
||||
<option value="@item.IdxMacchina">@item.CodMacchina | @item.Descrizione</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-1">
|
||||
<div class="input-group" title="Filtro Articolo">
|
||||
<span class="input-group-text"><i class="fa-solid fa-box"></i></span>
|
||||
<input class="form-control" style="width: 4rem;" placeholder="*" title="Ricerca Articolo" />
|
||||
<select class="form-select" aria-label="Select Articolo" style="width: 25rem;">
|
||||
<option value="*" selected>-- Selezionare Articolo --</option>
|
||||
@if (ListArticoli == null || ListArticoli.Count == 0)
|
||||
{
|
||||
<b>loading...</b>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in ListArticoli)
|
||||
{
|
||||
<option value="@item.CodArticolo">@item.CodArticolo | @item.DescArticolo</option>
|
||||
}
|
||||
<option disabled>...totale @TotalCount rec</option>
|
||||
}
|
||||
</select>
|
||||
<button class="btn btn-primary" @onclick="LoadMore" title="Show more"><b>+10</b</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if (ListArticoli != null)
|
||||
{
|
||||
<b>griglia risultati</b>
|
||||
@* <div style="height: 200px;overflow-y:scroll">
|
||||
<Virtualize Items="@ListArticoli" OverscanCount="6" ItemSize="10">
|
||||
<ItemContent>
|
||||
<p>@context.CodArticolo | @context.DescArticolo</p>
|
||||
</ItemContent>
|
||||
<Placeholder>
|
||||
<p>Loading...</p>
|
||||
</Placeholder>
|
||||
<EmptyContent>
|
||||
<p>
|
||||
There are no strings to display.
|
||||
</p>
|
||||
</EmptyContent>
|
||||
</Virtualize>
|
||||
</div> *@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
/// <summary>
|
||||
/// Matricola operatore corrente (da rendere parametrico con gest operatore)
|
||||
/// </summary>
|
||||
protected int MatrOpr { get; set; } = 102;
|
||||
protected int NumRec { get; set; } = 100000;
|
||||
protected string azienda { get; set; } = "*";
|
||||
protected string searchVal { get; set; } = "";
|
||||
|
||||
protected int num2Displ { get; set; } = 10;
|
||||
|
||||
protected List<Macchine>? ListMacchine { get; set; } = null;
|
||||
protected List<AnagArticoli>? SearchArticoli { get; set; } = null;
|
||||
protected List<AnagArticoli>? ListArticoli { get; set; } = null;
|
||||
<MP_TAB.Client.Pages.TCHistory ListArticoli="@ListArticoli"></MP_TAB.Client.Pages.TCHistory>
|
||||
|
||||
|
||||
protected async override Task OnInitializedAsync()
|
||||
{
|
||||
SearchArticoli = await MDataService.ArticoliGetSearch(NumRec, azienda, searchVal);
|
||||
TotalCount = SearchArticoli.Count;
|
||||
ListArticoli = SearchArticoli.Take(num2Displ).ToList();
|
||||
ListMacchine = await MDataService.MacchineByMatrOper(MatrOpr);
|
||||
}
|
||||
|
||||
protected int TotalCount { get; set; } = 0;
|
||||
|
||||
protected void LoadMore()
|
||||
{
|
||||
ListArticoli = null;
|
||||
// await Task.Delay(1);
|
||||
num2Displ += 10;
|
||||
num2Displ = num2Displ < TotalCount ? num2Displ : TotalCount;
|
||||
ListArticoli = SearchArticoli?.Take(num2Displ).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
using global::System;
|
||||
using global::System.Collections.Generic;
|
||||
using global::System.Linq;
|
||||
using global::System.Threading.Tasks;
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Sections;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using MP.Data.Services;
|
||||
using MP_TAB;
|
||||
using MP_TAB.Components;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace MP_TAB.Components.Pages
|
||||
{
|
||||
public partial class TCHistory
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
protected string azienda { get; set; } = "*";
|
||||
|
||||
protected List<AnagArticoli>? ListArticoli { get; set; } = null;
|
||||
|
||||
protected List<Macchine>? ListMacchine { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Matricola operatore corrente (da rendere parametrico con gest operatore)
|
||||
/// </summary>
|
||||
protected int MatrOpr { get; set; } = 102;
|
||||
|
||||
[Inject]
|
||||
protected OprFiltData MDataService { get; set; } = null!;
|
||||
|
||||
protected int num2Displ { get; set; } = 10;
|
||||
protected int NumRec { get; set; } = 100000;
|
||||
protected List<AnagArticoli>? SearchArticoli { get; set; } = null;
|
||||
protected string SearchVal { get; set; } = "";
|
||||
protected int TotalCount { get; set; } = 0;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void LoadMore()
|
||||
{
|
||||
ListArticoli = null;
|
||||
// await Task.Delay(1);
|
||||
num2Displ += 10;
|
||||
num2Displ = num2Displ < TotalCount ? num2Displ : TotalCount;
|
||||
ListArticoli = SearchArticoli?.Take(num2Displ).ToList();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadAllData();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await ReloadAllData();
|
||||
// return base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
protected async Task ReloadAllData()
|
||||
{
|
||||
await ReloadFiltData();
|
||||
TotalCount = SearchArticoli.Count;
|
||||
ListArticoli = SearchArticoli.Take(num2Displ).ToList();
|
||||
}
|
||||
|
||||
protected async Task ReloadFiltData()
|
||||
{
|
||||
SearchArticoli = await MDataService.ArticoliGetSearch(NumRec, azienda, SearchVal);
|
||||
ListMacchine = await MDataService.MacchineByMatrOper(MatrOpr);
|
||||
}
|
||||
|
||||
protected async void UpdatedFilt()
|
||||
{
|
||||
await ReloadFiltData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user