generated from Integry/Template_NetMauiBlazorHybrid
Sistemati caricamenti
This commit is contained in:
@@ -232,7 +232,7 @@ public class ManageDataService(
|
||||
return await MapActivity(activities);
|
||||
}
|
||||
|
||||
private async Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities)
|
||||
public async Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities)
|
||||
{
|
||||
if (activities == null) return [];
|
||||
|
||||
@@ -291,7 +291,7 @@ public class ManageDataService(
|
||||
}
|
||||
}
|
||||
|
||||
dto.Commessa = jtbComtList.LastOrDefault();
|
||||
dto.Commessa = jtbComtList.Find(x => x.CodJcom.Equals(dto.CodJcom));
|
||||
return dto;
|
||||
})
|
||||
.ToList();
|
||||
|
||||
@@ -149,8 +149,7 @@ else
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
var activities = await IntegryApiService.RetrieveActivity(new CRMRetrieveActivityRequestDTO { CodJcom = CodJcom });
|
||||
ActivityList = Mapper.Map<List<ActivityDTO>>(activities)
|
||||
.OrderBy(x =>
|
||||
ActivityList = (await ManageData.MapActivity(activities)).OrderByDescending(x =>
|
||||
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
||||
).ToList();
|
||||
});
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
Back="true"
|
||||
BackOnTop="true"
|
||||
Title=""
|
||||
ShowProfile="false" />
|
||||
ShowProfile="false"/>
|
||||
|
||||
@if (IsLoading)
|
||||
{
|
||||
<SpinnerLayout FullScreen="true" />
|
||||
<SpinnerLayout FullScreen="true"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -123,7 +123,7 @@ else
|
||||
<div class="container-pers-rif">
|
||||
@foreach (var person in PersRif)
|
||||
{
|
||||
<ContactCard Contact="person" />
|
||||
<ContactCard Contact="person"/>
|
||||
@if (person != PersRif.Last())
|
||||
{
|
||||
<div class="divider"></div>
|
||||
@@ -147,11 +147,11 @@ else
|
||||
<div class="tab-content" style="display: @(ActiveTab == 1 ? "block" : "none")">
|
||||
@if (IsLoadingCommesse)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7" />
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7"/>
|
||||
}
|
||||
else if (Commesse?.Count == 0)
|
||||
{
|
||||
<NoDataAvailable Text="Nessuna commessa presente" />
|
||||
<NoDataAvailable Text="Nessuna commessa presente"/>
|
||||
}
|
||||
else if (Commesse != null)
|
||||
{
|
||||
@@ -162,13 +162,13 @@ else
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="SearchTermCommesse"
|
||||
OnDebounceIntervalElapsed="() => ApplyFiltersCommesse()"
|
||||
DebounceInterval="500" />
|
||||
DebounceInterval="500"/>
|
||||
</div>
|
||||
|
||||
<div class="commesse-container">
|
||||
@if (IsLoadingSteps)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-3" />
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-3"/>
|
||||
}
|
||||
|
||||
@foreach (var commessa in CurrentPageCommesse)
|
||||
@@ -176,14 +176,14 @@ else
|
||||
<div class="commessa-wrapper" style="@(IsLoadingStep(commessa.CodJcom) ? "opacity: 0.7;" : "")">
|
||||
@if (Steps.TryGetValue(commessa.CodJcom, out var steps))
|
||||
{
|
||||
<CommessaCard Steps="@steps" RagSoc="@Anag.RagSoc" Commessa="commessa" />
|
||||
<CommessaCard Steps="@steps" RagSoc="@Anag.RagSoc" Commessa="commessa"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<CommessaCard Steps="null" RagSoc="@Anag.RagSoc" Commessa="commessa" />
|
||||
<CommessaCard Steps="null" RagSoc="@Anag.RagSoc" Commessa="commessa"/>
|
||||
@if (IsLoadingStep(commessa.CodJcom))
|
||||
{
|
||||
<MudProgressLinear Indeterminate="true" Color="Color.Primary" Class="my-1" Style="height: 2px;" />
|
||||
<MudProgressLinear Indeterminate="true" Color="Color.Primary" Class="my-1" Style="height: 2px;"/>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -194,7 +194,7 @@ else
|
||||
<div class="custom-pagination">
|
||||
<MudPagination BoundaryCount="1" MiddleCount="1" Count="@TotalPagesCommesse"
|
||||
@bind-Selected="SelectedPageCommesse"
|
||||
Color="Color.Primary" />
|
||||
Color="Color.Primary"/>
|
||||
</div>
|
||||
|
||||
<div class="SelectedPageSize">
|
||||
@@ -217,11 +217,11 @@ else
|
||||
<div class="tab-content" style="display: @(ActiveTab == 2 ? "block" : "none")">
|
||||
@if (ActivityIsLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7" />
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7"/>
|
||||
}
|
||||
else if (ActivityList?.Count == 0)
|
||||
{
|
||||
<NoDataAvailable Text="Nessuna attivit<69> presente" />
|
||||
<NoDataAvailable Text="Nessuna attivit<69> presente"/>
|
||||
}
|
||||
else if (ActivityList != null)
|
||||
{
|
||||
@@ -232,13 +232,13 @@ else
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="SearchTermActivity"
|
||||
OnDebounceIntervalElapsed="() => ApplyFiltersActivity()"
|
||||
DebounceInterval="500" />
|
||||
DebounceInterval="500"/>
|
||||
</div>
|
||||
|
||||
<div class="attivita-container">
|
||||
@foreach (var activity in CurrentPageActivity)
|
||||
{
|
||||
<ActivityCard ShowDate="true" Activity="activity" />
|
||||
<ActivityCard ShowDate="true" Activity="activity"/>
|
||||
}
|
||||
|
||||
@if (TotalPagesActivity > 1)
|
||||
@@ -246,7 +246,7 @@ else
|
||||
<div class="custom-pagination">
|
||||
<MudPagination BoundaryCount="1" MiddleCount="1" Count="@TotalPagesActivity"
|
||||
@bind-Selected="CurrentPageActivityIndex"
|
||||
Color="Color.Primary" />
|
||||
Color="Color.Primary"/>
|
||||
</div>
|
||||
|
||||
<div class="SelectedPageSize">
|
||||
@@ -267,7 +267,7 @@ else
|
||||
</div>
|
||||
|
||||
<MudScrollToTop Selector="#topPage" VisibleCssClass="visible absolute" TopOffset="100" HiddenCssClass="invisible">
|
||||
<MudFab Size="Size.Small" Color="Color.Primary" StartIcon="@Icons.Material.Rounded.KeyboardArrowUp" />
|
||||
<MudFab Size="Size.Small" Color="Color.Primary" StartIcon="@Icons.Material.Rounded.KeyboardArrowUp"/>
|
||||
</MudScrollToTop>
|
||||
</div>
|
||||
}
|
||||
@@ -527,8 +527,7 @@ else
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
var activities = await IntegryApiService.RetrieveActivity(new CRMRetrieveActivityRequestDTO { CodAnag = Anag.CodContact });
|
||||
ActivityList = Mapper.Map<List<ActivityDTO>>(activities)
|
||||
.OrderByDescending(x =>
|
||||
ActivityList = (await ManageData.MapActivity(activities)).OrderByDescending(x =>
|
||||
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
||||
).ToList();
|
||||
});
|
||||
@@ -794,4 +793,5 @@ else
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -39,6 +39,12 @@
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Commessa</span>
|
||||
|
||||
@if (ActivityModel.CodJcom != null && SelectedComessa == null)
|
||||
{
|
||||
<MudSkeleton />
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAutocomplete
|
||||
Disabled="ActivityModel.Cliente.IsNullOrEmpty()"
|
||||
T="JtbComt?" ReadOnly="IsView"
|
||||
@@ -47,10 +53,12 @@
|
||||
SearchFunc="SearchCommesseAsync"
|
||||
ToStringFunc="@(c => c == null ? string.Empty : $"{c.CodJcom} - {c.Descrizione}")"
|
||||
Clearable="true"
|
||||
OnClearButtonClick="OnCommessaClear"
|
||||
ShowProgressIndicator="true"
|
||||
DebounceInterval="300"
|
||||
MaxItems="50"
|
||||
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -90,6 +98,12 @@
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Assegnata a</span>
|
||||
|
||||
@if (ActivityModel.UserName != null && SelectedUser == null)
|
||||
{
|
||||
<MudSkeleton />
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAutocomplete
|
||||
Disabled="Users.IsNullOrEmpty()" ReadOnly="IsView"
|
||||
T="StbUser"
|
||||
@@ -98,11 +112,13 @@
|
||||
SearchFunc="SearchUtentiAsync"
|
||||
ToStringFunc="@(u => u == null ? string.Empty : u.FullName)"
|
||||
Clearable="true"
|
||||
OnClearButtonClick="OnUserClear"
|
||||
ShowProgressIndicator="true"
|
||||
DebounceInterval="300"
|
||||
MaxItems="50"
|
||||
Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -110,12 +126,19 @@
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Tipo</span>
|
||||
|
||||
@if (ActivityType.IsNullOrEmpty())
|
||||
{
|
||||
<MudSkeleton />
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityTypeId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var type in ActivityType)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -370,14 +393,14 @@
|
||||
{
|
||||
return Task.Run(async () =>
|
||||
{
|
||||
if (!IsNew && Id != null)
|
||||
ActivityFileList = await IntegryApiService.GetActivityFile(Id);
|
||||
SelectedComessa = ActivityModel.Commessa;
|
||||
|
||||
Users = await ManageData.GetTable<StbUser>();
|
||||
if (!ActivityModel.UserName.IsNullOrEmpty())
|
||||
SelectedUser = Users.FindLast(x => x.UserName.Equals(ActivityModel.UserName));
|
||||
|
||||
SelectedComessa = ActivityModel.Commessa;
|
||||
if (!IsNew && Id != null)
|
||||
ActivityFileList = await IntegryApiService.GetActivityFile(Id);
|
||||
|
||||
ActivityResult = await ManageData.GetTable<StbActivityResult>();
|
||||
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
|
||||
@@ -510,6 +533,20 @@
|
||||
OnAfterChangeValue();
|
||||
}
|
||||
|
||||
private async Task OnCommessaClear()
|
||||
{
|
||||
ActivityModel.Commessa = null;
|
||||
ActivityModel.CodJcom = null;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnUserClear()
|
||||
{
|
||||
ActivityModel.UserName = null;
|
||||
ActivityType = [];
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void OnAfterChangeTimeBefore()
|
||||
{
|
||||
if (ActivityModel.EstimatedTime is not null)
|
||||
|
||||
@@ -25,5 +25,7 @@ public interface IManageDataService
|
||||
Task Delete<T>(T objectToDelete);
|
||||
Task DeleteActivity(ActivityDTO activity);
|
||||
|
||||
Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities);
|
||||
|
||||
Task ClearDb();
|
||||
}
|
||||
Reference in New Issue
Block a user