2023-03-04 18:41:11 +08:00
|
|
|
@inherits LayoutComponentBase
|
|
|
|
|
@namespace ThingsGateway.Web.Rcl
|
|
|
|
|
@using Masa.Blazor;
|
|
|
|
|
@implements IDisposable
|
|
|
|
|
<CascadingValue Value="IsMobile" Name="IsMobile">
|
|
|
|
|
<MApp>
|
2023-05-22 18:40:50 +08:00
|
|
|
<MErrorHandler>
|
2023-03-04 18:41:11 +08:00
|
|
|
@Body
|
|
|
|
|
</MErrorHandler>
|
|
|
|
|
</MApp>
|
|
|
|
|
</CascadingValue>
|
|
|
|
|
@code {
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
UserResoures UserResoures { get; set; }
|
|
|
|
|
[Inject]
|
|
|
|
|
public MasaBlazor MasaBlazor { get; set; }
|
|
|
|
|
[Inject]
|
|
|
|
|
IPopupService PopupService { get; set; }
|
|
|
|
|
[Inject]
|
2023-05-22 18:40:50 +08:00
|
|
|
JsInitVariables JsInitVariables { get; set; }
|
2023-03-04 18:41:11 +08:00
|
|
|
public bool IsMobile { get; set; }
|
|
|
|
|
protected async override Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
|
{
|
2023-04-15 20:48:56 +08:00
|
|
|
await JsInitVariables.SetTimezoneOffsetAsync();
|
2023-03-04 18:41:11 +08:00
|
|
|
await base.OnAfterRenderAsync(firstRender);
|
|
|
|
|
}
|
|
|
|
|
protected override void OnInitialized()
|
|
|
|
|
{
|
|
|
|
|
base.OnInitialized();
|
|
|
|
|
MasaBlazor.Breakpoint.MobileBreakpoint = 666;
|
|
|
|
|
MasaBlazor.Breakpoint.OnUpdate += BreakpointOnOnUpdate;
|
|
|
|
|
}
|
|
|
|
|
private async Task BreakpointOnOnUpdate()
|
|
|
|
|
{
|
|
|
|
|
IsMobile = MasaBlazor.Breakpoint.Mobile;
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
await Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
MasaBlazor.Breakpoint.OnUpdate -= BreakpointOnOnUpdate;
|
|
|
|
|
}
|
|
|
|
|
}
|