MyFistPage.razor.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using AntDesign;
  2. using Microsoft.AspNetCore.Components;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using wispro.sp.entity;
  8. using wispro.sp.share;
  9. using wispro.sp.web.Services;
  10. namespace wispro.sp.web.Pages.AppCase
  11. {
  12. public partial class MyFistPage
  13. {
  14. private List<PerformanceItem> _Datas;
  15. private bool _loading = false;
  16. private int _total;
  17. [Inject] public PerformanceItemServices _ItemService { get; set; }
  18. [Inject] public MessageService _message { get; set; }
  19. [Inject] protected NavigationManager NavigationManager { get; set; }
  20. [Inject] protected IUserService _userService { get; set; }
  21. protected async override Task OnInitializedAsync()
  22. {
  23. _loading = true;
  24. //System.Diagnostics.Debug.WriteLine(_userService.CurrentUser.Userid);
  25. var _user = await _userService.GetUser();
  26. var data = await _ItemService.GetMyList(_user.Userid.Value,jxType.doing);
  27. _Datas = data.Results;
  28. _total = data.TotalCount;
  29. _loading = false;
  30. //StateHasChanged();
  31. }
  32. }
  33. }