_currentChartType

    dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "";
                dic["_currentChartType"] = "w2d";
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "日";
                dic["_currentChartType"] = "m2d";
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "月";
                dic["_currentChartType"] = "y2m";
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "时";
                dic["_currentChartType"] = "d2h";
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "分";
                dic["_currentChartType"] = "h2m";
 //#region 时间轴参数
            if (dic.ContainsKey("_filterDateId") && new List<string> { "12" }.Contains(dic["_filterDateId"]?.ToString()))
            {
                //12 当时间 to 5分钟
                List<string> lst = new List<string>();
                for (int i = 0; i < 60; i = i + 5)
                {
                    lst.Add(i.ToString());
                }
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "分";
                dic["_currentChartType"] = "h2m";
            }
            else if (dic.ContainsKey("_filterDateId") && new List<string> { "6", "10", "11" }.Contains(dic["_filterDateId"]?.ToString()))
            {
                //6 当日  10 明日 11 昨日  日2小时
                List<string> lst = new List<string>();
                for (int i = 0; i <= 23; i++)
                {
                    lst.Add(i.ToString());
                }
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "时";
                dic["_currentChartType"] = "d2h";
            }
            else if (dic.ContainsKey("_filterDateId") && new List<string> { "7", "5", "4" }.Contains(dic["_filterDateId"]?.ToString()))
            {
                //7 明年  4 今年 5 去年  年2月
                List<string> lst = new List<string>();
                for (int i = 1; i <= 12; i++)
                {
                    lst.Add(i.ToString());
                }
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "月";
                dic["_currentChartType"] = "y2m";
            }
            else if (dic.ContainsKey("_filterDateId") && new List<string> { "1", "0", "8" }.Contains(dic["_filterDateId"]?.ToString()))
            {
                //1 上月  0 本月 8下月  月2日
                List<string> lst = new List<string>();
                var date = DateTimeUtil.Now();
                var _filterDateId = dic["_filterDateId"]?.ToString();
                if (_filterDateId == "1")
                {
                    date = date.AddMonths(-1);
                }
                else if (_filterDateId == "8")
                {
                    date = date.AddMonths(+1);
                }
                var days = DateTime.DaysInMonth(date.Year, date.Month);
                for (int i = 1; i <= days; i++)
                {
                    lst.Add(i.ToString());
                }
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "日";
                dic["_currentChartType"] = "m2d";
            }
            else if (dic.ContainsKey("_filterDateId") && new List<string> { "3", "2", "9" }.Contains(dic["_filterDateId"]?.ToString()))
            {
                //3 上周  2 本周 8下周  周2日
                List<string> lst = new List<string>();
                var dateS = Convert.ToDateTime(dic[SystemParamConst.CURRENT_WEEK_S]);
                var dateE = Convert.ToDateTime(dic[SystemParamConst.CURRENT_WEEK_E]);
                var _filterDateId = dic["_filterDateId"]?.ToString();
                if (_filterDateId == "8")
                {
                    dateS = Convert.ToDateTime(dic[SystemParamConst.CURRENT_NEXT_WEEK_S]);
                    dateE = Convert.ToDateTime(dic[SystemParamConst.CURRENT_NEXT_WEEK_E]);
                }
                else if (_filterDateId == "3")
                {
                    dateS = Convert.ToDateTime(dic[SystemParamConst.CURRENT_PREV_WEEK_S]);
                    dateE = Convert.ToDateTime(dic[SystemParamConst.CURRENT_PREV_WEEK_E]);
                }
                for (int i = 0; i < 7; i++)
                {
                    lst.Add(dateS.AddDays(i).ToString("yyyy-MM-dd"));
                }
                dic["_currentChartRange"] = lst;
                dic["_currentChartUnit"] = "";
                dic["_currentChartType"] = "w2d";
            }
            //#endregion 时间轴参数
文档更新时间: 2022-09-05 09:41   作者:admin