Files
Web_AUTSDATA_Mvc_Prod/AUTS.Domain.ViewModels/AutsChart/Node.cs
2025-11-20 13:11:05 +08:00

37 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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; } //子节点,可以用递归的方法读取,方法在下一章会总结
}
}