RunInfo navigation

This commit is contained in:
2023-01-23 14:40:42 -07:00
parent 85b30d9153
commit 56ec81e080
6 changed files with 36 additions and 10 deletions

View File

@ -1,4 +1,5 @@
@page "/AwaitingDisposition"
@page "/"
@page "/AwaitingDisposition"
@using Microsoft.AspNetCore.Components.Web
@using MudBlazor

View File

@ -1,11 +1,7 @@
@page "/"
@page "/Index"
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Index</PageTitle>
<h4>Run Information</h4>
Welcome to your new app.

View File

@ -1,6 +1,7 @@
@page "/RunHeaders"
@using Microsoft.AspNetCore.Components.Web
@using MudBlazor
@namespace OI.Metrology.ClientHub.Pages
@ -28,4 +29,13 @@
<table id="FieldsGrid"></table>
</td>
</tr>
</table>
</table>
<div class="row" style="margin-top: 10px; margin-bottom: 20px;">
<div class="col-xs-1">
<MudButton Variant="Variant.Filled" Color="Color.Info" id="OpenButton">Open</MudButton>
</div>
<div class="col-xs-1">
<MudButton Variant="Variant.Filled" Color="Color.Primary" id="RefreshButton">Refresh</MudButton>
</div>
</div>

View File

@ -1,4 +1,5 @@
@page "/RunInfo/{Model?}"
@page "/RunInfo/{ToolTypeId:int?}/{HeaderId:int?}"
@using Microsoft.AspNetCore.Components.Web
@using MudBlazor

View File

@ -6,6 +6,8 @@ namespace OI.Metrology.ClientHub.Pages;
public partial class RunInfo
{
[Parameter] public int? HeaderId { get; set; }
[Parameter] public int? ToolTypeId { get; set; }
[Parameter] public Metrology.Shared.ViewModels.RunInfo? Model { get; set; }
[Inject] protected IJSRuntime? JSRuntime { get; set; }
@ -19,9 +21,9 @@ public partial class RunInfo
throw new NullReferenceException(nameof(JSRuntime));
if (AppSettings is null)
throw new NullReferenceException(nameof(AppSettings));
int initialToolTypeID = Model is not null ? Model.ToolTypeID : 0;
int initialHeaderId = Model is not null ? Model.HeaderID : 0;
int initialHeaderId = Model is not null ? Model.HeaderID : HeaderId is not null ? HeaderId.Value : 0;
string initialHeaderAttachmentId = Model is not null ? Model.HeaderAttachmentID.ToString() : string.Empty;
int initialToolTypeID = Model is not null ? Model.ToolTypeID : ToolTypeId is not null ? ToolTypeId.Value : 1;
return JSRuntime.InvokeVoidAsync("initRunInfo", AppSettings.ApiUrl, initialToolTypeID, initialHeaderId, initialHeaderAttachmentId).AsTask();
}
return Task.CompletedTask;