From e565bb06bb8cd62ab3cc7938c6b8f7aebbb32f57 Mon Sep 17 00:00:00 2001 From: "marco.salvi" Date: Fri, 4 Feb 2022 18:10:57 +0100 Subject: [PATCH] Aggiornamento pagina ticket con visualizzazione laterale file allegati --- LiMan.UI/Components/ListAttach.razor | 8 +- LiMan.UI/Components/ListAttach.razor.cs | 37 +++- LiMan.UI/Components/Tickets.razor | 251 +++++++++++------------- LiMan.UI/Components/Tickets.razor.cs | 17 +- LiMan.UI/Data/LiManDataService.cs | 19 ++ LiMan.UI/LiMan.UI.csproj | 2 +- LiMan.UI/Resources/ChangeLog.html | 2 +- LiMan.UI/Resources/VersNum.txt | 2 +- LiMan.UI/Resources/manifest.xml | 2 +- 9 files changed, 182 insertions(+), 158 deletions(-) diff --git a/LiMan.UI/Components/ListAttach.razor b/LiMan.UI/Components/ListAttach.razor index cfe5da2..36dc28a 100644 --- a/LiMan.UI/Components/ListAttach.razor +++ b/LiMan.UI/Components/ListAttach.razor @@ -6,9 +6,9 @@

File Allegati

