Migliorie al form schede

This commit is contained in:
2026-02-19 09:52:18 +01:00
parent c6e6480cd2
commit eef5055bfa
12 changed files with 155 additions and 96 deletions

2
.gitignore vendored
View File

@@ -33,6 +33,8 @@ bld/
# Visual Studo 2015 cache/options directory # Visual Studo 2015 cache/options directory
.vs/ .vs/
.idea
# MSTest test Results # MSTest test Results
[Tt]est[Rr]esult*/ [Tt]est[Rr]esult*/
[Bb]uild[Ll]og.* [Bb]uild[Ll]og.*

View File

@@ -2,12 +2,12 @@
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls" xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
android:Application.WindowSoftInputModeAdjust="Resize" android:Application.WindowSoftInputModeAdjust="Pan"
x:Class="SteUp.Maui.App"> x:Class="SteUp.Maui.App">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<Color x:Key="PageBackgroundColor">#dff2ff</Color> <Color x:Key="PageBackgroundColor">#FDECEA</Color>
<Color x:Key="PrimaryTextColor">White</Color> <Color x:Key="PrimaryTextColor">White</Color>
<Style TargetType="Label"> <Style TargetType="Label">
@@ -18,7 +18,7 @@
<Style TargetType="Button"> <Style TargetType="Button">
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" /> <Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" /> <Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="BackgroundColor" Value="#dff2ff" /> <Setter Property="BackgroundColor" Value="#FDECEA" />
<Setter Property="Padding" Value="14,10" /> <Setter Property="Padding" Value="14,10" />
</Style> </Style>

View File

@@ -36,6 +36,7 @@ public static class CoreModule
public static void RegisterSystemService(this MauiAppBuilder builder) public static void RegisterSystemService(this MauiAppBuilder builder)
{ {
builder.Services.AddSingleton<INetworkService, NetworkService>(); builder.Services.AddSingleton<INetworkService, NetworkService>();
builder.Services.AddSingleton<IAttachedService, AttachedService>();
} }
public static void AddAuthorizationCore(this MauiAppBuilder builder) public static void AddAuthorizationCore(this MauiAppBuilder builder)

View File

@@ -92,7 +92,7 @@
var puntoVendita = SteupDataService.PuntiVenditaList.Find(x => var puntoVendita = SteupDataService.PuntiVenditaList.Find(x =>
x.CodMdep != null && x.CodMdep.EqualsIgnoreCase(Ispezione.CodMdep) x.CodMdep != null && x.CodMdep.EqualsIgnoreCase(Ispezione.CodMdep)
); );
await Task.Delay(750); await Task.Delay(500);
PuntoVendita = puntoVendita ?? throw new Exception("Punto vendita non trovato"); PuntoVendita = puntoVendita ?? throw new Exception("Punto vendita non trovato");
OnLoading = false; OnLoading = false;

View File

