Client Hub Project
This commit is contained in:
33
ClientHub/Pages/Export.razor.cs
Normal file
33
ClientHub/Pages/Export.razor.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace OI.Metrology.ClientHub.Pages;
|
||||
|
||||
public partial class Export
|
||||
{
|
||||
|
||||
[Inject] protected IJSRuntime? JSRuntime { get; set; }
|
||||
[Parameter] public Metrology.Shared.ViewModels.Export? Model { get; set; }
|
||||
|
||||
public Export()
|
||||
{
|
||||
Model ??= new()
|
||||
{
|
||||
ToolType = "",
|
||||
StartTime = DateTime.Now.AddMonths(-1),
|
||||
EndTime = DateTime.Now
|
||||
};
|
||||
}
|
||||
|
||||
protected override Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
if (JSRuntime is null)
|
||||
throw new NullReferenceException(nameof(JSRuntime));
|
||||
return JSRuntime.InvokeVoidAsync("initExport", DateTime.Now.AddMonths(-1), DateTime.Now).AsTask();
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user