-
+ @*
-
+
*@
@@ -26,9 +26,9 @@ - + *@ diff --git a/LiMan.UI/Components/ListAttach.razor.cs b/LiMan.UI/Components/ListAttach.razor.cs index 5705a1a..abf22e1 100644 --- a/LiMan.UI/Components/ListAttach.razor.cs +++ b/LiMan.UI/Components/ListAttach.razor.cs @@ -14,7 +14,42 @@ namespace LiMan.UI.Components { public partial class ListAttach { - private List files; + private List ListRecords; protected int totalCount = 0; + + //protected override async Task OnInitializedAsync() + //{ + // await ReloadAllData(); + //} + + private bool isLoading { get; set; } = false; + + [Inject] + private IJSRuntime JSRuntime { get; set; } + + [Inject] + protected LiManDataService DataService { get; set; } + + + [Parameter] + public EventCallback DataReset { get; set; } + + private async Task fullReload() + { + await DataService.InvalidateAllCache(); + await ReloadAllData(); + } + + private async Task ReloadAllData() + { + //isLoading = true; + //ListActivations = null; + //idxTicketSel = 0; + await Task.Delay(1); + //bool StatoRichiesta = true; + ListRecords = await DataService.FileGetFilt(5); + totalCount = ListRecords.Count(); + //isLoading = false; + } } } \ No newline at end of file diff --git a/LiMan.UI/Components/Tickets.razor b/LiMan.UI/Components/Tickets.razor index dff4f9b..6e071a9 100644 --- a/LiMan.UI/Components/Tickets.razor +++ b/LiMan.UI/Components/Tickets.razor @@ -1,12 +1,13 @@ @using LiMan.UI.Components - +
+

Tickets

- +
- + @if (ListRecords == null) { @@ -18,145 +19,115 @@ else { -
+ @* - # OriginalName FullStoragePath
- - - - - - - - - - - @foreach (var record in ListRecords) - { +
- - #RichiedenteContatti - Descrizione -
+ - - - - - + + + + + - } - -
- - - @record.IdxTicket
- @record.Status -
-
@record.ContactName
-
@record.DtReq
-
-
@record.ContactEmail
-
@record.ContactPhone
-
- @record.ReqBody - + + #RichiedenteContatti + Descrizione +
- } - @if (idxTicketSel > 0) - { -
-
-
- @if (StatusSel != DB.Enum.StatoRichiesta.Richiesta) - { - - } -
-
- @if (StatusSel != DB.Enum.StatoRichiesta.Valutazione) - { - - } -
-
- @if (StatusSel != DB.Enum.StatoRichiesta.Approvata) - { - - } -
-
- @if (StatusSel != DB.Enum.StatoRichiesta.Rifiutata) - { - - } -
-
- @if (ListActivations != null && ListActivations.Count > 0) - { - - - - - - - - - - - - - @foreach (var record in ListActivations) - { - - - - - - - - - } - -
- - #Impiego - Chiave   - @if (showKey) - { - - } - else - { - - } - Scadenza Veto
- - - @record.IdxSubLic - - @record.CodImpiego - - @if (showKey) - { - @decryptAuthKey(record.Chiave) - } - else - { - @record.Chiave - } - - @($"{record.VetoUnlock:yyyy.MM.dd}") - - @if (record.Locked) - { - - } - else - { - - } -
- } -
+ + + @foreach (var record in ListRecords) + { + + + + + + @record.IdxTicket
+ @record.Status + + +
@record.ContactName
+
@record.DtReq
+ + +
@record.ContactEmail
+
@record.ContactPhone
+ + + @record.ReqBody + + + } + + + } +
+ + +
+ @if (idxTicketSel > 0) + { +
+ + + + + + @**@ + + + + @foreach (var record in FileAttached) + { + + + @**@ + + } + +
Nome FileOriginalNameFullStoragePath
+ @record.OriginalName
+ +
+
@record.FullStoragePath
+
+
+ } + +
+ + + +@*
+ @if (idxTicketSel > 0) + { +
+ + + + + + @* + + + + @foreach (var record in FileAttached) + { + + + @* + + } + +
#OriginalNameFullStoragePath
+ @record.OriginalName
+ +
+
@record.FullStoragePath
+
+
+ } +
+*@ \ No newline at end of file diff --git a/LiMan.UI/Components/Tickets.razor.cs b/LiMan.UI/Components/Tickets.razor.cs index 21621bd..830324b 100644 --- a/LiMan.UI/Components/Tickets.razor.cs +++ b/LiMan.UI/Components/Tickets.razor.cs @@ -20,6 +20,8 @@ namespace LiMan.UI.Components private List ListRecords; protected int totalCount = 0; + private List FileAttached; + #endregion Private Fields #region Protected Fields @@ -110,6 +112,7 @@ namespace LiMan.UI.Components await Task.Delay(1); //bool StatoRichiesta = true; ListRecords = await DataService.TicketsGetAll(); + totalCount = ListRecords.Count(); isLoading = false; } @@ -118,11 +121,6 @@ namespace LiMan.UI.Components #region Protected Methods - protected async void close() - { - await DataUpdated.InvokeAsync(0); - } - protected async void closeDet() { await ReloadAllData(); @@ -161,16 +159,17 @@ namespace LiMan.UI.Components showKey = !showKey; } - protected void showDet(TicketDTO currTicket) + protected async Task showDet(TicketDTO currTicket) { // salvo ticket sel idxTicketSel = currTicket.IdxTicket; StatusSel = currTicket.Status; + FileAttached = await DataService.FileGetFilt(idxTicketSel); // mostro SOLO le attivazioni di cui ho ticket attivi... //ListActivations = MasterLicence - //.Attivazioni - //.Where(a => a.IdxSubLic == currTicket.IdxSubLic) - //.ToList(); + //.Attivazioni + //.Where(a => a.IdxSubLic == currTicket.IdxSubLic) + //.ToList(); } protected async Task UnLock(SubLicenzaModel selRecord) diff --git a/LiMan.UI/Data/LiManDataService.cs b/LiMan.UI/Data/LiManDataService.cs index 5001076..5e7e1b5 100644 --- a/LiMan.UI/Data/LiManDataService.cs +++ b/LiMan.UI/Data/LiManDataService.cs @@ -12,6 +12,7 @@ using System.Text; using System.Threading.Tasks; using static LiMan.DB.Enum; using Microsoft.AspNetCore.Identity.UI.Services; +using LiMan.DB.DBModels; namespace LiMan.UI.Data { @@ -538,6 +539,24 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } + /// + /// Elenco file registrati dato ticket id + /// + /// Identificativo del ticket + /// + public async Task> FileGetFilt(int idxTicket) + { + List dbResult = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + dbResult = dbControllerNext.FileGetFilt(idxTicket); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB per FileGetFilt: {ts.TotalMilliseconds} ms"); + return await Task.FromResult(dbResult); + + } + public async Task LicenzeNextUpdate(DB.DBModels.LicenzaModel currItem) { bool done = false; diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index 0bf83cb..fe5cca9 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.1.2202.0409 + 1.1.2202.0418 LiMan.UI LiMan.UI diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index d43bdf9..b21b820 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

Versione: 1.1.2202.0409

+

Versione: 1.1.2202.0418


Note di rilascio:
    diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt index 4ed29e8..e568cc5 100644 --- a/LiMan.UI/Resources/VersNum.txt +++ b/LiMan.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2202.0409 +1.1.2202.0418 diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml index 823f8e8..57e5918 100644 --- a/LiMan.UI/Resources/manifest.xml +++ b/LiMan.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2202.0409 + 1.1.2202.0418 https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html false