feat: 菜单默认全部展开
This commit is contained in:
parent
35cc0f5174
commit
e3b67c9427
|
@ -1,8 +1,8 @@
|
|||
@page "/Admin/Menus"
|
||||
|
||||
<AdminTable TItem="DataAccess.Models.Navigation"
|
||||
IsTree="true" OnTreeExpand="OnTreeExpand" TreeNodeConverter="TreeNodeConverter" ExtendButtonColumnWidth="200"
|
||||
CustomerSearchModel="SearchModel" OnQueryAsync="OnQueryAsync">
|
||||
IsTree="true" OnTreeExpand="OnTreeExpand" TreeNodeConverter="TreeNodeConverter" ModelEqualityComparer="ModelEqualityComparer"
|
||||
ExtendButtonColumnWidth="200" CustomerSearchModel="SearchModel" OnQueryAsync="OnQueryAsync">
|
||||
<TableToolbarTemplate>
|
||||
<TableToolbarButton TItem="DataAccess.Models.Navigation" Color="Color.Info" Icon="fa fa-sitemap" Text="分配角色"
|
||||
IsEnableWhenSelectedOneRow="true" IsShow="@AuthorizeButton("assignRole")"
|
||||
|
|
|
@ -141,12 +141,12 @@ public partial class Menus
|
|||
ret.AddRange(items.Where(i => i.ParentId == parentId).Select((nav, index) => new TableTreeNode<Navigation>(nav)
|
||||
{
|
||||
HasChildren = navs.Any(i => i.ParentId == nav.Id),
|
||||
IsExpand = false,
|
||||
// 获得子项集合
|
||||
// IsExpand = navs.Any(i => i.ParentId == nav.Id)
|
||||
// Items = BuildTreeNodes(navs.Where(i => i.ParentId == nav.Id), nav.Id)
|
||||
IsExpand = navs.Any(i => i.ParentId == nav.Id),
|
||||
Items = BuildTreeNodes(navs.Where(i => i.ParentId == nav.Id), nav.Id)
|
||||
}));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
private bool ModelEqualityComparer(Navigation x, Navigation y) => x.Id == y.Id;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue