Files
ThingsGateway/framework/UpgradeManger/ThingsGateway.UpgradeManger/Shared/MainLayout.razor

91 lines
3.8 KiB
Plaintext
Raw Normal View History

2023-06-09 15:04:54 +08:00
@*
2023-05-23 23:54:28 +08:00
//------------------------------------------------------------------------------
2023-06-09 15:04:54 +08:00
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
// 此代码版权除特别声明外的代码归作者本人Diego所有
// 源代码使用协议遵循本仓库的开源协议及附加协议
2023-07-16 17:48:22 +08:00
// Gitee源代码仓库https://gitee.com/diego2098/ThingsGateway
2023-06-09 15:04:54 +08:00
// Github源代码仓库https://github.com/kimdiego2098/ThingsGateway
2023-07-16 17:48:22 +08:00
// 使用文档https://diego2098.gitee.io/thingsgateway-docs/
2023-06-09 15:04:54 +08:00
// QQ群605534569
2023-05-23 23:54:28 +08:00
//------------------------------------------------------------------------------
*@
2023-09-30 23:05:53 +08:00
@namespace ThingsGateway.UpgradeManger
@using System.Text;
2023-08-07 15:09:53 +08:00
@inherits LayoutComponentBase
2023-03-04 18:41:11 +08:00
@layout BaseLayout
2023-09-30 23:05:53 +08:00
2023-03-27 14:27:15 +08:00
<PPageTabsProvider>
<CascadingValue Value="@this" IsFixed>
2023-08-07 15:09:53 +08:00
<CascadingValue Value="@Changed" Name="Changed">
2023-03-27 14:27:15 +08:00
<MNavigationDrawer Color="barcolor" @bind-Value="_drawerOpen" App Width="200">
2023-09-30 23:05:53 +08:00
<Logo CONFIG_COPYRIGHT=@CONFIG_COPYRIGHT CONFIG_TITLE=@CONFIG_TITLE HeightInt=@(IsMobile?BlazorResourceConst.AppBarHeight:BlazorResourceConst.AppBarHeight+BlazorResourceConst.PageTabsHeight) />
2023-08-07 15:09:53 +08:00
<AppList ClassString="overflow-y-auto" Routable
StyleString=@($"height: calc(100vh - {BlazorResourceConst.AppBarHeight+BlazorResourceConst.PageTabsHeight}px);")
Items="Navs" />
2023-03-27 14:27:15 +08:00
</MNavigationDrawer>
2023-08-07 15:09:53 +08:00
<MAppBar Color="barcolor" Style=@($"{(!(IsMobile||_drawerOpen!=true)? "left:200px;":"")}") Elevation="1" App Flat ClippedRight Dense ElevateOnScroll
MaxHeight="@(BlazorResourceConst.AppBarHeight)" Height="@(BlazorResourceConst.AppBarHeight)">
2023-03-27 14:27:15 +08:00
<MButton Class="mr-0" Icon Small=IsMobile OnClick=@(() => _drawerOpen = !_drawerOpen)>
<MIcon>mdi-menu</MIcon>
</MButton>
2023-05-22 18:40:50 +08:00
</MAppBar>
2023-03-27 14:27:15 +08:00
2023-08-07 15:09:53 +08:00
<MMain Style=@($"{(!(IsMobile||_drawerOpen!=true)? "padding-left:200px;":"")}")>
2023-03-27 14:27:15 +08:00
<div class="full-width">
2023-09-30 23:05:53 +08:00
<PageTabs @ref="_pageTabs" PageTabItems="pageTabItems" />
2023-03-27 14:27:15 +08:00
</div>
2023-05-22 18:40:50 +08:00
<MDivider Center></MDivider>
2023-08-07 15:09:53 +08:00
<MCard Flat Class="overflow-y-auto overflow-x-hidden ma-auto pa-0 rounded-0" Style=@($"height: calc(100vh - {BlazorResourceConst.AppBarHeight+BlazorResourceConst.PageTabsHeight+BlazorResourceConst.FooterHeight}px);")>
2023-09-30 23:05:53 +08:00
<PPageContainer PageTabs="@_pageTabs?.PPageTabs">
2023-03-27 14:27:15 +08:00
@Body
</PPageContainer>
</MCard>
2023-08-07 15:09:53 +08:00
<MSheet Class="d-flex justify-center align-center rounded-0" Style=@($"height: {BlazorResourceConst.FooterHeight}px;")>
<Foter CONFIG_COPYRIGHT=@CONFIG_COPYRIGHT CONFIG_COPYRIGHT_URL=@CONFIG_COPYRIGHT_URL CONFIG_TITLE=@CONFIG_TITLE></Foter>
2023-05-22 18:40:50 +08:00
</MSheet>
</MMain>
</CascadingValue>
</CascadingValue>
2023-03-27 14:27:15 +08:00
</PPageTabsProvider>
2023-09-30 23:05:53 +08:00
@code {
bool Changed { get; set; }
private bool? _drawerOpen = true;
private PageTabs _pageTabs;
/// <summary>
/// IsMobile
/// </summary>
[CascadingParameter(Name = "IsMobile")]
public bool IsMobile { get; set; }
}
@code {
private string CONFIG_COPYRIGHT = "Diego";
private string CONFIG_COPYRIGHT_URL = "https://gitee.com/diego2098/ThingsGateway";
private string CONFIG_TITLE = "ThingsGateway";
}
@code {
2023-03-04 18:41:11 +08:00
2023-09-30 23:05:53 +08:00
private List<NavItem> Navs { get; set; } = new();
private List<PageTabItem> pageTabItems { get; set; } = new();
protected override void OnInitialized()
{
var dataString =FileUtil. ReadFile($"{AppContext.BaseDirectory}Navs.json");//读取文件
Navs=dataString.FromJsonString<List<NavItem>>();
pageTabItems = Navs.PasePageTabItem();
base.OnInitialized();
}
2023-03-04 18:41:11 +08:00
2023-09-30 23:05:53 +08:00
}