Files
magman/MagMan.UI/Components/ProjectMan.razor
T
2024-01-25 16:15:45 +01:00

154 lines
7.7 KiB
Plaintext

<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between">
<div class="px-2">
<h3>Progetti</h3>
</div>
<div class="px-2">
<div class="d-flex">
@* <div class="px-2">
@if (CurrItem == null)
{
<button class="btn btn-success" @onclick="()=>CreateNew()"><i class="fa-solid fa-square-plus"></i> Add New</button>
}
else
{
<button class="btn btn-warning" @onclick="()=> DoEdit(null)"><i class="fa-solid fa-ban"></i> Cancel</button>
}
</div> *@
<div class="px-2">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Macchina</span>
<select class="form-select" @bind="@MachineIdSel">
<option value="0">--- Tutti ---</option>
@foreach (var item in MachineList)
{
<option value="@item.MachineID">
@item.MainKey | @item.Name (@item.MachineID)
</option>
}
</select>
</div>
</div>
</div>
</div>
</div>
@if (CurrItem != null)
{
@*<hr />
<MaterialEdit CurrRecord="CurrItem" EC_update="ForceReload"></MaterialEdit> *@
}
</div>
<div class="card-body p-1">
@if (ListRecords == null || isLoading)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-info">Nessun record trovato</div>
}
else
{
<table class="table table-striped table-sm text-start">
<thead>
<tr class="">
<th>
<button class="btn btn-primary btn-sm" @onclick="() => DoSelect(null)"><i class="fa-solid fa-rotate"></i></button>
</th>
<th>ID <Sorter ParamName="ID" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
@if (ProjDbId == 0)
{
<th>Macchina <Sorter ParamName="Machine" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
}
<th>Descr. <Sorter ParamName="ProjDescription" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th>Filename <Sorter ParamName="BTLFileName" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th class="text-end">Creato <Sorter ParamName="DtCreated" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th class="text-end">Previsione <Sorter ParamName="DtSchedule" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
<th class="text-end">Prod <Sorter ParamName="DtStartProd" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
@* <th class="text-end">Arch <Sorter ParamName="IsArchived" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th> *@
<th class="text-end">Time <Sorter ParamName="ProcTimeEst" IsAsc="@sortAsc" CurrParam="@sortField" sortReq="SortRequested"></Sorter></th>
@* <th class="text-end"></th> *@
</tr>
</thead>
<tbody>
@foreach (var item in ListRecords)
{
<tr class="align-middle @CheckSel(item)">
<td>
<button class="btn btn-info btn-sm" @onclick="() => DoSelect(item)"><i class="fa-solid fa-search"></i></button>
@* <button class="btn btn-primary btn-sm" @onclick="() => DoEdit(item)"><i class="fa-solid fa-edit"></i></button> *@
</td>
<td>
<span title="@($"DB Id: {item.ProjExtDbId} | Ext.Id: {item.ProjExtId}")">
@if (item.PType == Enums.BWType.BEAM)
{
<span class="border border-primary rounded px-1">
<i class="fa-solid fa-lines-leaning"></i>
</span>
}
else
{
<span class="border border-info rounded px-1">
<i class="fa-solid fa-draw-polygon"></i>
</span>
}
&nbsp;@item.ProjExtId
</span>
</td>
@if (ProjDbId == 0)
{
<td>
<sup class="small">[@item.MachineID]</sup>
@item.Machine
</td>
}
<td>
@item.ProjDescription
</td>
<td>
@item.BTLFileName
</td>
<td class="text-end">
@($"{item.DtCreated:yyyy-MM-dd}")
</td>
<td class="text-end">
@($"{item.DtSchedule:yyyy-MM-dd}")
</td>
<td class="text-end">
@if (item.DtStartProd > DateTime.MinValue)
{
@($"{item.DtStartProd:yyyy-MM-dd}")
}
else
{
<span>n.a.</span>
}
</td>
@* <td class="text-end">
@item.IsArchived
</td> *@
<td class="text-end">
@if (item.ProcTimeReal > 0)
{
<span class="fw-bold" title="Reale">@($"{item.ProcTimeReal:N1}") min</span>
}
else
{
<span class="text-secondary" title="Stima">@($"{item.ProcTimeEst:N1}") min</span>
}
</td>
</tr>
}
</tbody>
</table>
}
</div>
<div class="card-footer">
<EgwCoreLib.Razor.DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="SetNumRec" numPageChanged="SetPage" totalCount="@totalCount" showLoading="@isLoading"></EgwCoreLib.Razor.DataPager>
</div>
</div>