This commit is contained in:
Samuele Locatelli
2023-05-12 12:42:27 +02:00
6 changed files with 130 additions and 75 deletions
@@ -4,10 +4,56 @@
{
<button class="btn btn-success" @onclick="() => doSave()"><i class="fa-solid fa-floppy-disk"></i></button>
<a class="btn btn-warning" href="https://iis01.egalware.com/Test3D/Doors041122/EXB_0267100040/EXB_0267100040.html" target="_blank"><i class="fa-solid fa-cube"></i></a>
@if (IsErr)
{
<button class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#errListModal"><i class="fa-solid fa-triangle-exclamation"></i></button>
}
}
else
{
<button class="btn btn-secondary"><i class="fa-solid fa-floppy-disk"></i></button>
<button class="btn btn-secondary"><i class="fa-solid fa-cube"></i></button>
}
@*<button class="btn btn-success" @onclick="() => toOrderPage()">Return to Order <b>@idOrd</b></button>*@
</div>
<!-- Modal Order -->
<div class="modal fade" id="errListModal" tabindex="-1" aria-labelledby="errListModalLabel" aria-hidden="true">
<div class="modal-dialog" style=" overflow-y: initial ">
<div class="modal-content">
<div class="modal-header d-flex justify-content-between">
<h1 class="modal-title fs-5" id="errListModalLabel">Current error</h1>
<i class="fa-solid fa-triangle-exclamation text-danger fs-5"></i>
</div>
<div class="modal-body" style="max-height: 80vh; overflow-y: auto;">
<div class="w-100 text-start">
@ErrCode
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Modal Order -->
<div class="modal fade" id="errListModal" tabindex="-1" aria-labelledby="errListModalLabel" aria-hidden="true">
<div class="modal-dialog" style=" overflow-y: initial ">
<div class="modal-content">
<div class="modal-header d-flex justify-content-between">
<h1 class="modal-title fs-5" id="errListModalLabel">Current error</h1>
<i class="fa-solid fa-triangle-exclamation text-danger fs-5"></i>
</div>
<div class="modal-body" style="max-height: 80vh; overflow-y: auto;">
<div class="w-100 text-start">
@ErrCode
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@@ -14,33 +14,16 @@ namespace WebDoorCreator.UI.Components.Buttons
[CascadingParameter]
public bool B_doorOpUpd { get; set; }
[CascadingParameter]
public string ErrCode { get; set; } = "ERROREEEEE";
[CascadingParameter]
public int idDoor { get; set; } = 0;
[Parameter]
public int idOrd { get; set; } = 0;
[CascadingParameter]
public int idDoor { get; set; } = 0;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
[Inject]
protected WebDoorCreatorService WDCService { get; set; } = null!;
[Inject]
protected WDCUserService WDCUService { get; set; } = null!;
[Inject]
protected QueueDataService QDataServ { get; set; } = null!;
[Inject]
protected IConfiguration config { get; set; } = null!;
protected List<DoorOpModel>? listDoorOp { get; set; }
protected List<Dictionary<string, string>> listDictDoorOP { get; set; } = new List<Dictionary<string, string>>();
protected Dictionary<string, List<Dictionary<string, string>>> dictDoorOP { get; set; } = new Dictionary<string, List<Dictionary<string, string>>>();
public bool IsErr { get; set; } = false;
protected Dictionary<string, string> a { get; set; } = new Dictionary<string, string>();
protected bool change
@@ -48,23 +31,39 @@ namespace WebDoorCreator.UI.Components.Buttons
get => WDCRService.isDoorOpUpd;
}
protected async Task toOrderPage()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Do you really want to return to the order page without saving current work?"))
return;
[Inject]
protected IConfiguration config { get; set; } = null!;
await Task.Delay(1);
NavManager.NavigateTo($"OrderDetails?idOrd={idOrd}");
}
protected WebDoorCreator.Data.DDF.Converter currDdfConv { get; set; } = null!;
protected override async Task OnParametersSetAsync()
{
await Task.Delay(1);
//change = paramsChanged;
}
protected DDFDto CurrentConf { get; set; } = new DDFDto();
protected DoorOpsDTO CurrentDoorOp { get; set; } = new DoorOpsDTO();
protected Dictionary<string, List<Dictionary<string, string>>> dictDoorOP { get; set; } = new Dictionary<string, List<Dictionary<string, string>>>();
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
protected List<Dictionary<string, string>> listDictDoorOP { get; set; } = new List<Dictionary<string, string>>();
protected List<DoorOpModel>? listDoorOp { get; set; }
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
protected List<string> ordListVal { get; set; } = new List<string>();
[Inject]
protected QueueDataService QDataServ { get; set; } = null!;
[Inject]
protected WDCRefreshService WDCRService { get; set; } = null!;
[Inject]
protected WebDoorCreatorService WDCService { get; set; } = null!;
[Inject]
protected WDCUserService WDCUService { get; set; } = null!;
public async Task SaveYaml(string ddfContent)
{
await Task.Delay(1);
@@ -78,28 +77,15 @@ namespace WebDoorCreator.UI.Components.Buttons
File.WriteAllText(fileName, ddfContent);
}
protected override void OnInitialized()
/// <summary>
/// Effettua Richiesta visione porta 3D
/// </summary>
/// <returns></returns>
protected async Task doReq3D()
{
base.OnInitialized();
string vers = config.GetValue<string>("ConfDDF:VersNumber");
bool remDoorOp = config.GetValue<bool>("ConfDDF:RemoveDoorOps");
var headRows = config.GetSection("ConfDDF:Header").Get<List<string>>();
var footRows = config.GetSection("ConfDDF:Footer").Get<List<string>>();
currDdfConv = new WebDoorCreator.Data.DDF.Converter(vers, remDoorOp, headRows, footRows);
WDCRService.EA_UpdDoorOp += WDCRService_EA_UpdDoorOp;
await Task.Delay(1);
}
private async void WDCRService_EA_UpdDoorOp()
{
await InvokeAsync(() =>
{
StateHasChanged();
});
}
[Inject]
protected WDCRefreshService WDCRService { get; set; } = null!;
/// <summary>
/// Effettua salvataggio record e generazione DDF
/// </summary>
@@ -133,15 +119,38 @@ namespace WebDoorCreator.UI.Components.Buttons
}
}
}
/// <summary>
/// Effettua Richiesta visione porta 3D
/// </summary>
/// <returns></returns>
protected async Task doReq3D()
protected override void OnInitialized()
{
await Task.Delay(1);
base.OnInitialized();
string vers = config.GetValue<string>("ConfDDF:VersNumber");
bool remDoorOp = config.GetValue<bool>("ConfDDF:RemoveDoorOps");
var headRows = config.GetSection("ConfDDF:Header").Get<List<string>>();
var footRows = config.GetSection("ConfDDF:Footer").Get<List<string>>();
currDdfConv = new WebDoorCreator.Data.DDF.Converter(vers, remDoorOp, headRows, footRows);
WDCRService.EA_UpdDoorOp += WDCRService_EA_UpdDoorOp;
}
protected WebDoorCreator.Data.DDF.Converter currDdfConv { get; set; } = null!;
protected override async Task OnParametersSetAsync()
{
await Task.Delay(1);
//change = paramsChanged;
}
protected async Task toOrderPage()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Do you really want to return to the order page without saving current work?"))
return;
await Task.Delay(1);
NavManager.NavigateTo($"OrderDetails?idOrd={idOrd}");
}
private async void WDCRService_EA_UpdDoorOp()
{
await InvokeAsync(() =>
{
StateHasChanged();
});
}
}
}
@@ -1,8 +1,8 @@
<div class="" style="height:100%; width:100%; position:sticky; background: linear-gradient(#AFCFD1, #92B2C4);min-height: 46rem;max-height: 46rem;">
@if (IsErr)
@*@if (IsErr)
{
<div class="alert alert-warning text-center fs-2">@ErrCode</div>
}
@*<div class="alert alert-warning text-center fs-2">@ErrCode</div>
}*@
@if (!string.IsNullOrEmpty(@SvgContent))
{
@svgPreview
@@ -17,11 +17,7 @@ namespace WebDoorCreator.UI.Components.DoorDef
//Log.Info($"Ricevuto {value}");
//StateHasChanged();
}
}
[Parameter]
public string ErrCode { get; set; } = "ERROREEEEE";
[Parameter]
public bool IsErr { get; set; } = false;
}
private static Logger Log = LogManager.GetCurrentClassLogger();
+7 -3
View File
@@ -10,7 +10,11 @@
<div class="col-12 px-0">
<CascadingValue Value="@idDoor">
<CascadingValue Value="B_doorOpUpd">
<DoorDefOrderTopRow currOrderStatus="@orderStatus" bgColor="#AFCFD1"></DoorDefOrderTopRow>
<CascadingValue Value="IsErr">
<CascadingValue Value="ErrCode">
<DoorDefOrderTopRow currOrderStatus="@orderStatus" bgColor="#AFCFD1"></DoorDefOrderTopRow>
</CascadingValue>
</CascadingValue>
</CascadingValue>
</CascadingValue>
</div>
@@ -41,8 +45,8 @@
</div>
</div>
<div class="col-5 p-0">
<CascadingValue Value="@idDoor">
<DoorPreview IsErr="@IsErr" ErrCode="@ErrCode" SvgContent="@DoorSvgContent"></DoorPreview>
<CascadingValue Value="@idDoor">
<DoorPreview SvgContent="@DoorSvgContent"></DoorPreview>
</CascadingValue>
</div>
</div>
File diff suppressed because one or more lines are too long