From 5fdd74ae9a28a185e6c9b75b95eeaab0dbc9561a Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 14 Sep 2022 10:13:51 +0200 Subject: [PATCH 1/4] Inizio page params --- MP.SPEC/Components/ListPARAMS.razor | 70 +++++++++ MP.SPEC/Components/ListPARAMS.razor.cs | 153 ++++++++++++++++++++ MP.SPEC/Pages/PARAMS.razor | 171 +++++++++++++++++++--- MP.SPEC/Pages/PARAMS.razor.cs | 191 +++++++++++++++++++++++++ 4 files changed, 564 insertions(+), 21 deletions(-) create mode 100644 MP.SPEC/Components/ListPARAMS.razor create mode 100644 MP.SPEC/Components/ListPARAMS.razor.cs create mode 100644 MP.SPEC/Pages/PARAMS.razor.cs diff --git a/MP.SPEC/Components/ListPARAMS.razor b/MP.SPEC/Components/ListPARAMS.razor new file mode 100644 index 00000000..34bc1b21 --- /dev/null +++ b/MP.SPEC/Components/ListPARAMS.razor @@ -0,0 +1,70 @@ +@using MP.SPEC.Components +@using MP.SPEC.Data + +@if (ListRecords == null) +{ + +} +else if (totalCount == 0) +{ +
Nessun record trovato
+} +else +{ +
+
+ + + + + + + + + + + + + + + + @foreach (var record in ListRecords) + { + + + + + + + + + + + + } + +
+ @**@ + ArticoloMacchina# pzT.CicloInizioNoteRichiesta
+ @**@ + + @record.CodArticolo + + @record.IdxMacchina + + @record.NumPezzi + + @record.Tcassegnato.ToString("N3") + +
@record.DataInizio
+
@record.Note@record.KeyRichiesta + @*@if (ArticoloDelEnabled(record.CodArticolo)) + { + + }*@ +
+
+
+} + + diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs new file mode 100644 index 00000000..e0353136 --- /dev/null +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -0,0 +1,153 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using MP.Data.DatabaseModels; +using MP.SPEC.Data; + +namespace MP.SPEC.Components +{ + public partial class ListPARAMS + { + #region Public Properties + + [Parameter] + public EventCallback PagerResetReq { get; set; } + + [Parameter] + public string selStato + { + get => _statoSel; + set + { + if (_statoSel != value) + { + _statoSel = value; + var pUpd = Task.Run(async () => await reloadData()); + pUpd.Wait(); + } + } + } + + #endregion Public Properties + + #region Public Methods + + public string checkSelect(string CodArticolo) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + + #endregion Public Methods + + #region Protected Properties + + [Inject] + protected IJSRuntime JSRuntime { get; set; } = null!; + + [Inject] + protected MpDataService MDService { get; set; } = null!; + + [Inject] + protected MessageService MessageService { get; set; } = null!; + + #endregion Protected Properties + + #region Protected Methods + + protected override async Task OnInitializedAsync() + { + MessageService.EA_PageUpdated += MessageService_EA_PageUpdated; + MessageService.EA_SearchUpdated += OnSeachUpdated; + await reloadData(); + } + + protected async void OnSeachUpdated() + { + await InvokeAsync(() => + { + PagerResetReq.InvokeAsync(true); + //currPage = 1; + Task task = UpdateData(); + StateHasChanged(); + }); + } + + protected async Task UpdateData() + { + currRecord = null; + await reloadData(); + } + + #endregion Protected Methods + + #region Private Fields + + private string _statoSel = "*"; + + private ODLModel? currRecord = null; + + private List? ListRecords; + + private List? SearchRecords; + + #endregion Private Fields + + #region Private Properties + + private int currPage + { + get => MessageService.currPage; + set => MessageService.currPage = value; + } + + private bool isLoading { get; set; } = false; + + private int numRecord + { + get => MessageService.numRecord; + set => MessageService.numRecord = value; + } + + private string SearchVal + { + get => string.IsNullOrEmpty(MessageService.SearchVal) ? "*" : MessageService.SearchVal; + } + + private int totalCount + { + get => MessageService.totalCount; + set => MessageService.totalCount = value; + } + + #endregion Private Properties + + #region Private Methods + + private async void MessageService_EA_PageUpdated() + { + await reloadData(); + } + + private async Task reloadData() + { + isLoading = true; + SearchRecords = await MDService.ListODLFilt(true, SearchVal, selStato); + totalCount = SearchRecords.Count; + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + await Task.Delay(1); + await InvokeAsync(() => StateHasChanged()); + isLoading = false; + } + + #endregion Private Methods + } +} diff --git a/MP.SPEC/Pages/PARAMS.razor b/MP.SPEC/Pages/PARAMS.razor index dff9f790..995e1101 100644 --- a/MP.SPEC/Pages/PARAMS.razor +++ b/MP.SPEC/Pages/PARAMS.razor @@ -1,28 +1,157 @@ @page "/PARAMS" +
+
+
+
+
+
+

PARAMETERS

+
+
+ @**@ +
+
+
+
+
+
+
+
+
+ @*
*@ + @**@ + @**@ + @*
*@ +
+
+ * +
+
+
+
-

PARAMS

+ @*@if (reqNew) + { +
+
+
+ Azienda + + Art Search + +
+
+
+
+
+
+ Articolo + +
+
+
+ } + else if (currRecordOdl != null) + { +
+
+
+
Modifica ODL
+
*@ + @*
+
+
+ Codice + +
+
+
+
+ Disegno + +
+
+
+
+ +
+
+
+
+ -

Appunti (eliminabili)

+
+
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+
*@ + @*
+
+
+
*@ +
+
+ +
+ @**@ +
-
    -
  • - I parametri sono nella tabella FluxLog (in preparazione modello dati + metodi...) -
  • -
  • - scopo della apgina è mostrare in "quasi tempo reale" (near realtime) i parametri che si aggiornano -
  • -
  • - la pagina deve avere un card come PODL nel cui header siano mostrate elenco amchcine ed elenco parametri x mostrare tutti / solo uno (filtro) -
  • -
  • - il metodo principale recupera gli ultimi n record (configurabile? mostrare in alto un selettore x indicare quanti "last values" recuperare?) -
  • -
  • - il refgresh idealmente è ogni 2-5 sec (configurabile come sopra?) -
  • -
-@code { -} diff --git a/MP.SPEC/Pages/PARAMS.razor.cs b/MP.SPEC/Pages/PARAMS.razor.cs new file mode 100644 index 00000000..4f47569c --- /dev/null +++ b/MP.SPEC/Pages/PARAMS.razor.cs @@ -0,0 +1,191 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using MP.SPEC.Components; +using MP.SPEC.Data; + +namespace MP.SPEC.Pages +{ + public partial class PARAMS + { + #region Protected Properties + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected MpDataService MDService { get; set; } + + [Inject] + protected MessageService MsgService { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + #endregion Protected Properties + + #region Protected Methods + + protected void ForceReload(int newNum) + { + numRecord = newNum; + } + + protected void ForceReloadPage(int newNum) + { + currPage = newNum; + } + + protected async Task pgResetReq(bool doReset) + { + if (doReset) + { + await pagerODL.resetCurrPage(); + } + } + + + private MP.Data.DatabaseModels.ODLModel? currRecordOdl = null; + private MP.Data.DatabaseModels.PODLModel? currRecordPOdl = null; + + /// + /// Crea nuovo record e va in editing... + /// + /// + protected async Task addNew() + { + currRecordPOdl = new MP.Data.DatabaseModels.PODLModel() + { + CodArticolo = $"_NEW_{DateTime.Now:yyyyMMdd.HHmmss}" + }; + await Task.Delay(1); + } + + protected async Task cancel() + { + currRecordOdl = null; + currRecordPOdl = null; + await reloadData(); + await Task.Delay(1); + } + + protected DataPager pagerODL; + + protected bool reqNew = false; + + + /// + /// Crea nuovo record e va in editing... + /// + /// + protected async Task reqNewPODL() + { + reqNew = !reqNew; + await Task.Delay(1); + } + + protected override async Task OnInitializedAsync() + { + // abilito ricerca... + MsgService.ShowSearch = true; + // resetto search + MsgService.SearchVal = ""; + ListAziende = await MDService.ElencoAziende(); + ListStati = await MDService.AnagStatiComm(); + // carico dati + await reloadData(); + } + + private string currAzienda { get; set; } = "*"; + + private List? ListAziende; + + #endregion Protected Methods + + #region Private Fields + + private List? ListStati; + + #endregion Private Fields + + #region Private Properties + + private int currPage + { + get => MsgService.currPage; + set => MsgService.currPage = value; + } + + private bool isLoading { get; set; } = false; + + private int numRecord + { + get => MsgService.numRecord; + set => MsgService.numRecord = value; + } + + private string selStato { get; set; } = "*"; +#if false + private string selStato + { + get => _selStato; + set + { + if (!_selStato.Equals(value)) + { + _selStato = value; + addEnabled = selStato != "*"; + ////StateHasChanged(); + //var pUpd = Task.Run(async () => + //{ + // //await reloadData(); + // await Task.Delay(1); + // await InvokeAsync(() => StateHasChanged()); + //}); + //pUpd.Wait(); + } + } + } +#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; + set => MsgService.totalCount = value; + } + + #endregion Private Properties + + #region Private Methods + + private async Task reloadData() + { + isLoading = true; + await Task.Delay(1); + 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 + } +} From f44838d235a52f29384e8b52eda8f993295dc71a Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 14 Sep 2022 12:18:36 +0200 Subject: [PATCH 2/4] Aggiunta pagina parameters con componente live. --- MP.Mon/MP.Mon.csproj | 2 +- MP.Mon/Resources/ChangeLog.html | 2 +- MP.Mon/Resources/VersNum.txt | 2 +- MP.Mon/Resources/manifest.xml | 2 +- MP.SPEC/Components/CmpFooter.razor.cs | 7 ---- MP.SPEC/Components/ListPARAMS.razor | 22 ++++-------- MP.SPEC/Components/ListPARAMS.razor.cs | 48 ++++++++++++++++++++++---- MP.SPEC/Pages/PARAMS.razor | 33 ++++-------------- MP.SPEC/Pages/PARAMS.razor.cs | 29 +++++----------- 9 files changed, 67 insertions(+), 80 deletions(-) diff --git a/MP.Mon/MP.Mon.csproj b/MP.Mon/MP.Mon.csproj index eb878fcf..c780a273 100644 --- a/MP.Mon/MP.Mon.csproj +++ b/MP.Mon/MP.Mon.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 6.15.2207.2109 + 6.15.2209.1411 diff --git a/MP.Mon/Resources/ChangeLog.html b/MP.Mon/Resources/ChangeLog.html index 0df402d4..b334d059 100644 --- a/MP.Mon/Resources/ChangeLog.html +++ b/MP.Mon/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MON MAPO -

Versione: 6.15.2207.2109

+

Versione: 6.15.2209.1411


Note di rilascio:
  • diff --git a/MP.Mon/Resources/VersNum.txt b/MP.Mon/Resources/VersNum.txt index 787e6afc..c9f07ebe 100644 --- a/MP.Mon/Resources/VersNum.txt +++ b/MP.Mon/Resources/VersNum.txt @@ -1 +1 @@ -6.15.2207.2109 +6.15.2209.1411 diff --git a/MP.Mon/Resources/manifest.xml b/MP.Mon/Resources/manifest.xml index a7d53eb8..79d28715 100644 --- a/MP.Mon/Resources/manifest.xml +++ b/MP.Mon/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.15.2207.2109 + 6.15.2209.1411 https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html false diff --git a/MP.SPEC/Components/CmpFooter.razor.cs b/MP.SPEC/Components/CmpFooter.razor.cs index 293e02d7..56efcd29 100644 --- a/MP.SPEC/Components/CmpFooter.razor.cs +++ b/MP.SPEC/Components/CmpFooter.razor.cs @@ -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 diff --git a/MP.SPEC/Components/ListPARAMS.razor b/MP.SPEC/Components/ListPARAMS.razor index 34bc1b21..0902540c 100644 --- a/MP.SPEC/Components/ListPARAMS.razor +++ b/MP.SPEC/Components/ListPARAMS.razor @@ -19,40 +19,32 @@ else @**@ - Articolo + Data Macchina - # pz - T.Ciclo - Inizio - Note - Richiesta + Flusso + Valore @foreach (var record in ListRecords) { - + @**@ - @record.CodArticolo + @record.dtEvento @record.IdxMacchina - @record.NumPezzi + @record.CodFlux - @record.Tcassegnato.ToString("N3") + @record.Valore - -
    @record.DataInizio
    - - @record.Note - @record.KeyRichiesta @*@if (ArticoloDelEnabled(record.CodArticolo)) { diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index e0353136..1b11848e 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -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? ListRecords; + private List? ListRecords; - private List? SearchRecords; + private List? SearchRecords; + + private List? 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); diff --git a/MP.SPEC/Pages/PARAMS.razor b/MP.SPEC/Pages/PARAMS.razor index 8360b1c0..e5fc1f46 100644 --- a/MP.SPEC/Pages/PARAMS.razor +++ b/MP.SPEC/Pages/PARAMS.razor @@ -25,13 +25,13 @@ @**@
    - * - @if (ListStati != null) + @if (ListMacchine != null) { - foreach (var item in ListStati) + foreach (var item in ListMacchine) { - + } } @@ -148,30 +148,9 @@
    - @*
    -
      -
    • - I parametri sono nella tabella FluxLog (in preparazione modello dati + metodi...) --> FluxLogGetLastFilt -
    • -
    • - scopo della apgina è mostrare in "quasi tempo reale" (near realtime) i parametri che si aggiornano -
    • -
    • - la pagina deve avere un card come PODL nel cui header siano mostrate elenco amchcine ed elenco parametri x mostrare tutti / solo uno (filtro) -
    • -
    • - MpDataService --> metodi per elenchi: MacchineGetAll e ParametriGetAll -
    • -
    • - il metodo principale recupera gli ultimi n record (configurabile? mostrare in alto un selettore x indicare quanti "last values" recuperare?) -
    • -
    • - il refgresh idealmente è ogni 2-5 sec (configurabile come sopra?) -
    • -
    - diff --git a/MP.SPEC/Pages/PARAMS.razor.cs b/MP.SPEC/Pages/PARAMS.razor.cs index 4f47569c..10a1a219 100644 --- a/MP.SPEC/Pages/PARAMS.razor.cs +++ b/MP.SPEC/Pages/PARAMS.razor.cs @@ -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? ListStati; + private List? 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 } } From bae58ec4bbc6018e04e730160f3e85e6aa93dd96 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 14 Sep 2022 14:34:30 +0200 Subject: [PATCH 3/4] modifiche per grafica pagina PARAMS --- MP.SPEC/Components/ListPARAMS.razor | 8 +++--- MP.SPEC/Components/ListPARAMS.razor.cs | 2 -- MP.SPEC/Pages/PARAMS.razor | 37 +++++++++++++------------- MP.SPEC/Pages/PARAMS.razor.cs | 20 +++++++++++--- 4 files changed, 38 insertions(+), 29 deletions(-) diff --git a/MP.SPEC/Components/ListPARAMS.razor b/MP.SPEC/Components/ListPARAMS.razor index 0902540c..abd14f91 100644 --- a/MP.SPEC/Components/ListPARAMS.razor +++ b/MP.SPEC/Components/ListPARAMS.razor @@ -13,7 +13,7 @@ else {
    - +
    - + @@ -42,8 +42,8 @@ else -
    @@ -22,7 +22,7 @@ else Data Macchina FlussoValoreValore
    @record.CodFlux - @record.Valore + + @record.Valore @*@if (ArticoloDelEnabled(record.CodArticolo)) diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index 1b11848e..01b1fdf3 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -131,8 +131,6 @@ namespace MP.SPEC.Components private List? SearchRecords; - private List? a; - #endregion Private Fields #region Private Properties diff --git a/MP.SPEC/Pages/PARAMS.razor b/MP.SPEC/Pages/PARAMS.razor index e5fc1f46..47d947fb 100644 --- a/MP.SPEC/Pages/PARAMS.razor +++ b/MP.SPEC/Pages/PARAMS.razor @@ -4,10 +4,14 @@
    -
    +
    -

    PARAMETERS

    +

    PARAMETERS

    +
    @**@
    @@ -25,7 +29,7 @@ @*
    *@
    - @if (ListMacchine != null) { @@ -36,30 +40,25 @@ }
    -
    -
    -
    - - @*@if (reqNew) - { -
    -
    -
    - Azienda - + + @if (ListFlux != null) { - foreach (var item in ListAziende.Where(x => x.CodGruppo != "*").ToList()) + foreach (var item in ListFlux) { - + } } - Art Search -
    +
    + @*@if (reqNew) + { + +
    diff --git a/MP.SPEC/Pages/PARAMS.razor.cs b/MP.SPEC/Pages/PARAMS.razor.cs index 10a1a219..da9a2b44 100644 --- a/MP.SPEC/Pages/PARAMS.razor.cs +++ b/MP.SPEC/Pages/PARAMS.razor.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; +using MP.Data.DatabaseModels; using MP.SPEC.Components; using MP.SPEC.Data; @@ -91,15 +92,16 @@ namespace MP.SPEC.Pages MsgService.ShowSearch = true; // resetto search MsgService.SearchVal = ""; - ListAziende = await MDService.ElencoAziende(); - ListStati = await MDService.AnagStatiComm(); + //ListAziende = await MDService.ElencoAziende(); + //ListStati = await MDService.AnagStatiComm(); ListMacchine = await MDService.MacchineGetAll(); + ListFlux = await MDService.ParametriGetFilt(selMacchina); // carico dati await reloadData(); } - private string currAzienda { get; set; } = "*"; + private string currMacchina { get; set; } = "*"; private List? ListAziende; @@ -111,6 +113,8 @@ namespace MP.SPEC.Pages private List? ListMacchine; + private List? ListFlux; + #endregion Private Fields #region Private Properties @@ -131,7 +135,7 @@ namespace MP.SPEC.Pages set => MsgService.numRecord = value; } - private string selStato { get; set; } = "*"; + private string selMacchina { get; set; } = "*"; #if false private string selStato { @@ -172,6 +176,14 @@ namespace MP.SPEC.Pages { isLoading = true; await Task.Delay(1); + if (currMacchina != "*") + { + ListFlux = await MDService.ParametriGetFilt(selMacchina); + } + else + { + ListFlux = new List(); + } isLoading = false; } From 7abd135f301bba0b67b9d6c15a3c1b1ad2f47109 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 14 Sep 2022 16:53:46 +0200 Subject: [PATCH 4/4] Modifiche page params aggiunta msgservice per selezione macchina --- MP.SPEC/Components/ListPARAMS.razor.cs | 47 +++--------- MP.SPEC/Components/SearchMod.razor | 2 +- MP.SPEC/Data/MessageService.cs | 16 +++++ MP.SPEC/Pages/PARAMS.razor | 96 +------------------------ MP.SPEC/Pages/PARAMS.razor.cs | 98 +++++++++++++++----------- MP.SPEC/Pages/PODL.razor.cs | 10 +-- 6 files changed, 90 insertions(+), 179 deletions(-) diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index 01b1fdf3..1813e0b2 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -13,14 +13,14 @@ namespace MP.SPEC.Components public EventCallback PagerResetReq { get; set; } [Parameter] - public string selStato + public string SelMacchina { - get => _statoSel; + get => _statoMacchina; set { - if (_statoSel != value) + if (_statoMacchina != value) { - _statoSel = value; + _statoMacchina = value; var pUpd = Task.Run(async () => await reloadData()); pUpd.Wait(); } @@ -31,34 +31,7 @@ namespace MP.SPEC.Components #region Public Methods - 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) { @@ -87,7 +60,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 @@ -96,7 +69,7 @@ namespace MP.SPEC.Components { MessageService.EA_PageUpdated += MessageService_EA_PageUpdated; MessageService.EA_SearchUpdated += OnSeachUpdated; - StartTimer(); + await reloadData(); } @@ -123,7 +96,7 @@ namespace MP.SPEC.Components - private string _statoSel = "*"; + private string _statoMacchina = "*"; private FluxLog? currRecord = null; @@ -169,10 +142,10 @@ namespace MP.SPEC.Components await reloadData(); } - private async Task reloadData() + public async Task reloadData() { isLoading = true; - SearchRecords = await MDService.FluxLogGetLastFilt(SearchVal, selStato, 300); + SearchRecords = await MDService.FluxLogGetLastFilt(SelMacchina, "*", 300); totalCount = SearchRecords.Count; ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); diff --git a/MP.SPEC/Components/SearchMod.razor b/MP.SPEC/Components/SearchMod.razor index 4081aec0..9b4a379e 100644 --- a/MP.SPEC/Components/SearchMod.razor +++ b/MP.SPEC/Components/SearchMod.razor @@ -3,7 +3,7 @@ @inject MessageService AppMService -
    + diff --git a/MP.SPEC/Data/MessageService.cs b/MP.SPEC/Data/MessageService.cs index 79ca19ff..f734d170 100644 --- a/MP.SPEC/Data/MessageService.cs +++ b/MP.SPEC/Data/MessageService.cs @@ -8,6 +8,8 @@ public event Action EA_SearchUpdated; + public event Action EA_MacchUpdated; + public event Action EA_ShowSearch; public event Action EA_StatoSearch; @@ -64,6 +66,20 @@ //} } } + private string _selMacchina { get; set; } = "*"; + public string SelMacchina + { + get => _selMacchina; + set + { + _selMacchina = value; + + if (EA_MacchUpdated != null) + { + EA_MacchUpdated?.Invoke(); + } + } + } public bool ShowSearch { diff --git a/MP.SPEC/Pages/PARAMS.razor b/MP.SPEC/Pages/PARAMS.razor index 47d947fb..bd3106ef 100644 --- a/MP.SPEC/Pages/PARAMS.razor +++ b/MP.SPEC/Pages/PARAMS.razor @@ -13,7 +13,6 @@ Valori live
    - @**@
    @@ -23,10 +22,6 @@
    - @*
    *@ - @**@ - @**@ - @*
    *@
    - @if (ListFlux != null) { @@ -55,97 +50,10 @@
    - @*@if (reqNew) - { - -
    -
    -
    -
    - Articolo - -
    -
    -
    - } - else if (currRecordOdl != null) - { -
    -
    -
    -
    Modifica ODL
    -
    *@ - @*
    -
    -
    - Codice - -
    -
    -
    -
    - Disegno - -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    *@ - @*
    -
    -
    *@
    - +