Aggiunta pagina parameters con componente live.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>6.15.2207.2109</Version>
|
||||
<Version>6.15.2209.1411</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MON MAPO</i>
|
||||
<h4>Versione: 6.15.2207.2109</h4>
|
||||
<h4>Versione: 6.15.2209.1411</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2207.2109
|
||||
6.15.2209.1411
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2207.2109</version>
|
||||
<version>6.15.2209.1411</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -38,13 +38,6 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var currAssembly = typeof(Program).Assembly.GetName();
|
||||
version = currAssembly.Version != null ? currAssembly.Version : new Version();
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
@@ -19,40 +19,32 @@ else
|
||||
<th>
|
||||
@*<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>*@
|
||||
</th>
|
||||
<th>Articolo</th>
|
||||
<th>Data</th>
|
||||
<th>Macchina</th>
|
||||
<th># pz</th>
|
||||
<th>T.Ciclo</th>
|
||||
<th>Inizio</th>
|
||||
<th>Note</th>
|
||||
<th>Richiesta</th>
|
||||
<th>Flusso</th>
|
||||
<th>Valore</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.CodArticolo)">
|
||||
<tr class="@checkSelect(@record.IdxMacchina)">
|
||||
<td>
|
||||
@*<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm"><i class="bi bi-pencil-square"></i></button>*@
|
||||
</td>
|
||||
<td>
|
||||
@record.CodArticolo
|
||||
@record.dtEvento
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxMacchina
|
||||
</td>
|
||||
<td>
|
||||
@record.NumPezzi
|
||||
@record.CodFlux
|
||||
</td>
|
||||
<td>
|
||||
@record.Tcassegnato.ToString("N3")
|
||||
@record.Valore
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.DataInizio</div>
|
||||
</td>
|
||||
<td>@record.Note</td>
|
||||
<td>@record.KeyRichiesta</td>
|
||||
<td>
|
||||
@*@if (ArticoloDelEnabled(record.CodArticolo))
|
||||
{
|
||||
|
||||
@@ -31,14 +31,43 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string checkSelect(string CodArticolo)
|
||||
public void Dispose()
|
||||
{
|
||||
//aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1);
|
||||
//await InvokeAsync(() => StateHasChanged());
|
||||
await InvokeAsync(() => reloadData());
|
||||
});
|
||||
pUpd.Wait();
|
||||
//Log.Trace($"Elapsed Timer Footer");
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
int tOutPeriod = 2000;
|
||||
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
|
||||
aTimer = new System.Timers.Timer(tOutPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
public string checkSelect(string IdxMacchina)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : "";
|
||||
answ = (currRecord.IdxMacchina == IdxMacchina) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -58,7 +87,7 @@ namespace MP.SPEC.Components
|
||||
|
||||
[Inject]
|
||||
protected MessageService MessageService { get; set; } = null!;
|
||||
|
||||
private static System.Timers.Timer aTimer = null!;
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -67,6 +96,7 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
StartTimer();
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
@@ -91,13 +121,17 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Private Fields
|
||||
|
||||
|
||||
|
||||
private string _statoSel = "*";
|
||||
|
||||
private ODLModel? currRecord = null;
|
||||
private FluxLog? currRecord = null;
|
||||
|
||||
private List<ODLModel>? ListRecords;
|
||||
private List<FluxLog>? ListRecords;
|
||||
|
||||
private List<ODLModel>? SearchRecords;
|
||||
private List<FluxLog>? SearchRecords;
|
||||
|
||||
private List<FluxLog>? a;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -140,7 +174,7 @@ namespace MP.SPEC.Components
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListODLFilt(true, SearchVal, selStato);
|
||||
SearchRecords = await MDService.FluxLogGetLastFilt(SearchVal, selStato, 300);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
@*</div>*@
|
||||
</div>
|
||||
<div class="px-2">
|
||||
*<select @bind="@selStato" class="form-select">
|
||||
<select @bind="@selStato" class="form-select">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@if (ListStati != null)
|
||||
@if (ListMacchine != null)
|
||||
{
|
||||
foreach (var item in ListStati)
|
||||
foreach (var item in ListMacchine)
|
||||
{
|
||||
<option value="@item.value">@item.label</option>
|
||||
<option value="@item.IdxMacchina">@item.IdxMacchina</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
@@ -148,30 +148,9 @@
|
||||
<div class="card-body">
|
||||
<ListPARAMS ></ListPARAMS>
|
||||
</div>
|
||||
@*<div class="card-footer py-1">
|
||||
<div class="card-footer py-1">
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
I parametri sono nella tabella FluxLog (in preparazione modello dati + metodi...) --> FluxLogGetLastFilt
|
||||
</li>
|
||||
<li>
|
||||
scopo della apgina è mostrare in "quasi tempo reale" (near realtime) i parametri che si aggiornano
|
||||
</li>
|
||||
<li>
|
||||
la pagina deve avere un card come PODL nel cui header siano mostrate elenco amchcine ed elenco parametri x mostrare tutti / solo uno (filtro)
|
||||
</li>
|
||||
<li>
|
||||
MpDataService --> metodi per elenchi: MacchineGetAll e ParametriGetAll
|
||||
</li>
|
||||
<li>
|
||||
il metodo principale recupera gli ultimi n record (configurabile? mostrare in alto un selettore x indicare quanti "last values" recuperare?)
|
||||
</li>
|
||||
<li>
|
||||
il refgresh idealmente è ogni 2-5 sec (configurabile come sopra?)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace MP.SPEC.Pages
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
|
||||
|
||||
protected void ForceReload(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
@@ -84,15 +86,17 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
{
|
||||
// abilito ricerca...
|
||||
MsgService.ShowSearch = true;
|
||||
// resetto search
|
||||
MsgService.SearchVal = "";
|
||||
ListAziende = await MDService.ElencoAziende();
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
ListMacchine = await MDService.MacchineGetAll();
|
||||
// carico dati
|
||||
await reloadData();
|
||||
|
||||
}
|
||||
|
||||
private string currAzienda { get; set; } = "*";
|
||||
@@ -105,10 +109,14 @@ namespace MP.SPEC.Pages
|
||||
|
||||
private List<MP.Data.DatabaseModels.ListValues>? ListStati;
|
||||
|
||||
private List<MP.Data.DatabaseModels.Macchine>? ListMacchine;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => MsgService.currPage;
|
||||
@@ -147,15 +155,9 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
#endif
|
||||
|
||||
//private bool showODL { get; set; } = false;
|
||||
|
||||
private bool addEnabled = false;
|
||||
|
||||
//private string textToggle
|
||||
//{
|
||||
// get => showODL ? "In Corso" : "Programmati";
|
||||
//}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => MsgService.totalCount;
|
||||
@@ -173,19 +175,6 @@ namespace MP.SPEC.Pages
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
//private async Task toggleCurrent()
|
||||
//{
|
||||
// //NavManager.NavigateTo("/PODL");
|
||||
// showODL = !showODL;
|
||||
// await Task.Delay(1);
|
||||
//}
|
||||
private async Task navToPODL()
|
||||
{
|
||||
NavManager.NavigateTo("/PODL");
|
||||
//showODL = !showODL;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user