diff --git a/CHANGELOG.md b/CHANGELOG.md index fb34995ad..16e5b2ff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## v6.x.x +##6.2.6(2022-7-5) +* **修改:** 修复Jwt登录时间验证的问题 +* **修改:** 修复Layui模式中Tree控件禁用的问题 +* **修改:** 移除过时引用 +* **修改:** 修复主键类型为string时Crud的问题 +* **修改:** 修复WtmJob Displose时的bug +* **修改:** 优化Blazor菜单,感谢akin的PR + ##6.2.4(2022-6-16) * **修改:** 优化登录 * **修改:** 修复WtmFileProvider直接使用的问题 @@ -91,6 +99,14 @@ ## v5.x.x +##5.9.6(2022-7-5) +* **修改:** 修复Jwt登录时间验证的问题 +* **修改:** 修复Layui模式中Tree控件禁用的问题 +* **修改:** 移除过时引用 +* **修改:** 修复主键类型为string时Crud的问题 +* **修改:** 修复WtmJob Displose时的bug +* **修改:** 优化Blazor菜单,感谢akin的PR + ##5.9.4(2022-6-16) * **修改:** 优化登录 * **修改:** 修复WtmFileProvider直接使用的问题 diff --git a/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Shared/Shared/MainLayout.razor b/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Shared/Shared/MainLayout.razor index d996cc74c..1de4f5e59 100644 --- a/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Shared/Shared/MainLayout.razor +++ b/demo/WalkingTec.Mvvm.BlazorDemo/WalkingTec.Mvvm.BlazorDemo.Shared/Shared/MainLayout.razor @@ -244,35 +244,36 @@ var usermenu = UserInfo.Attributes["Menus"] as WalkingTec.Mvvm.Core.Support.Json.SimpleMenuApi[]; var formatedmenu = new List(); - foreach (var item in usermenu) - { - if (item.ParentId == null) - { - formatedmenu.Add(new FrameworkMenu - { - ID = new Guid(item.Id), - PageName = item.Text, - Icon = item.Icon, - Url = item.Url, - Children = new List() - }); - } - else - { - var parent = formatedmenu.Where(x => x.ID.ToString() == item.ParentId).FirstOrDefault(); - if (parent != null) - { - parent.Children.Add(new FrameworkMenu - { - ID = new Guid(item.Id), - PageName = item.Text, - Icon = item.Icon, - Url = item.Url, - Children = new List() - }); - } - } - } + formatedmenu.AddRange(toMenuTree(usermenu.AsQueryable())); + //foreach (var item in usermenu) + //{ + // if (item.ParentId == null) + // { + // formatedmenu.Add(new FrameworkMenu + // { + // ID = new Guid(item.Id), + // PageName = item.Text, + // Icon = item.Icon, + // Url = item.Url, + // Children = new List() + // }); + // } + // else + // { + // var parent = formatedmenu.Where(x => x.ID.ToString() == item.ParentId).FirstOrDefault(); + // if (parent != null) + // { + // parent.Children.Add(new FrameworkMenu + // { + // ID = new Guid(item.Id), + // PageName = item.Text, + // Icon = item.Icon, + // Url = item.Url, + // Children = new List() + // }); + // } + // } + //} GetMenuFromFrameworkMenu(formatedmenu).ForEach(x => menus.Add(x)); } Menus = menus; @@ -280,6 +281,32 @@ tenants = await wtmblazor.Api.CallItemsApi($"/api/_frameworktenant/GetFrameworkTenants?parent={UserInfo.TenantCode}"); await base.OnInitializedAsync(); } + + /// + /// 整理为树形 + /// + /// 来源列表 + /// 当前级的父ID + /// + private List toMenuTree(IQueryable origs,string parentID=null) + { + var rets = new List(); + var _thisList = origs.Where(t => t.ParentId==parentID); + foreach (var item in _thisList) + { + var _item = new FrameworkMenu + { + ID = new Guid(item.Id), + PageName = item.Text, + Icon = item.Icon, + Url = item.Url, + Children = new List() + }; + _item.Children.AddRange(toMenuTree(origs, item.Id)); + rets.Add(_item); + } + return rets; + } private List GetMenuFromFrameworkMenu(List input) { diff --git a/version.props b/version.props index 4b06ec8e8..675650da1 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@ - 5.9.5 + 5.9.6