update:树节点工具根节点值
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ewide.Core
|
namespace Ewide.Core
|
||||||
@@ -36,7 +37,7 @@ namespace Ewide.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 顶级节点的父节点Id(默认0)
|
/// 顶级节点的父节点Id(默认0)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly string _rootParentId = System.Guid.Empty.ToString().ToLower();
|
private readonly List<string> _rootParentIds = new List<string> {string.Empty,Guid.Empty.ToString() };
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造树节点
|
/// 构造树节点
|
||||||
@@ -50,7 +51,7 @@ namespace Ewide.Core
|
|||||||
var results = new List<T>();
|
var results = new List<T>();
|
||||||
nodes.ForEach(u =>
|
nodes.ForEach(u =>
|
||||||
{
|
{
|
||||||
if (_rootParentId == u.GetPid())
|
if (_rootParentIds.Contains(u.GetPid()))
|
||||||
results.Add(u);
|
results.Add(u);
|
||||||
});
|
});
|
||||||
return results;
|
return results;
|
||||||
|
|||||||
Reference in New Issue
Block a user