Iniziata implementazione filtri utenti
This commit is contained in:
@@ -68,6 +68,8 @@ else
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<MudTabs Elevation="2" Rounded="true" PanelClass="pt-6" Style="width: 100%" Centered="true">
|
||||||
|
<MudTabPanel Text="Contatti">
|
||||||
@if (PersRif is { Count: > 0 })
|
@if (PersRif is { Count: > 0 })
|
||||||
{
|
{
|
||||||
<div class="container-pers-rif">
|
<div class="container-pers-rif">
|
||||||
@@ -93,6 +95,13 @@ else
|
|||||||
Aggiungi contatto
|
Aggiungi contatto
|
||||||
</MudButton>
|
</MudButton>
|
||||||
</div>
|
</div>
|
||||||
|
</MudTabPanel>
|
||||||
|
<MudTabPanel Text="Commesse">
|
||||||
|
<Virtualize Items="Commesse" Context="commessa">
|
||||||
|
<CommessaCard Commessa="commessa" />
|
||||||
|
</Virtualize>
|
||||||
|
</MudTabPanel>
|
||||||
|
</MudTabs>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +110,7 @@ else
|
|||||||
|
|
||||||
private AnagClie Anag { get; set; } = new();
|
private AnagClie Anag { get; set; } = new();
|
||||||
private List<VtbCliePersRif>? PersRif { get; set; }
|
private List<VtbCliePersRif>? PersRif { get; set; }
|
||||||
|
private List<JtbComt> Commesse { get; set; }
|
||||||
|
|
||||||
private bool IsLoading { get; set; } = true;
|
private bool IsLoading { get; set; } = true;
|
||||||
|
|
||||||
@@ -113,6 +123,7 @@ else
|
|||||||
{
|
{
|
||||||
Anag = (await ManageData.GetTable<AnagClie>(x => x.CodAnag.Equals(CodAnag))).Last();
|
Anag = (await ManageData.GetTable<AnagClie>(x => x.CodAnag.Equals(CodAnag))).Last();
|
||||||
PersRif = await ManageData.GetTable<VtbCliePersRif>(x => x.CodAnag.Equals(Anag.CodAnag));
|
PersRif = await ManageData.GetTable<VtbCliePersRif>(x => x.CodAnag.Equals(Anag.CodAnag));
|
||||||
|
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag != null && x.CodAnag.Equals(CodAnag));
|
||||||
|
|
||||||
IsLoading = false;
|
IsLoading = false;
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
@page "/Users"
|
@page "/Users"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using salesbook.Shared.Components.Layout
|
@using salesbook.Shared.Components.Layout
|
||||||
|
@using salesbook.Shared.Core.Dto
|
||||||
@using salesbook.Shared.Core.Entity
|
@using salesbook.Shared.Core.Entity
|
||||||
@using salesbook.Shared.Core.Interface
|
@using salesbook.Shared.Core.Interface
|
||||||
|
@using salesbook.Shared.Components.SingleElements.BottomSheet
|
||||||
@inject IManageDataService ManageData
|
@inject IManageDataService ManageData
|
||||||
|
|
||||||
<HeaderLayout Title="Contatti"/>
|
<HeaderLayout Title="Contatti" ShowFilter="true" OnFilterToggle="ToggleFilter" />
|
||||||
|
|
||||||
<div class="container search-box">
|
<div class="container search-box">
|
||||||
<div class="input-card clearButton">
|
<div class="input-card clearButton">
|
||||||
@@ -31,11 +33,17 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<FilterUsers @bind-IsSheetVisible="OpenFilter" @bind-Filter="Filter" @bind-Filter:after="ApplyFilter"/>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<UserDisplayItem> GroupedUserList { get; set; } = [];
|
private List<UserDisplayItem> GroupedUserList { get; set; } = [];
|
||||||
private List<UserDisplayItem> FilteredGroupedUserList { get; set; } = [];
|
private List<UserDisplayItem> FilteredGroupedUserList { get; set; } = [];
|
||||||
private string? TextToFilter { get; set; }
|
private string? TextToFilter { get; set; }
|
||||||
|
|
||||||
|
//Filtri
|
||||||
|
private bool OpenFilter { get; set; }
|
||||||
|
private FilterUserDTO Filter { get; set; } = new();
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
if (firstRender)
|
if (firstRender)
|
||||||
@@ -121,4 +129,15 @@
|
|||||||
FilteredGroupedUserList = result;
|
FilteredGroupedUserList = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ToggleFilter()
|
||||||
|
{
|
||||||
|
OpenFilter = !OpenFilter;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyFilter()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,12 +15,6 @@
|
|||||||
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="CloseBottomSheet"/>
|
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="CloseBottomSheet"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input-card clearButton">
|
|
||||||
<MudTextField T="string?" Placeholder="Cerca..." Variant="Variant.Text" @bind-Value="Filter.Text" DebounceInterval="500"/>
|
|
||||||
|
|
||||||
<MudIconButton Class="closeIcon" Icon="@Icons.Material.Filled.Close" OnClick="() => Filter.Text = null"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-card">
|
<div class="input-card">
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<span class="disable-full-width">Assegnata a</span>
|
<span class="disable-full-width">Assegnata a</span>
|
||||||
@@ -35,7 +29,7 @@
|
|||||||
FullWidth="true" T="string"
|
FullWidth="true" T="string"
|
||||||
Variant="Variant.Text"
|
Variant="Variant.Text"
|
||||||
Virtualize="true"
|
Virtualize="true"
|
||||||
@bind-SelectedValues="Filter.User"
|
@* @bind-SelectedValues="Filter.User" *@
|
||||||
Class="customIcon-select"
|
Class="customIcon-select"
|
||||||
AdornmentIcon="@Icons.Material.Filled.Code"/>
|
AdornmentIcon="@Icons.Material.Filled.Code"/>
|
||||||
|
|
||||||
@@ -49,7 +43,7 @@
|
|||||||
<MudSelectExtended FullWidth="true"
|
<MudSelectExtended FullWidth="true"
|
||||||
T="string?"
|
T="string?"
|
||||||
Variant="Variant.Text"
|
Variant="Variant.Text"
|
||||||
@bind-Value="Filter.Type"
|
@* @bind-Value="Filter.Type" *@
|
||||||
Class="customIcon-select"
|
Class="customIcon-select"
|
||||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||||
@foreach (var type in ActivityType)
|
@foreach (var type in ActivityType)
|
||||||
@@ -67,7 +61,7 @@
|
|||||||
<MudSelectExtended FullWidth="true"
|
<MudSelectExtended FullWidth="true"
|
||||||
T="string?"
|
T="string?"
|
||||||
Variant="Variant.Text"
|
Variant="Variant.Text"
|
||||||
@bind-Value="Filter.Result"
|
@* @bind-Value="Filter.Result" *@
|
||||||
Class="customIcon-select"
|
Class="customIcon-select"
|
||||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||||
@foreach (var result in ActivityResult)
|
@foreach (var result in ActivityResult)
|
||||||
@@ -85,7 +79,7 @@
|
|||||||
<MudSelectExtended FullWidth="true"
|
<MudSelectExtended FullWidth="true"
|
||||||
T="ActivityCategoryEnum?"
|
T="ActivityCategoryEnum?"
|
||||||
Variant="Variant.Text"
|
Variant="Variant.Text"
|
||||||
@bind-Value="Filter.Category"
|
@* @bind-Value="Filter.Category" *@
|
||||||
Class="customIcon-select"
|
Class="customIcon-select"
|
||||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||||
@foreach (var category in CategoryList)
|
@foreach (var category in CategoryList)
|
||||||
@@ -97,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="button-section">
|
<div class="button-section">
|
||||||
<MudButton OnClick="() => Filter = new FilterActivityDTO()" Variant="Variant.Outlined" Color="Color.Error">Pulisci</MudButton>
|
<MudButton OnClick="() => Filter = new FilterUserDTO()" Variant="Variant.Outlined" Color="Color.Error">Pulisci</MudButton>
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="OnFilterButton">Filtra</MudButton>
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="OnFilterButton">Filtra</MudButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -107,8 +101,8 @@
|
|||||||
[Parameter] public bool IsSheetVisible { get; set; }
|
[Parameter] public bool IsSheetVisible { get; set; }
|
||||||
[Parameter] public EventCallback<bool> IsSheetVisibleChanged { get; set; }
|
[Parameter] public EventCallback<bool> IsSheetVisibleChanged { get; set; }
|
||||||
|
|
||||||
[Parameter] public FilterActivityDTO Filter { get; set; }
|
[Parameter] public FilterUserDTO Filter { get; set; }
|
||||||
[Parameter] public EventCallback<FilterActivityDTO> FilterChanged { get; set; }
|
[Parameter] public EventCallback<FilterUserDTO> FilterChanged { get; set; }
|
||||||
|
|
||||||
private List<StbActivityResult> ActivityResult { get; set; } = [];
|
private List<StbActivityResult> ActivityResult { get; set; } = [];
|
||||||
private List<StbActivityType> ActivityType { get; set; } = [];
|
private List<StbActivityType> ActivityType { get; set; } = [];
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
@using salesbook.Shared.Core.Entity
|
||||||
|
|
||||||
|
<div class="activity-card">
|
||||||
|
<div class="activity-left-section">
|
||||||
|
<div class="activity-body-section">
|
||||||
|
<div class="title-section">
|
||||||
|
<MudText Class="activity-title" Typo="Typo.body1" HtmlTag="h3">@Commessa.Descrizione</MudText>
|
||||||
|
<div class="activity-hours-section">
|
||||||
|
<span class="activity-hours">
|
||||||
|
@Commessa.CodJcom
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="activity-info-section">
|
||||||
|
<MudChip T="string" Icon="@IconConstants.Chip.User" Size="Size.Small">Stato</MudChip>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public JtbComt Commessa { get; set; } = new();
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
.activity-card {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: .5rem .5rem;
|
||||||
|
border-radius: 12px;
|
||||||
|
line-height: normal;
|
||||||
|
box-shadow: var(--custom-box-shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-card.memo { border-left: 5px solid var(--mud-palette-info-darken); }
|
||||||
|
|
||||||
|
.activity-card.interna { border-left: 5px solid var(--mud-palette-success-darken); }
|
||||||
|
|
||||||
|
.activity-card.commessa { border-left: 5px solid var(--mud-palette-warning); }
|
||||||
|
|
||||||
|
.activity-left-section {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-section {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-hours {
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--mud-palette-text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-hours-section ::deep .mud-chip { margin: 5px 0 0 !important; }
|
||||||
|
|
||||||
|
.activity-body-section {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-section ::deep > .activity-title {
|
||||||
|
font-weight: 800 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
line-height: normal !important;
|
||||||
|
color: var(--mud-palette-text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-body-section ::deep > .activity-subtitle {
|
||||||
|
color: var(--mud-palette-gray-darker);
|
||||||
|
margin: .2rem 0 !important;
|
||||||
|
line-height: normal !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-info-section {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
5
salesbook.Shared/Core/Dto/FilterUserDTO.cs
Normal file
5
salesbook.Shared/Core/Dto/FilterUserDTO.cs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
namespace salesbook.Shared.Core.Dto;
|
||||||
|
|
||||||
|
public class FilterUserDTO
|
||||||
|
{
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user