Gestite schede nella pagina ispezione e migliorie grafiche

This commit is contained in:
2026-02-23 10:12:36 +01:00
parent b39b7ba751
commit efefd3499b
21 changed files with 253 additions and 37 deletions

View File

@@ -1,17 +1,85 @@
@page "/ispezione"
@using SteUp.Shared.Components.Layout
@using SteUp.Shared.Components.SingleElements.Card
@using SteUp.Shared.Core.Dto
@using SteUp.Shared.Core.Entities
@using SteUp.Shared.Core.Interface.LocalDb
@using SteUp.Shared.Core.Messages.Scheda
@inject NewSchedaService NewScheda
@inject IIspezioniService IspezioniService
@implements IDisposable
<HeaderLayout Title="Ispezione" BackTo="Indietro" Back="true"/>
<div class="container content pb-safe-area">
<InspectionCard Ispezione="SteupDataService.InspectionPageState.Ispezione"/>
@if (!SchedeGrouped.IsNullOrEmpty())
{
<MudExpansionPanels MultiExpansion="true">
@foreach (var group in SchedeGrouped)
{
<MudExpansionPanel Expanded="true" Text="@group.Key.Descrizione">
<TitleContent>
<div class="header-scheda-group">
<div class="title">
<MudText Typo="Typo.h6"><b>@group.Key.Descrizione</b></MudText>
<MudChip T="string" Size="Size.Small" Color="Color.Default">
@($"{group.Value.Count} sched{(group.Value.Count == 1 ? "a" : "e")}")
</MudChip>
</div>
<div class="action-scheda-group">
<MudIconButton Variant="Variant.Filled" Icon="@Icons.Material.Rounded.Add" Color="Color.Warning" Size="Size.Medium"/>
</div>
</div>
</TitleContent>
<ChildContent>
@foreach (var scheda in group.Value)
{
<SchedaCard Scheda="scheda"/>
}
</ChildContent>
</MudExpansionPanel>
}
</MudExpansionPanels>
}
</div>
@code {
private Dictionary<JtbFasiDto, List<Scheda>> SchedeGrouped { get; set; } = [];
protected override async Task OnInitializedAsync()
protected override void OnInitialized()
{
NewScheda.OnNewScheda += LoadSchede;
LoadSchede();
}
private void LoadSchede()
{
var ispezione = SteupDataService.InspectionPageState.Ispezione;
InvokeAsync(async () =>
{
var schede = await IspezioniService.GetAllSchedeOfIspezioneAsync(
ispezione.CodMdep, ispezione.Data, ispezione.Rilevatore
);
SchedeGrouped = schede
.Where(s => s.Reparto != null)
.GroupBy(s => s.CodJfas)
.ToDictionary(
g => g.First().Reparto!,
g => g.ToList()
);
StateHasChanged();
});
}
void IDisposable.Dispose()
{
NewScheda.OnNewScheda -= LoadSchede;
}
}

View File

@@ -3,7 +3,6 @@
@using SteUp.Shared.Components.Layout
@using SteUp.Shared.Components.SingleElements
@using SteUp.Shared.Core.Authorization.Enum
@using SteUp.Shared.Core.Helpers
@using SteUp.Shared.Core.Interface.System.Network
@using SteUp.Shared.Core.Services
@using SteUp.Shared.Core.Utility
@@ -15,7 +14,7 @@
@if (IsLoggedIn)
{
<div class="container content pb-safe-area">
<div class="container-primary-info">
<div class="container-primary-info mud-elevation-1">
<div class="section-primary-info">
<MudAvatar Style="height: 70px; width: 70px; font-size: 2rem; font-weight: bold"
Color="Color.Secondary">
@@ -64,7 +63,7 @@
</div>
</div>
<div class="container-button">
<div class="container-button mud-elevation-1">
<MudButton Class="button-settings green-icon"
FullWidth="true"
StartIcon="@Icons.Material.Outlined.Sync"
@@ -75,7 +74,7 @@
</MudButton>
</div>
<div class="container-button">
<div class="container-button mud-elevation-1">
<MudButton Class="button-settings exit"
FullWidth="true"
Color="Color.Error"

View File

@@ -1,8 +1,8 @@
.container-primary-info {
background: var(--light-card-background);
/*background: var(--light-card-background);*/
width: 100%;
margin-bottom: 2rem;
border-radius: 12px;
border-radius: 20px;
}
.container-primary-info .divider {