@@ -24,6 +24,11 @@
line-height: normal; line-height: normal;
} }
.inspection-info{
display: flex;
flex-direction: column;
}
.info-title { .info-title {
color: var(--mud-palette-text-primary); color: var(--mud-palette-text-primary);
font-weight: 800; font-weight: 800;
@@ -40,7 +45,6 @@
.info-title.compactView{ .info-title.compactView{
font-size: medium; font-size: medium;
font-weight: 600;
} }
.section-info { .section-info {

View File

@@ -0,0 +1,23 @@
<div class="card-form-modal">
<div class="card-form-modal-title @ClassTitle">
<MudText Style="font-weight: 800" Typo="Typo.subtitle1">@Title</MudText>
</div>
<div class="card-form-modal-body @ClassBody">
@if (Loading)
{
<MudSkeleton/>
}
else
{
@ChildContent
}
</div>
</div>
@code {
[Parameter] public string Title { get; set; } = "";
[Parameter] public bool Loading { get; set; }
[Parameter] public RenderFragment? ChildContent { get; set; }
[Parameter] public string ClassTitle { get; set; } = "";
[Parameter] public string ClassBody { get; set; } = "";
}

View File

@@ -0,0 +1,23 @@
.card-form-modal {
background: var(--mud-palette-table-striped);
border-radius: 1em;
padding: .5rem 1rem;
width: -webkit-fill-available;
}
.is-dark .card-form-modal {
background: var(--mud-palette-background); !important;
}
.card-form-modal-body ::deep .file-upload-input {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 10;
opacity: 0;
}
small ::deep {
color: var(--mud-palette-text-primary) !important;
}

View File

@@ -3,7 +3,7 @@
@using SteUp.Shared.Core.Interface.System @using SteUp.Shared.Core.Interface.System
@inject IAttachedService AttachedService @inject IAttachedService AttachedService
<MudDialog Class="customDialog-form disable-safe-area"> <MudDialog Class="disable-safe-area">
<DialogContent> <DialogContent>
<HeaderLayout SmallHeader="true" Cancel="true" OnCancel="@(() => MudDialog.Cancel())" Title="@TitleModal"/> <HeaderLayout SmallHeader="true" Cancel="true" OnCancel="@(() => MudDialog.Cancel())" Title="@TitleModal"/>

View File

@@ -1,5 +1,6 @@
@using SteUp.Shared.Components.Layout @using SteUp.Shared.Components.Layout
@using SteUp.Shared.Components.Layout.Overlay @using SteUp.Shared.Components.Layout.Overlay
@using SteUp.Shared.Components.SingleElements.Card.ModalForm
@using SteUp.Shared.Core.Dto @using SteUp.Shared.Core.Dto
@using SteUp.Shared.Core.Entities @using SteUp.Shared.Core.Entities
@using SteUp.Shared.Core.Interface.IntegryApi @using SteUp.Shared.Core.Interface.IntegryApi
@@ -10,58 +11,35 @@
<MudDialog Class="customDialog-form"> <MudDialog Class="customDialog-form">
<DialogContent> <DialogContent>
<HeaderLayout Cancel="true" OnCancel="@(() => MudDialog.Cancel())" LabelSave="@LabelSave" <HeaderLayout Cancel="true" OnCancel="@(() => MudDialog.Cancel())" LabelSave="@LabelSave"
OnSave="Save" Title="Scheda"/> OnSave="Save" Title="Scheda"/>
<div class="content"> <div class="content">
<div class="input-card">
<div class="form-container">
<span class="disable-full-width">Reparto</span>
@if (SteupDataService.Reparti.IsNullOrEmpty()) <CardFormModal Title="Reparto" Loading="SteupDataService.Reparti.IsNullOrEmpty()">
<MudSelectExtended ReadOnly="IsView" T="JtbFasiDto?" Variant="Variant.Text"
@bind-Value="Scheda.Reparto" ToStringFunc="@(x => x?.Descrizione)"
@bind-Value:after="OnAfterChangeValue">
@foreach (var fasi in SteupDataService.Reparti)
{ {
<MudSkeleton/> <MudSelectItemExtended Class="custom-item-select" Value="@fasi">
@fasi.Descrizione
</MudSelectItemExtended>
} }
else </MudSelectExtended>
{ </CardFormModal>
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="JtbFasiDto?" Variant="Variant.Text"
@bind-Value="Scheda.Reparto" AdornmentIcon="@Icons.Material.Filled.Code"
ToStringFunc="@(x => x?.Descrizione)"
@bind-Value:after="OnAfterChangeValue" Class="customIcon-select">
@foreach (var fasi in SteupDataService.Reparti)
{
<MudSelectItemExtended Class="custom-item-select" Value="@fasi">
@fasi.Descrizione
</MudSelectItemExtended>
}
</MudSelectExtended>
}
</div>
<div class="divider"></div> <CardFormModal Title="Motivo" Loading="SteupDataService.TipiAttività.IsNullOrEmpty()">
<MudSelectExtended ReadOnly="IsView" T="string?" Variant="Variant.Text"
<div class="form-container"> @bind-Value="Scheda.ActivityTypeId" @bind-Value:after="OnAfterChangeValue">
<span class="disable-full-width">Motivo</span> @foreach (var type in SteupDataService.TipiAttività)
@if (SteupDataService.TipiAttività.IsNullOrEmpty())
{ {
<MudSkeleton/> <MudSelectItemExtended Class="custom-item-select"
Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
} }
else </MudSelectExtended>
{ </CardFormModal>
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text"
@bind-Value="Scheda.ActivityTypeId" Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code"
@bind-Value:after="OnAfterChangeValue">
@foreach (var type in SteupDataService.TipiAttività)
{
<MudSelectItemExtended Class="custom-item-select"
Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
}
</MudSelectExtended>
}
</div>
</div>
@* <div class="container-chip-attached"> *@ @* <div class="container-chip-attached"> *@
@* @if (!AttachedList.IsNullOrEmpty()) *@ @* @if (!AttachedList.IsNullOrEmpty()) *@
@@ -114,37 +92,32 @@
Size="Size.Medium" Size="Size.Medium"
OnClick="@OpenAddAttached" OnClick="@OpenAddAttached"
Variant="Variant.Outlined"> Variant="Variant.Outlined">
Aggiungi allegati Aggiungi foto
</MudButton> </MudButton>
</div> </div>
} }
<div class="input-card"> <CardFormModal Title="Scadenza">
<div class="form-container"> <MudSelectExtended FullWidth="true" ReadOnly="@IsView" T="int" Variant="Variant.Text"
<span class="disable-full-width">Scadenza</span> @bind-Value="@Scheda.Scadenza" @bind-Value:after="OnAfterChangeValue">
<MudSelectItemExtended Class="custom-item-select" Text="24H" Value="24"/>
<MudSelectItemExtended Class="custom-item-select" Text="1 Settimana" Value="168"/>
<MudSelectItemExtended Class="custom-item-select" Text="1 Mese" Value="730"/>
<MudSelectItemExtended Class="custom-item-select" Text="2 Mesi" Value="1460"/>
</MudSelectExtended>
</CardFormModal>
<MudSelectExtended FullWidth="true" ReadOnly="@IsView" T="int" Variant="Variant.Text" <CardFormModal Title="Responsabile">
@bind-Value="@Scheda.Scadenza" @bind-Value:after="OnAfterChangeValue" <MudTextField FullWidth="true" ReadOnly="IsView" T="string?" Variant="Variant.Text"
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
<MudSelectItemExtended Class="custom-item-select" Text="24H" Value="24" />
<MudSelectItemExtended Class="custom-item-select" Text="1 Settimana" Value="168" />
<MudSelectItemExtended Class="custom-item-select" Text="1 Mese" Value="730" />
<MudSelectItemExtended Class="custom-item-select" Text="2 Mesi" Value="1460" />
</MudSelectExtended>
</div>
<div class="divider"></div>
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Responsabile" Variant="Variant.Text"
@bind-Value="Scheda.Responsabile" @bind-Value:after="OnAfterChangeValue" @bind-Value="Scheda.Responsabile" @bind-Value:after="OnAfterChangeValue"
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/> DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
</CardFormModal>
<div class="divider"></div> <CardFormModal Title="Note">
<MudTextField ReadOnly="IsView" T="string?" Variant="Variant.Text" Lines="3"
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Note" Variant="Variant.Text" Lines="3"
@bind-Value="Scheda.Note" @bind-Value:after="OnAfterChangeValue" @bind-Value="Scheda.Note" @bind-Value:after="OnAfterChangeValue"
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/> DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
</div> </CardFormModal>
<div class="container-button"> <div class="container-button">
<MudButton Class="button-settings blue-icon" <MudButton Class="button-settings blue-icon"

View File

@@ -4,8 +4,7 @@
} }
.container-button { .container-button {
background: var(--mud-palette-background-gray) !important; margin-bottom: unset !important;
box-shadow: unset;
} }
.input-card { .input-card {

View File

@@ -220,7 +220,7 @@ h1:focus { outline: none; }
} }
.customDialog-form .mud-dialog-content { .customDialog-form .mud-dialog-content {
padding: 0 .75rem; padding: 0 0;
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
} }

