using AntDesign; using Microsoft.AspNetCore.Components; using System; using System.Collections.Generic; using System.Globalization; using System.Threading.Tasks; using wispro.sp.share; using wispro.sp.web.Services; using System.Linq; namespace wispro.sp.web.Pages.AppCase { public partial class LevelStatistics { CultureInfo CiEn = CultureInfo.GetCultureInfo("en-US"); CultureInfo CiCn = CultureInfo.GetCultureInfo("zh-CN"); DatePicker refDate; DateTime? SelectedTime; DatePickerLocale CN = new DatePickerLocale { FirstDayOfWeek = DayOfWeek.Sunday, Lang = new DateLocale { YearFormat = "yyyy年", MonthFormat = "M月", DateSelect = "选择日期", WeekSelect = "选择周", MonthSelect = "选择月份", YearSelect = "选择年份", QuarterSelect = "选择季度", Today = "今天" } }; [Inject] PerformanceItemServices pService { get; set; } private async Task ShowSelectedDate() { if (SelectedTime != null) { int year = SelectedTime.Value.Year; int quartar = 1; if (SelectedTime.Value.Month <= 3) { quartar = 1; } else { if (SelectedTime.Value.Month <= 6) { quartar = 2; } else { if (SelectedTime.Value.Month <= 9) { quartar = 3; } else { quartar = 4; } } } await pService.StatisticsLevelCount(year, 1); await pService.StatisticsLevelCount(year, 2); await pService.StatisticsLevelCount(year, 3); } } LevelStatisticsResult AResult; LevelStatisticsResult BResult; LevelStatisticsResult CResult; LevelStatisticsResult DResult; protected override async Task OnInitializedAsync() { if(SelectedTime == null) { SelectedTime = DateTime.Now.AddMonths(-3); } AResult = await pService.CalAgentLevel(SelectedTime.Value.Year, 1, "A"); BResult = await pService.CalAgentLevel(SelectedTime.Value.Year, 1, "B"); CResult = await pService.CalAgentLevel(SelectedTime.Value.Year, 1, "C"); DResult = await pService.CalAgentLevel(SelectedTime.Value.Year, 1, "D"); await base.OnInitializedAsync(); } } }