CreateAppeal.razor.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using AntDesign;
  2. using Microsoft.AspNetCore.Components;
  3. using Microsoft.AspNetCore.Components.Forms;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text.Json;
  8. using System.Threading.Tasks;
  9. using wispro.sp.entity;
  10. using wispro.sp.web.Services;
  11. namespace wispro.sp.web.Components
  12. {
  13. public partial class CreateAppeal
  14. {
  15. public PerformanceItem _Item;
  16. public int _AppealTypeId;
  17. [Inject]
  18. protected AppealTypeService _atService { get; set; }
  19. private List<InputField> inputFields;
  20. private List<InputFieldValue> inputFieldValues;
  21. private AppealType _CurrentAppealType;
  22. private AppealRecord aRecord;
  23. public async Task SetParameter(PerformanceItem item, int appealTypeId)
  24. {
  25. _Item = item;
  26. _AppealTypeId = appealTypeId;
  27. _CurrentAppealType =await _atService.GetItem(_AppealTypeId);
  28. inputFields = await _atService.GetInputFields(_AppealTypeId, 0);
  29. }
  30. //public override async Task<Task> SetParametersAsync(ParameterView parameters)
  31. //{
  32. // int temOut;
  33. // if(parameters.TryGetValue("AppealTypeId",out temOut))
  34. // {
  35. // _CurrentAppealType =await _atService.GetItem(temOut);
  36. // }
  37. // return base.SetParametersAsync(parameters);
  38. //}
  39. private void OnFinish(EditContext editContext)
  40. {
  41. //Console.WriteLine($"Success:{JsonSerializer.Serialize(_model)}");
  42. _ = base.FeedbackRef.CloseAsync();
  43. }
  44. private void OnFinishFailed(EditContext editContext)
  45. {
  46. //Console.WriteLine($"Failed:{JsonSerializer.Serialize(_model)}");
  47. }
  48. }
  49. }