View File

@@ -5,28 +5,42 @@
margin-bottom: 1rem; margin-bottom: 1rem;
} }
.customDialog-form.disable-safe-area .mud-dialog-content { margin-top: unset !important; } .customDialog-form.disable-safe-area .mud-dialog-content {
margin-top: unset !important;
}
.customDialog-form.disable-safe-area .content { height: 100% !important; } .customDialog-form.disable-safe-area .content {
height: 100% !important;
}
.customDialog-form.mud-dialog {
border-radius: unset !important;
}
.customDialog-form .content { .customDialog-form .content {
height: calc(100vh - (.6rem + 40px)); height: calc(100vh - (.6rem + 40px));
overflow: auto; overflow: auto;
-ms-overflow-style: none; gap: 1.5rem;
scrollbar-width: none; padding: 0 .75rem 2rem 75rem !important;
} }
@supports (-webkit-touch-callout: none) { @supports (-webkit-touch-callout: none) {
.customDialog-form .content { height: calc(100vh - (.6rem + 40px) - env(safe-area-inset-top)) !important; } .customDialog-form .content {
height: calc(100vh - (.6rem + 40px) - env(safe-area-inset-top)) !important;
}
.customDialog-form.disable-safe-area .content { height: 100% !important; } .customDialog-form.disable-safe-area .content {
height: 100% !important;
}
.customDialog-form.disable-safe-area .mud-dialog-content { margin-top: unset !important; } .customDialog-form.disable-safe-area .mud-dialog-content {
margin-top: unset !important;
}
} }
.customDialog-form .header { padding: 0 !important; } .customDialog-form .header {
padding: 0 .75rem !important;
.customDialog-form .content::-webkit-scrollbar { display: none; } }
.input-card { .input-card {
width: 100%; width: 100%;
@@ -42,9 +56,13 @@
padding: .4rem 1rem !important; padding: .4rem 1rem !important;
} }
.input-card.clearButton.custom-border-bottom { border-bottom: .1rem solid var(--card-border-color); } .input-card.clearButton.custom-border-bottom {
border-bottom: .1rem solid var(--card-border-color);
}
.input-card > .divider { margin: 0 !important; } .input-card > .divider {
margin: 0 !important;
}
.form-container { .form-container {
display: flex; display: flex;
@@ -81,22 +99,34 @@
/*Custom mudBlazor*/ /*Custom mudBlazor*/
.form-container .mud-input.mud-input-underline:before { border-bottom: none !important; } .form-container .mud-input.mud-input-underline:before {
border-bottom: none !important;
}
.form-container .mud-input.mud-input-underline:after { border-bottom: none !important; } .form-container .mud-input.mud-input-underline:after {
border-bottom: none !important;
}
.form-container.text-align-end .mud-input-slot { text-align: end; } .form-container.text-align-end .mud-input-slot {
text-align: end;
}
.input-card .mud-input.mud-input-underline:before { border-bottom: none !important; } .input-card .mud-input.mud-input-underline:before {
border-bottom: none !important;
}
.input-card .mud-input.mud-input-underline:after { border-bottom: none !important; } .input-card .mud-input.mud-input-underline:after {
border-bottom: none !important;
}
.form-container .customIcon-select .mud-icon-root.mud-svg-icon { .form-container .customIcon-select .mud-icon-root.mud-svg-icon {
rotate: 90deg !important; rotate: 90deg !important;
font-size: 1.1rem; font-size: 1.1rem;
} }
.form-container .customIcon-select .mud-input-slot { text-align: end; } .form-container .customIcon-select .mud-input-slot {
text-align: end;
}
.input-card .mud-input { .input-card .mud-input {
width: 100%; width: 100%;
@@ -105,7 +135,7 @@
.container-button { .container-button {
width: 100%; width: 100%;
background: var(--light-card-background); background: var(--mud-palette-table-striped);
padding: .5rem 0; padding: .5rem 0;
border-radius: 12px; border-radius: 12px;
margin-bottom: 2rem; margin-bottom: 2rem;
@@ -116,7 +146,9 @@
width: unset; width: unset;
} }
.container-button .button-settings { border: none !important; } .container-button .button-settings {
border: none !important;
}
.container-button .button-settings .mud-icon-root { .container-button .button-settings .mud-icon-root {
border-radius: 6px; border-radius: 6px;
@@ -160,7 +192,9 @@
font-size: 1rem; font-size: 1rem;
} }
.container-button .button-settings.exit { padding: 0; } .container-button .button-settings.exit {
padding: 0;
}
.container-button .button-settings.exit .mud-button-label { .container-button .button-settings.exit .mud-button-label {
justify-content: center; justify-content: center;