Fix display selettore

This commit is contained in:
Samuele Locatelli
2022-11-24 10:14:40 +01:00
parent 8ee7c87860
commit c71a6c7c67
13 changed files with 110 additions and 58 deletions
+43 -20
View File
@@ -36,31 +36,54 @@ else
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record)">
<td class="text-nowrap">
@if (canStartOdl(record.IdxMacchina))
{
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm mx-1" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
}
else
{
<button class="btn btn-secondary btn-sm mx-1 disabled" title="Impossibile modificare" ><i class="bi bi-pencil-square"></i></button>
}
<td class="text-nowrap" style="width: 8rem;">
<button @onclick="() => cloneRecord(record)" class="btn btn-info btn-sm mx-1" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
@if (canStartOdl(record.IdxMacchina))
@if (record.IdxOdl == 0)
{
<button @onclick="() => startOdl(record)" class="btn btn-success btn-sm mx-1" title="Avvia PODL">
<i class="far fa-play-circle"></i>
</button>
}
else
{
<button class="btn btn-secondary btn-sm disabled mx-1" title="ODL ancora in corso">
<i class="far fa-play-circle"></i>
</button>
@if (canStartOdl(record.IdxMacchina))
{
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm mx-1" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
}
else
{
<button class="btn btn-secondary btn-sm mx-1 disabled" title="Impossibile modificare"><i class="bi bi-pencil-square"></i></button>
}
@if (canStartOdl(record.IdxMacchina))
{
<button @onclick="() => startOdl(record)" class="btn btn-success btn-sm mx-1" title="Avvia PODL">
<i class="far fa-play-circle"></i>
</button>
}
else
{
<button class="btn btn-secondary btn-sm disabled mx-1" title="ODL ancora in corso">
<i class="far fa-play-circle"></i>
</button>
}
}
</td>
<td>
<div class="small"><b>PODL</b> @($"{record.IdxPromessa:000000}")</div>
<div class="small" style="width:7rem;">
<div class="d-flex justify-content-between">
<div class="px-0">
<b>PODL</b>
</div>
<div class="px-0">
@($"{record.IdxPromessa.ToString(padCodXdl)}")
</div>
</div>
@if (record.IdxOdl > 0)
{
<div class="d-flex justify-content-between">
<div class="px-0">
<b>ODL</b>
</div>
<div class="px-0">
@($"{record.IdxOdl.ToString(padCodXdl)}")
</div>
</div>
}
</div>
</td>
<td>
@record.CodArticolo
+9 -5
View File
@@ -14,6 +14,9 @@ namespace MP.SPEC.Components
[Parameter]
public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams();
[Parameter]
public string padCodXdl { get; set; } = "0000";
[Parameter]
public EventCallback<bool> PagerResetReq { get; set; }
@@ -239,6 +242,12 @@ namespace MP.SPEC.Components
set => actFilter.CurrPage = value;
}
private bool hasOdl
{
get => actFilter.hasOdl;
set => actFilter.hasOdl = value;
}
private bool isLoading { get; set; } = false;
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 };
@@ -258,11 +267,6 @@ namespace MP.SPEC.Components
get => actFilter.CodFase;
set => actFilter.CodFase = value;
}
private bool hasOdl
{
get => actFilter.hasOdl;
set => actFilter.hasOdl = value;
}
private int totalCount
{
+21
View File
@@ -312,6 +312,27 @@ namespace MP.SPEC.Data
return result;
}
/// <summary>
/// Restituisce valore della stringa (SE disponibile)
/// </summary>
/// <param name="keyName"></param>
/// <returns></returns>
public async Task<string> tryGetConfig(string keyName)
{
string answ = "";
// preselezione valori
var configData = await ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == keyName);
if (currRec != null)
{
answ = currRec.Valore;
}
return answ;
}
/// <summary>
/// Reset dati cache config
/// </summary>
+1 -1
View File
@@ -12,7 +12,7 @@
#region Public Properties
/// <summary>
/// Bool: indica se il toggle è attivo
/// Bool: indica se il toggleClosed è attivo
/// </summary>
public bool isActive { get; set; } = true;
+1 -1
View File
@@ -26,7 +26,7 @@ namespace MP.SPEC.Data
public string SearchVal { get; set; } = "*";
public int TotCount { get; set; } = 0;
public bool hasOdl { get; set; } = true;
public bool hasOdl { get; set; } = false;
#endregion Public Properties
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2211.2409</Version>
<Version>6.16.2211.2410</Version>
</PropertyGroup>
<ItemGroup>
+8 -2
View File
@@ -129,12 +129,15 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
numRecord = 10;
#if false
configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
{
selAzienda = currRec.Valore;
}
}
#endif
selAzienda = await MDService.tryGetConfig("AZIENDA");
ListAziende = await MDService.ElencoAziende();
ListTipoArt = await MDService.AnagTipoArtLV();
}
@@ -210,7 +213,10 @@ namespace MP.SPEC.Pages
private int _currPage { get; set; } = 1;
private int _numRecord { get; set; } = 10;
private List<ConfigModel>? configData { get; set; } = null;
#if false
private List<ConfigModel>? configData { get; set; } = null;
#endif
private int currPage
{
+7 -2
View File
@@ -30,6 +30,7 @@ namespace MP.SPEC.Pages
MessageService.ShowSearch = false;
// recupero elenco JQM
ElencoLink = await MDService.ElencoLink();
#if false
configData = await MDService.ConfigGetAll();
if (configData != null)
{
@@ -38,7 +39,9 @@ namespace MP.SPEC.Pages
{
currAzienda = currRec.Valore;
}
}
}
#endif
currAzienda = await MDService.tryGetConfig("AZIENDA");
await Task.Delay(1);
}
@@ -52,7 +55,9 @@ namespace MP.SPEC.Pages
#region Private Properties
private List<ConfigModel>? configData { get; set; } = null;
#if false
private List<ConfigModel>? configData { get; set; } = null;
#endif
#endregion Private Properties
}
+5 -5
View File
@@ -12,11 +12,11 @@
<div class="col-2 align-content-center">
<div class="input-group input-group-sm">
<div class="input-group-text">
<span class="me-1">Con ODL</span>
<span class="me-1" title="Elenco PODL disponibili da produrre">Da Produrre</span>
<div class="form-check form-check-sm form-switch py-1" title="Parameter View Mode (RealTime / LogData)">
<input class="form-check-input" type="checkbox" id="mySwitch" name="setupAlarms" @onclick="()=> toggle()">
<input class="form-check-input" type="checkbox" name="setupAlarms" @onclick="()=> toggleClosed()">
</div>
<span class="">Senza ODL</span>
<span class="" title="Elenco PODL già lanciati/prodotti">Lanciati</span>
</div>
</div>
</div>
@@ -191,7 +191,7 @@
Attivabile
</div>
<div class="form-check form-check-sm form-switch py-1" title="Attivabile">
<input class="form-check-input" type="checkbox" id="mySwitch" name="setupAlarms" title="Attivabile" @bind="@currRecord.Attivabile">
<input class="form-check-input" type="checkbox" name="setupAlarms" title="Attivabile" @bind="@currRecord.Attivabile">
</div>
</div>
</div>
@@ -264,7 +264,7 @@
}
else
{
<ListPODL PagerResetReq="pgResetReq" RecordSel="@selRecord" updateRecordCount="UpdateTotCount" actFilter="@currFilter"></ListPODL>
<ListPODL PagerResetReq="pgResetReq" RecordSel="@selRecord" updateRecordCount="UpdateTotCount" actFilter="@currFilter" padCodXdl="@padCodXdl"></ListPODL>
}
</div>
<div class="card-footer py-1">
+11 -18
View File
@@ -73,13 +73,17 @@ namespace MP.SPEC.Pages
ListMacchine = await MDService.MacchineGetAll();
ListStati = await MDService.AnagStatiComm();
SearchRecords = await MDService.ListPODLFilt("*", "*");
#if false
// preselezione valori
configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
{
currAzienda = currRec.Valore;
}
}
#endif
currAzienda = await MDService.tryGetConfig("AZIENDA");
padCodXdl = await MDService.tryGetConfig("padCodXdl");
// carico dati
await reloadData();
}
@@ -212,35 +216,24 @@ namespace MP.SPEC.Pages
}
}
protected async Task toggle()
protected async Task toggleClosed()
{
hasOdl = !hasOdl;
await Task.Delay(1);
}
private bool selectFirst(string idxMacchina)
{
string firstMacchina = "";
bool answ = false;
if (ListMacchine != null)
{
var rawData = ListMacchine.Select(x => x.IdxMacchina).FirstOrDefault();
firstMacchina = rawData != null ? rawData : "";
}
if (firstMacchina == idxMacchina)
{
answ = true;
}
return answ;
}
private string btnNewText
{
get => currArticolo == "" ? "Sel Articolo" : "Nuovo PODL";
}
private List<ConfigModel>? configData { get; set; } = null;
#if false
private List<ConfigModel>? configData { get; set; } = null;
#endif
private string currArticolo { get; set; } = "";
private string padCodXdl { get; set; } = "00000";
private string currAzienda
{
get => _currAzienda;
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2211.2409</h4>
<h4>Versione: 6.16.2211.2410</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.2409
6.16.2211.2410
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.2409</version>
<version>6.16.2211.2410</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>