using System.Collections;
using System.Collections.Generic;

namespace Ewide.Core.Service
{
    /// <summary>
    /// 菜单树---授权、新增编辑时选择
    /// </summary>
    public class MenuTreeOutput : ITreeNode
    {
        /// <summary>
        /// 主键
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 父Id
        /// </summary>
        public string ParentId { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 值
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// 菜单类型
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// 关联显示父级
        /// </summary>
        public bool VisibleParent { get; set; }

        /// <summary>
        /// 权限标识
        /// </summary>
        public string Permission { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 排序，越小优先级越高
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 子节点
        /// </summary>
        public List<MenuTreeOutput> Children { get; set; } = new List<MenuTreeOutput>();

        public string GetId()
        {
            return Id;
        }

        public string GetPid()
        {
            return ParentId;
        }

        public void SetChildren(IList children)
        {
            Children = (List<MenuTreeOutput>)children;
        }
    }
}
