菜单排序修改
parent
c11ede3fc1
commit
ef081aa373
|
|
@ -11,6 +11,7 @@ using Infrastructure.Helpers;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Infrastructure.Extensions;
|
using Infrastructure.Extensions;
|
||||||
using Infrastructure.Utilities;
|
using Infrastructure.Utilities;
|
||||||
|
using NPOI.POIFS.Properties;
|
||||||
|
|
||||||
namespace OpenAuth.WebApi.Controllers
|
namespace OpenAuth.WebApi.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -192,7 +193,7 @@ namespace OpenAuth.WebApi.Controllers
|
||||||
|
|
||||||
foreach (var module in modules)
|
foreach (var module in modules)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(module.ParentId) ||module.ParentId == "0")
|
if (string.IsNullOrEmpty(module.ParentId) || module.ParentId == "0")
|
||||||
{
|
{
|
||||||
rootNodes.Add(modulesMap[module.Id]);
|
rootNodes.Add(modulesMap[module.Id]);
|
||||||
}
|
}
|
||||||
|
|
@ -201,7 +202,10 @@ namespace OpenAuth.WebApi.Controllers
|
||||||
parentNode.Children.Add(modulesMap[module.Id]);
|
parentNode.Children.Add(modulesMap[module.Id]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach (var moduleView in rootNodes)
|
||||||
|
{
|
||||||
|
moduleView.Children.Sort((a, b) => a.SortNo.CompareTo(b.SortNo));
|
||||||
|
}
|
||||||
return rootNodes.OrderBy(a => a.SortNo);
|
return rootNodes.OrderBy(a => a.SortNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -247,7 +251,9 @@ namespace OpenAuth.WebApi.Controllers
|
||||||
var result = new Response<IEnumerable<TreeItem<ModuleView>>>();
|
var result = new Response<IEnumerable<TreeItem<ModuleView>>>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result.Result = _authStrategyContext.Modules.WhereIF(!string.IsNullOrEmpty(typeid), a => a.ModuleTypeId == typeid).OrderBy(a => a.SortNo).GenerateTree(u => u.Id, u => u.ParentId, "0");
|
result.Result = _authStrategyContext.Modules
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(typeid), a => a.ModuleTypeId == typeid).OrderBy(a => a.SortNo)
|
||||||
|
.GenerateTree(u => u.Id, u => u.ParentId, "0");
|
||||||
}
|
}
|
||||||
catch (CommonException ex)
|
catch (CommonException ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue