using Hotline.CallCenter.Calls;
using Hotline.Share.Enums.Settings;
using SqlSugar;
using System.ComponentModel;
using XF.Domain.Entities;
using XF.Domain.Repository;

namespace Hotline.Settings
{
    [Description("菜单")]
    public class SystemMenu : CreationEntity
    {

        /// <summary>
        /// 页面名称
        /// </summary>
        public string PageName { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int DisplayOrder { get; set; }

        /// <summary>
        /// 上级ID
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string ParentId { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public EMenuType? MenuType { get; set; }

        /// <summary>
        /// 功能点Code
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string PermissionCode { get; set; }

        /// <summary>
        /// 是否显示
        /// </summary>
        public bool IsHide { get; set; }

        /// <summary>
        /// 重定向地址
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Redirect { get; set; }

        /// <summary>
        /// 是否外链
        /// </summary>
        public bool IsLink { get; set; }

        /// <summary>
        /// 外部连接
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Link { get; set; }

        /// <summary>
        /// 路由路径
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Path { get; set; }

        /// <summary>
        /// 是否缓存
        /// </summary>
        public bool IsKeepAlive { get; set; }

        /// <summary>
        /// 是否固定
        /// </summary>
        public bool IsAffix { get; set; }

        /// <summary>
        /// 是否内嵌
        /// </summary>
        public bool IsIframe { get; set; }

        /// <summary>
        /// 路由名称
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string RuleName{ get; set; }

        /// <summary>
        /// 组件路径
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Component { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Icon { get; set; }

        /// <summary>
        /// 是否可为快捷
        /// </summary>
        public bool IsFast { get; set; }

        /// <summary>
        /// 快捷图标
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string FastIcon { get; set; }

        /// <summary>
        /// 前端权限编码
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string ForePermissionCode { get; set; }

        [SugarColumn(IsIgnore = true)]
        public List<SystemMenu> children { get; set; }

        //[SugarColumn(IsIgnore = true)]
        //[Navigate(NavigateType.OneToMany, nameof(SystemButton.MenuId))]
        //public List<SystemButton> ButtonArr { get; set; }
    }
}
