Aggiornamento pagina ticket con visualizzazione laterale file allegati
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
<div class="col-9">
|
||||
<h3>File Allegati</h3>
|
||||
</div>
|
||||
<div class="col-3 text-right">
|
||||
@*<div class="col-3 text-right">
|
||||
<button class="btn btn-sm btn-success" @onclick="() => AddNew()"><i class="fas fa-plus"></i></button>
|
||||
</div>
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-light p-1">
|
||||
@@ -26,9 +26,9 @@
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@*<th>
|
||||
<button type="button" class="btn btn-sm btn-warning btn-block" @onclick="close"><i class="fas fa-times"></i></button>
|
||||
</th>
|
||||
</th>*@
|
||||
<th>#</th>
|
||||
<th>OriginalName</th>
|
||||
<th>FullStoragePath</th>
|
||||
|
||||
@@ -14,7 +14,42 @@ namespace LiMan.UI.Components
|
||||
{
|
||||
public partial class ListAttach
|
||||
{
|
||||
private List<FileAttachModel> files;
|
||||
private List<FileAttachModel> 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<int> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+111
-140
@@ -1,12 +1,13 @@
|
||||
@using LiMan.UI.Components
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<div class="card">
|
||||
<div class="card-header bg-success py-1 text-light">
|
||||
<h3>Tickets</h3>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-body bg-light p-1">
|
||||
|
||||
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
@@ -18,145 +19,115 @@
|
||||
else
|
||||
{
|
||||
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button type="button" class="btn btn-sm btn-warning btn-block" @onclick="close"><i class="fas fa-times"></i></button>
|
||||
</th>
|
||||
<th>#</th>
|
||||
<th>Richiedente</th>
|
||||
<th>Contatti</th>
|
||||
<th>
|
||||
Descrizione
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-primary" @onclick="() => showDet(record)"><i class="fas fa-search"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxTicket<br />
|
||||
@record.Status
|
||||
</td>
|
||||
<td>
|
||||
<div><b>@record.ContactName</b></div>
|
||||
<div>@record.DtReq</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.ContactEmail</div>
|
||||
<div>@record.ContactPhone</div>
|
||||
</td>
|
||||
<td>
|
||||
@record.ReqBody
|
||||
</td>
|
||||
<th>
|
||||
<button type="button" class="btn btn-sm btn-warning btn-block" @onclick="() => ReloadAllData()"><i class="fas fa-times"></i></button>
|
||||
</th>
|
||||
<th>#</th>
|
||||
<th>Richiedente</th>
|
||||
<th>Contatti</th>
|
||||
<th>
|
||||
Descrizione
|
||||
</th>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
@if (idxTicketSel > 0)
|
||||
{
|
||||
<div class="table-primary p-2">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
@if (StatusSel != DB.Enum.StatoRichiesta.Richiesta)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-info btn-block" @onclick="() => updateStato(DB.Enum.StatoRichiesta.Richiesta)">Attesa Valutazione <i class="fas fa-pause"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
@if (StatusSel != DB.Enum.StatoRichiesta.Valutazione)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-info btn-block" @onclick="() => updateStato(DB.Enum.StatoRichiesta.Valutazione)">Prendi in carico <i class="fas fa-play"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
@if (StatusSel != DB.Enum.StatoRichiesta.Approvata)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-success btn-block" @onclick="() => updateStato(DB.Enum.StatoRichiesta.Approvata)">Approva <i class="fas fa-check"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
@if (StatusSel != DB.Enum.StatoRichiesta.Rifiutata)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-danger btn-block" @onclick="() => updateStato(DB.Enum.StatoRichiesta.Rifiutata)">Rifiuta <i class="fas fa-times"></i></button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (ListActivations != null && ListActivations.Count > 0)
|
||||
{
|
||||
<table class="table table-sm table-striped table-responsive-lg bg-light">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button type="button" class="btn btn-sm btn-dark btn-block" value="Cancel" @onclick="closeDet"><i class="fas fa-times"></i></button>
|
||||
</th>
|
||||
<th>#</th>
|
||||
<th>Impiego</th>
|
||||
<th>
|
||||
Chiave
|
||||
@if (showKey)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-warning" @onclick="() => showDecrypt()"><i class="fas fa-eye-slash"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-success" @onclick="() => showDecrypt()"><i class="fas fa-eye"></i></button>
|
||||
}
|
||||
</th>
|
||||
<th>Scadenza Veto</th>
|
||||
<th class="text-right"><i class="fas fa-user-lock"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListActivations)
|
||||
{
|
||||
<tr class="@checkSelect(record.IdxLic)">
|
||||
<td class="text-nowrap">
|
||||
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
|
||||
<i class="oi oi-lock-unlocked"></i>
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
<b>@record.IdxSubLic</b>
|
||||
</td>
|
||||
<td>
|
||||
@record.CodImpiego
|
||||
</td>
|
||||
<td>
|
||||
@if (showKey)
|
||||
{
|
||||
<span class="text-success">@decryptAuthKey(record.Chiave)</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@record.Chiave
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if (record.Locked)
|
||||
{
|
||||
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-primary" @onclick="() => showDet(record)"><i class="fas fa-search"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxTicket<br />
|
||||
@record.Status
|
||||
</td>
|
||||
<td>
|
||||
<div><b>@record.ContactName</b></div>
|
||||
<div>@record.DtReq</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.ContactEmail</div>
|
||||
<div>@record.ContactPhone</div>
|
||||
</td>
|
||||
<td>
|
||||
@record.ReqBody
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
@if (idxTicketSel > 0)
|
||||
{
|
||||
<div>
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome File</th>
|
||||
<th>OriginalName</th>
|
||||
@*<th>FullStoragePath</th>*@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in FileAttached)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@record.OriginalName<br />
|
||||
|
||||
</td>
|
||||
@*<td>
|
||||
<div>@record.FullStoragePath</div>
|
||||
</td>*@
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@*<div class="card-body bg-light p-2">
|
||||
@if (idxTicketSel > 0)
|
||||
{
|
||||
<div>
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>OriginalName</th>
|
||||
@*<th>FullStoragePath</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in FileAttached)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@record.OriginalName<br />
|
||||
|
||||
</td>
|
||||
@*<td>
|
||||
<div>@record.FullStoragePath</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
*@
|
||||
@@ -20,6 +20,8 @@ namespace LiMan.UI.Components
|
||||
private List<TicketDTO> ListRecords;
|
||||
protected int totalCount = 0;
|
||||
|
||||
private List<FileAttachModel> 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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco file registrati dato ticket id
|
||||
/// </summary>
|
||||
/// <param name="idxTicket">Identificativo del ticket</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<FileAttachModel>> FileGetFilt(int idxTicket)
|
||||
{
|
||||
List<FileAttachModel> dbResult = new List<FileAttachModel>();
|
||||
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<bool> LicenzeNextUpdate(DB.DBModels.LicenzaModel currItem)
|
||||
{
|
||||
bool done = false;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<Version>1.1.2202.0409</Version>
|
||||
<Version>1.1.2202.0418</Version>
|
||||
<RootNamespace>LiMan.UI</RootNamespace>
|
||||
<AssemblyName>LiMan.UI</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>License Manager</i>
|
||||
<h4>Versione: 1.1.2202.0409</h4>
|
||||
<h4>Versione: 1.1.2202.0418</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2202.0409
|
||||
1.1.2202.0418
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2202.0409</version>
|
||||
<version>1.1.2202.0418</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user