using AntDesign; using AntDesign.ProLayout; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using wispro.sp.entity; using wispro.sp.web.Services; namespace wispro.sp.web.Pages { public partial class PerformanceList { private List _Datas; IEnumerable selectedItems; int _pageIndex = 1; int _pageSize = 10; int _total = 0; bool _loading = false; PerformanceItem EditingItem = null; bool _visible = false; bool _isAdd = false; [Inject] public PerformanceItemServices _ItemService { get; set; } [Inject] public MessageService _message { get; set; } [Inject] protected NavigationManager NavigationManager { get; set; } public void HandleSelectUser(MenuItem item) { switch (item.Key) { case "reviewer": //NavigationManager.NavigateTo("/account/center"); break; case "doPerson": //NavigationManager.NavigateTo("/account/settings"); break; case "caseCoe": //authorProvider.LogoutAsync(); //NavigationManager.NavigateTo("/LoginPages"); break; case "itemCoe": //authorProvider.LogoutAsync(); //NavigationManager.NavigateTo("/LoginPages"); break; case "milPerson": //authorProvider.LogoutAsync(); //NavigationManager.NavigateTo("/LoginPages"); break; } } protected async override Task OnInitializedAsync() { _loading = true; var data = await _ItemService.GetItems(_pageIndex, _pageSize); _Datas = data.Results; _total = data.TotalCount; _loading = false; } private void OnsubShensu(PerformanceItem Item) { EditingItem = Item; _visible = true; //return new EventCallback(); } bool _ShowJXModal = false; private void OnJXCal(PerformanceItem Item) { EditingItem = Item; _ShowJXModal = true; } #region 申诉窗口事件 private void HandleOk(MouseEventArgs e) { Console.WriteLine(e); _visible = false; } private void HandleCancel(MouseEventArgs e) { Console.WriteLine(e); _visible = false; } #endregion #region 绩效计算窗口事件 private void HandleOk1(MouseEventArgs e) { Console.WriteLine(e); _ShowJXModal = false; } private void HandleCancel1(MouseEventArgs e) { Console.WriteLine(e); _ShowJXModal = false; } #endregion public AvatarMenuItem[] AvatarMenuItems { get; set; } = new AvatarMenuItem[] { new() { Key = "reviewer", IconType = "user", Option = "核稿人申诉"}, new() { Key = "doPerson", IconType = "user", Option = "处理人申诉"}, new() { Key = "caseCoe", IconType = "logout", Option = "案件系数申诉"}, new() { Key = "itemCoe", IconType = "logout", Option = "处理事项系数申诉"}, new() { Key = "milPerson", IconType = "logout", Option = "多人处理分配比率申诉"}, new() { Key = "logout", IconType = "logout", Option = "严重超期说明"}, new() { Key = "logout", IconType = "logout", Option = "涉外新申请绩效计算备注"} }; #region 文件上传控件设定 List fileList = new List { new UploadFileItem { Id = "1", FileName = "客户往来邮件1.jpg", Url = "#", State = UploadState.Success }, new UploadFileItem { Id = "2", FileName = "与客户微信聊天图片.jpg", Url = "#", State = UploadState.Success }, new UploadFileItem { Id = "3", FileName = "附件.docx", Url = "#", State = UploadState.Success } }; Dictionary attrs = new Dictionary { {"Action", "#" }, {"Name", "files" }, {"Multiple", true } }; void HandleChange(UploadInfo fileinfo) { //if (fileList.Count > 5) //{ // fileList.RemoveRange(0, fileList.Count - 2); //} //fileList.Where(file => file.State == UploadState.Success && !string.IsNullOrWhiteSpace(file.Response)).ForEach(file => { // var result = file.GetResponse(); // file.Url = result.url; //}); } public class ResponseModel { public string name { get; set; } public string status { get; set; } public string url { get; set; } public string thumbUrl { get; set; } } #endregion class shenshou { public string Type { get; set; } public int ReviewerId { get; set; } public string Reason { get; set; } public List Files { get; set; } } class CalType { public string Type { get; set; } = "按照字数计算绩效"; public int ReviewerId { get; set; } public int wordCount { get; set; } } CalType _calType = new CalType(); shenshou _shenshou = new shenshou(); List Reviewers = new List() { new Staff(){Id =1,Name ="钟子敏"}, new Staff(){Id =1,Name ="邢丽霞"}, new Staff(){Id =1,Name ="李丽"}, new Staff(){Id =1,Name ="贾凤涛"}, }; private async Task OnChange(PaginationEventArgs args) { if (_pageIndex != args.Page || _pageSize != args.PageSize) { _pageIndex = args.Page; _pageSize = args.PageSize; _loading = true; _Datas = null; var data = await _ItemService.GetItems(_pageIndex, _pageSize); //var data = response.GetAwaiter().GetResult(); _Datas = data.Results; _total = data.TotalCount; _loading = false; } } } }