Skip to content

Commit

Permalink
prepare 5.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliang-wt committed Jul 4, 2022
1 parent 3a4984d commit 3de58ba
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 30 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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直接使用的问题
Expand Down Expand Up @@ -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直接使用的问题
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,42 +244,69 @@
var usermenu = UserInfo.Attributes["Menus"] as WalkingTec.Mvvm.Core.Support.Json.SimpleMenuApi[];

var formatedmenu = new List<FrameworkMenu>();
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<FrameworkMenu>()
});
}
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<FrameworkMenu>()
});
}
}
}
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<FrameworkMenu>()
// });
// }
// 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<FrameworkMenu>()
// });
// }
// }
//}
GetMenuFromFrameworkMenu(formatedmenu).ForEach(x => menus.Add(x));
}
Menus = menus;

tenants = await wtmblazor.Api.CallItemsApi($"/api/_frameworktenant/GetFrameworkTenants?parent={UserInfo.TenantCode}");
await base.OnInitializedAsync();
}

/// <summary>
/// 整理为树形
/// </summary>
/// <param name="origs">来源列表</param>
/// <param name="parentID">当前级的父ID</param>
/// <returns></returns>
private List<FrameworkMenu> toMenuTree(IQueryable<WalkingTec.Mvvm.Core.Support.Json.SimpleMenuApi> origs,string parentID=null)
{
var rets = new List<FrameworkMenu>();
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<FrameworkMenu>()
};
_item.Children.AddRange(toMenuTree(origs, item.Id));
rets.Add(_item);
}
return rets;
}

private List<BootstrapBlazor.Components.MenuItem> GetMenuFromFrameworkMenu(List<FrameworkMenu> input)
{
Expand Down
2 changes: 1 addition & 1 deletion version.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>5.9.5</VersionPrefix>
<VersionPrefix>5.9.6</VersionPrefix>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down

0 comments on commit 3de58ba

Please sign in to comment.