using APT.BaseData.Domain.ApiModel;
using APT.BaseData.Domain.ApiModel.PF;
using APT.Infrastructure.Core;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace APT.MS.Domain.ApiModel.PF
{


    [Description("首页显示实体")]
    public class HomePageModel
    {
        public HomePageModel()
        {
            StatisticsData = new List<dynamic>();
            ChartData = new List<dynamic>();
            RankingData = new List<dynamic>();
            HmiData = new List<dynamic>();
        }
        [Description("统计区域数据")]
        [EnumName("HomePageStatisticsEnum")]
        public List<dynamic> StatisticsData { get; set; }

        [Description("图表区域数据")]
        [EnumName("HomePageChartEnum")]
        public List<dynamic> ChartData { get; set; }

        [Description("排名区域数据")]
        [EnumName("HomePageRankingEnum")]
        public List<dynamic> RankingData { get; set; }

        //特殊，只是为了标识，配置时候配置HMI的Code
        [Description("HMI数据")]
        [EnumName("HomePageHmiEnum")]
        public List<dynamic> HmiData { get; set; }
        [Description("排名区域数据")]
        public Guid UserId { get; set; }

        [Description("表单编码")]
        public string FromCode { get; set; }

    }



    [Description("统计区域属性")]
    public class StatisticsProps:PropsBase
    {
        public StatisticsProps()
        {
            Data = new HomePageItem();
        }
        [Description("数据")]
        public HomePageItem Data { get; set; }
    }


    [Description("图表区域属性")]
    public class ChartProps : PropsBase
    {
        public ChartProps()
        {
            Data = new List<HomeChartDataModel>();
        }

        [Description("数据")]
        public List<HomeChartDataModel> Data { get; set; }
    }

    public class HomeChartDataModel
    {
        public string Name { get; set; }

        public ChartDataModel Data { get; set; }
    }


    [Description("排名区域")]
    public class RankingProps:PropsBase
    {

        [Description("数据")]
        public HomePageTableModel Data { get; set; }
    }


    [Description("区域基类")]
    public  class PropsBase
    {
        [Description("编码")]
        public string Code { get; set; }
        [Description("名称")]
        public string Name { get; set; }
        [Description("是否选中")]
        public bool IsCheck { get; set; }

    }

    ///// <summary>
    ///// 首页配置
    ///// </summary>
    //public class HomePageSetting
    //{
    //    public HomePageSetting()
    //    {
    //        StatisticsData = new List<HomePageItem>();
    //        ChartData = new List<HomePageItem>();
    //        RankingData = new List<HomePageItem>();
    //    }
    //    /// <summary>
    //    /// 统计数据
    //    /// </summary>
    //    public List<HomePageItem> StatisticsData { get; set; }
    //    /// <summary>
    //    /// 图表数据
    //    /// </summary>
    //    public List<HomePageItem> ChartData { get; set; }
    //    /// <summary>
    //    /// 排名数据
    //    /// </summary>
    //    public List<HomePageItem> RankingData { get; set; }
    //    /// <summary>
    //    /// 用户ID
    //    /// </summary>
    //    public Guid UserId { get; set; }
    //}

    public class HomePageItem
    {

        [Description("值")]
        public string Val { get; set; }
        [Description("单位")]
        public string Unit { get; set; }
     
    }

    public class HomePageCheckSeeting
    {
        public DateTime Time { get; set; }

        public dynamic Prop { get; set; }
    }

    public class HomePageTableModel
    {
        public List<HomePageTableData> dataSource { get; set; }
        
        public List<Column> columns { get; set; }
    }

    public class HomePageTableData
    {
        public int Ranking { get; set; }

        public string Name { get; set; }

        public string Value { get; set; }
    }
}
