123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using AntDesign;
- using Microsoft.AspNetCore.Components;
- using System.Collections.Generic;
- using System;
- using wispro.sp.entity.CompareCase;
- using wispro.sp.entity;
- using AntDesign.TableModels;
- using System.Threading.Tasks;
- using wispro.sp.web.Services;
- using wispro.sp.share;
- namespace wispro.sp.web.Pages.CompareFile
- {
- public partial class List
- {
- [Inject] public CompareFileService _CompareFileService { get; set; }
- int _pageIndex = 1;
- int _pageSize = 10;
- Pagination _pagination;
- int _total;
- bool _loading = false;
- QueryFilter _filter;
- Field _selectedItem;
- List<CaseInfo> _caseList;
- List<Field> _fields = new List<Field>() {
- new Field(){ FieldName="处理人",FieldValue="Handlers"},
- new Field(){ FieldName="审核人",FieldValue="Reviewer.Name"},
- new Field(){ FieldName="客户",FieldValue="Customer.Name"},
- new Field(){ FieldName="案号",FieldValue="CaseNo"},
- new Field(){ FieldName="案件名称",FieldValue="CaseName"}
- };
- protected override async Task OnInitializedAsync()
- {
- _filter = new QueryFilter();
- _filter.PageIndex = 1;
- _filter.PageSize = 1;
- await GetData();
- StateHasChanged();
-
- }
- private void OnSelectedItemChangedHandler(Field value)
- {
- _selectedItem = value;
- }
- private string txtValue = string.Empty;
- private async void OnSearch()
- {
- if (!string.IsNullOrEmpty(txtValue))
- {
- _filter.ConditionTree.Clear();
- _filter.ConditionTree.Add(
- new FieldCondition()
- {
- FieldName = _selectedItem.FieldValue,
- LogicOperate = LogicEnum.And,
- Operator = OperatorEnum.Contains,
- Value = txtValue,
- ValueType = "System.String"
- }
- );
- }
- await GetData();
- StateHasChanged();
- }
- private int serialNumber(int pageIndex, int pageSize, int id)
- {
- int iIndex = 0;
- foreach (CaseInfo sf in _caseList)
- {
- iIndex++;
- if (sf.Id == id)
- {
- break;
- }
- }
- return (pageIndex - 1) * pageSize + iIndex;
- }
- CaseInfo _currentCase = null;
- private void Showdetail(CaseInfo caseInfo)
- {
- _currentCase = caseInfo;
- }
- private async Task GetData()
- {
- _loading = true;
- var data = await _CompareFileService.Query(_filter);
- _caseList = data.Results;
- _total = data.TotalCount;
- _loading = false;
- StateHasChanged();
- }
- async void OnPageChange(PaginationEventArgs args)
- {
- _pageIndex = args.Page;
- _pageSize = args.PageSize;
- await GetData();
- StateHasChanged();
- }
- class Field
- {
- public string FieldName { get; set; }
- public string FieldValue { get; set; }
- }
- }
- }
|