初始化项目
This commit is contained in:
36
AUTS.Domain.ViewModels/AutsChart/Node.cs
Normal file
36
AUTS.Domain.ViewModels/AutsChart/Node.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AUTS.Domain.ViewModels.AutsChart
|
||||
{
|
||||
public class Node
|
||||
{
|
||||
public Node() { }
|
||||
public Node(int id, string str, string img, List<Node> node, string color,string backgroundcolor ="")
|
||||
{
|
||||
nodeId = id;
|
||||
text = str;
|
||||
nodes = node;
|
||||
icon = img;
|
||||
this.color = color;
|
||||
this.backColor = backgroundcolor;
|
||||
}
|
||||
public Node(int id, string str, List<Node> node, string color, string backgroundcolor = "")
|
||||
{
|
||||
nodeId = id;
|
||||
text = str;
|
||||
nodes = node;
|
||||
this.color = color;
|
||||
this.backColor = backgroundcolor;
|
||||
}
|
||||
public int nodeId { get; set; } //树的节点Id,区别于数据库中保存的数据Id。若要存储数据库数据的Id,添加新的Id属性;若想为节点设置路径,类中添加Path属性
|
||||
public string text { get; set; } //节点名称
|
||||
public string icon { get; set; }
|
||||
public string color { get; set; }
|
||||
public string backColor { get; set; }
|
||||
public List<Node> nodes { get; set; } //子节点,可以用递归的方法读取,方法在下一章会总结
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user