InputValueSetting.razor.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. namespace wispro.sp.web.Components
  9. {
  10. public partial class InputValueSetting
  11. {
  12. List<wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.EnumFieldType>> FieldTypes
  13. = entity.EnumHelper.getEnumDescriptionDic<wispro.sp.entity.workflowDefine.EnumFieldType>();
  14. ITable table;
  15. entity.workflowDefine.InputValueSetting EditObj;
  16. [Parameter]
  17. public List<entity.workflowDefine.InputValueSetting> DataSource { get; set; }
  18. IDictionary<string, (bool edit, entity.workflowDefine.InputValueSetting data)> editCache = new Dictionary<string, (bool edit, entity.workflowDefine.InputValueSetting data)>();
  19. private List<entity.workflowDefine.InputValueSetting> GetChildItem(entity.workflowDefine.InputValueSetting setting)
  20. {
  21. return DataSource.Where<entity.workflowDefine.InputValueSetting>(p => p.ParentSetting == setting).ToList();
  22. }
  23. void AddNew(entity.workflowDefine.InputValueSetting setting)
  24. {
  25. var newObj = new entity.workflowDefine.InputValueSetting()
  26. {
  27. valueType = entity.workflowDefine.EnumFieldType.Text,
  28. DisplayName = "新添栏位",
  29. ParentSetting = setting
  30. };
  31. EditObj = newObj;
  32. DataSource.Add(newObj);
  33. }
  34. void Delete(entity.workflowDefine.InputValueSetting setting)
  35. {
  36. //此处添加删除代码
  37. DataSource.Remove(setting);
  38. StateHasChanged();
  39. }
  40. void Edit(entity.workflowDefine.InputValueSetting setting)
  41. {
  42. EditObj = setting;
  43. }
  44. void Save(entity.workflowDefine.InputValueSetting setting)
  45. {
  46. //此处添加保存代码
  47. EditObj = null;
  48. StateHasChanged();
  49. }
  50. void OnCancel(entity.workflowDefine.InputValueSetting setting)
  51. {
  52. EditObj = null;
  53. }
  54. }
  55. }