12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using AntDesign;
- using AntDesign.TableModels;
- using Microsoft.AspNetCore.Components;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.Json;
- using System.Threading.Tasks;
- using wispro.sp.entity;
- using wispro.sp.web.Services;
- namespace wispro.sp.web.Pages.Project
- {
- public partial class ProjectSearch
- {
- List<ProjectInfo> ProjectInfos;
- int _pageIndex = 1;
- int _pageSize = 10;
- int _total = 0;
- bool _loading = false;
- ITable table;
- [Inject] protected PerformanceItemServices _itemService { get; set; }
- [Inject] public MessageService MsgSvr { get; set; }
- protected async override Task OnInitializedAsync()
- {
- ProjectInfos = await _itemService.GetAllProjects();
- _total = ProjectInfos.Count;
- await base.OnInitializedAsync();
- }
- public int serialNumber(int pageIndex, int pageSize, string name)
- {
- int iIndex = 0;
-
- foreach (ProjectInfo sf in ProjectInfos)
- {
- iIndex++;
- if (sf.CaseNo == name)
- {
- break;
- }
- }
- return iIndex;
- }
- public async Task SetFinished(string CaseNo)
- {
- var result = await _itemService.SetProjectFinish(CaseNo);
- if (!result)
- {
- await MsgSvr.Error($"设定专案[{CaseNo}]为已完成时出错,请稍后再试!");
- }
- }
- public async Task OnChange(QueryModel<ProjectInfo> queryModel)
- {
- Console.WriteLine(JsonSerializer.Serialize(queryModel));
- }
- private void HandlePageChange(PaginationEventArgs args)
- {
- if (_pageIndex != args.Page)
- {
- _pageIndex = args.Page;
- }
- if (_pageSize != args.PageSize)
- {
- _pageSize = args.PageSize;
- }
- }
- }
- }
|