123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using AntDesign;
- using Microsoft.AspNetCore.Components;
- 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.Project
- {
- public partial class MyProject
- {
- List<ProjectContentRecord> ProjectInfos;
- int _pageIndex = 1;
- int _pageSize = 10;
- int _total = 0;
- bool _loading = false;
- [Inject] protected PerformanceItemServices _itemService { get; set; }
- [Inject] public MessageService MsgSvr { get; set; }
- [Inject] NavigationManager _NavigationManager { get; set; }
-
- protected async override Task OnInitializedAsync()
- {
- ProjectInfos = await _itemService.GetMyProjects();
- _total = ProjectInfos.Count;
- await base.OnInitializedAsync();
- }
- public int serialNumber(int pageIndex, int pageSize, ProjectContentRecord pr)
- {
- int iIndex = ProjectInfos.IndexOf(pr);
- return iIndex + 1;
- }
- public async Task SetFinished(string CaseNo)
- {
- var result = await _itemService.SetProjectFinish(CaseNo);
- if (!result)
- {
- await MsgSvr.Error($"设定专案[{CaseNo}]为已完成时出错,请稍后再试!");
- }
- }
- private void HandlePageChange(PaginationEventArgs args)
- {
- if (_pageIndex != args.Page)
- {
- _pageIndex = args.Page;
- }
- if (_pageSize != args.PageSize)
- {
- _pageSize = args.PageSize;
- }
- }
- public void AddNew()
- {
- _NavigationManager.NavigateTo("/Project/WorkContent");
- }
- public void Edit(ProjectContentRecord projectContent)
- {
- _NavigationManager.NavigateTo($"/Project/WorkContent/{projectContent.Id}");
- }
- public void Submit(ProjectContentRecord projectContent)
- {
- }
- }
- }
|