using System.Collections.Generic; namespace Znyc.Cloudcar.Admin.Commons.Tree { /// /// 树形视图模型 /// public class TreeViewModel { /// /// 构造函数 /// public TreeViewModel() { nodes = new List(); } /// /// 构造函数 /// /// j节点Id /// 父节点Id public TreeViewModel(int nodeId, int pId) { this.nodeId = nodeId; pid = pId; nodes = new List(); } /** * 生成一个节点 * @param nodeId * @param pId * @param text * @param icon * @param href */ public TreeViewModel(int nodeId, int pId, string text, string icon, string href) { this.nodeId = nodeId; pid = pId; this.text = text; this.icon = icon; this.href = href; nodes = new List(); } /// /// 树的节点Id,区别于数据库中保存的数据Id /// public long nodeId { get; set; } /// /// 树的父节点Id /// public long pid { get; set; } /// /// 节点名称 /// public string text { get; set; } /// /// 节点图标 /// public string icon { get; set; } /// /// 点击节点触发的链接 /// public string href { get; set; } /// /// 子节点 /// public List nodes { get; set; } /// /// 节点标签 /// public long tags { get; set; } /// /// 节点状态 /// public TreeViewSateModel state { get; set; } } /// /// 树形视图节点选择状态 /// public class TreeViewSateModel { /// /// 选中 /// public bool @checked { get; set; } /// /// 显示或隐藏 /// public bool? disabled { get; set; } /// /// 展开 /// public bool? expanded { get; set; } /// /// 选中 /// public bool? selected { get; set; } } }