增加tab右键菜单

This commit is contained in:
Diego
2025-06-11 22:57:00 +08:00
parent dcba7b9810
commit 28bd751d44
9 changed files with 60 additions and 8 deletions

View File

@@ -26,6 +26,10 @@
height: var(--line-chart-table-height);
}
.wb-control .wb-full {
display: none;
}
.dialog-table {
height: calc(100vh - 200px);
}

View File

@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<PluginVersion>10.7.50</PluginVersion>
<ProPluginVersion>10.7.50</ProPluginVersion>
<PluginVersion>10.7.51</PluginVersion>
<ProPluginVersion>10.7.51</ProPluginVersion>
<AuthenticationVersion>2.5.0</AuthenticationVersion>
<NET8Version>8.0.17</NET8Version>
<NET9Version>9.0.6</NET9Version>

View File

@@ -104,9 +104,10 @@ public partial class PluginDebugPage
{
Title = pluginInfo.Name,
ContentTemplate = debugRender,
Width = "1200px",
Height = "800px",
Top = "100px",
Max = false,
Width = "1440px",
Height = "810px",
Top = "70px",
Left = "220px",
Background = "var(--bb-primary-color)",
};

View File

@@ -86,12 +86,18 @@
</div>
</Side>
<Main>
<Tab @ref=_tab ClickTabToNavigation="true" ShowToolbar="true" ShowContextMenu="true" ShowContextMenuFullScreen="true" ShowExtendButtons="false" ShowClose="true" AllowDrag=true
<Tab @ref=_tab ClickTabToNavigation="true" ShowToolbar="true" ShowContextMenu="true" ShowContextMenuFullScreen="true" ShowExtendButtons="false" ShowClose="true" AllowDrag=true
AdditionalAssemblies="@App.RazorAssemblies" Menus="@MenuService.AllOwnMenuItems"
DefaultUrl=@("/") Body=@(Body!) OnCloseTabItemAsync=@((a)=>
{
return Task.FromResult(!(a.Url=="/"||a.Url.IsNullOrEmpty()));
})>
<BeforeContextMenuTemplate>
<ContextMenuItem Icon="fa fa-window-restore" Text="@Localizer["WindowRestore"]" OnClick="WinboxRender"></ContextMenuItem>
<ContextMenuDivider></ContextMenuDivider>
</BeforeContextMenuTemplate>
</Tab>
</Main>
<NotAuthorized>

View File

@@ -124,6 +124,39 @@ public partial class MainLayout : IDisposable
#endregion
private async Task WinboxRender(ContextMenuItem item, object? context)
{
if (context is TabItem tabItem)
{
await WinboxRender(tabItem.ChildContent, tabItem.Text);
await _tab.RemoveTab(tabItem);
}
}
[Inject]
[NotNull]
private WinBoxService? WinBoxService { get; set; }
private async Task WinboxRender(RenderFragment item, string title)
{
if (item != null)
{
var option = new WinBoxOption()
{
Title = title,
ContentTemplate = item,
Max = false,
Width = "1440px",
Height = "810px",
Top = "70px",
Left = "220px",
Background = "var(--bb-primary-color)",
};
await WinBoxService.Show(option);
}
}
private string _versionString = string.Empty;
[Inject]
[NotNull]

View File

@@ -1,4 +1,10 @@
::deep .avatar {

.mainlayout ::deep .menu-icon {
width: 16px;
}
::deep .avatar {
border-radius: 1.5rem;
width: 28px;
height: 28px;

View File

@@ -46,6 +46,7 @@
"Welcome": "Welcome"
},
"ThingsGateway.Server.MainLayout": {
"WindowRestore": "FloatingWindow",
"变量管理": "Variable",
"采集设备": "CollectionDevices",
"菜单管理": "Menu",

View File

@@ -46,6 +46,7 @@
"Welcome": "欢迎使用"
},
"ThingsGateway.Server.MainLayout": {
"WindowRestore": "浮动小窗",
"变量管理": "变量管理",
"采集设备": "采集设备",
"菜单管理": "菜单管理",

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>10.7.50</Version>
<Version>10.7.51</Version>
</PropertyGroup>
<ItemGroup>