81 lines
2.1 KiB
Plaintext
81 lines
2.1 KiB
Plaintext
@using CORE.Data.DbModels
|
|
@using UI.Data
|
|
@inject GpwDataService GDataServ
|
|
|
|
<div class="px-1 py-0 small flex-fill @blockCss" style="width: @widthPerc">
|
|
<div class="d-flex">
|
|
@if (@CurrData.IdxFase > 0)
|
|
{
|
|
<div class="px-1 text-left border border-secondary border-top-0 border-bottom-0 border-left-0">
|
|
<div>@CurrData.Inizio.ToString("HH:mm")</div>
|
|
<div class="small">@CurrData.Fine.ToString("HH:mm")</div>
|
|
<div><b>@($"{CurrData.OreTot:N2}h")</b></div>
|
|
</div>
|
|
<div class="px-1 text-left textTrim">
|
|
<div><b>@(headFase(CurrData.IdxFase))</b></div>
|
|
<div class="small" title="@CurrData.Descrizione">@CurrData.Descrizione</div>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="px-1 small textTrim">
|
|
@*<button class="btn-link btn-sm btn-success text-light"><i class="fas fa-plus"></i></button>*@
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@code {
|
|
[Parameter]
|
|
public RegAttivitaModel CurrData { get; set; } = null!;
|
|
|
|
|
|
[Parameter]
|
|
public int Periodo { get; set; } = 1;
|
|
|
|
|
|
[Parameter]
|
|
public List<AnagFasiModel> ListFasi { get; set; } = null!;
|
|
|
|
|
|
private string widthPerc
|
|
{
|
|
get
|
|
{
|
|
string answ = "1%";
|
|
if (CurrData != null)
|
|
{
|
|
answ = $"{CurrData.OreTot / Periodo:P0}";
|
|
}
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
private string blockCss
|
|
{
|
|
get
|
|
{
|
|
string answ = CurrData.IdxFase == 0 ? "" : "table-info border border-info rounded";
|
|
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
private string headFase(int idxFase)
|
|
{
|
|
string answ = $"F.{idxFase}";
|
|
if (ListFasi != null)
|
|
{
|
|
var currFase = ListFasi
|
|
.Where(x => x.IdxFase == idxFase)
|
|
.FirstOrDefault();
|
|
if (currFase != null)
|
|
{
|
|
answ = $"{currFase.NomeFase}";
|
|
}
|
|
}
|
|
return answ;
|
|
}
|
|
}
|