GatherDatas.razor 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. @page "/gatherdatas"
  2. @using aipmgr.Models
  3. @inject IJSRuntime JS
  4. <Table @ref="GatherDataTable" TItem="GatherDataModel" AllowResizing="true"
  5. IsPagination="true" PageItemsSource="@PageItemsSource" IsStriped="true" IsBordered="true" IsMultipleSelect="true"
  6. ShowToolbar="true" ShowSearch="true" ShowExtendButtons="true" ShowEmpty="true" ShowLoading="true"
  7. ShowDefaultButtons="false" EditDialogSize="Size.Large" ShowExtendEditButton="false" ShowExtendDeleteButton="false"
  8. ExtendButtonColumnWidth="200" SearchModel="@SearchModel" SearchMode="SearchMode.Top" ShowDeleteButton="false" ShowAddButton="false" ShowEditButton="false"
  9. OnQueryAsync="@OnSearchModelQueryAsync" OnResetSearchAsync="@OnResetSearchAsync">
  10. <TableToolbarTemplate>
  11. <TableToolbarButton TItem="GatherDataModel" Color="BootstrapBlazor.Components.Color.Success" Icon="fa fa-plus" Text="新建" TooltipText="新建采集分类" OnClick="@OnAddAsync" />
  12. </TableToolbarTemplate>
  13. <TableColumns>
  14. <TableColumn @bind-Field="@context.CategoryName" TextWrap="false" TextEllipsis="true" Width="130" />
  15. <TableColumn @bind-Field="@context.OrganizationName" TextWrap="false" Width="50" TextEllipsis="true" />
  16. <TableColumn @bind-Field="@context.GathererName" Width="120" TextWrap="false" TextEllipsis="true" />
  17. <TableColumn @bind-Field="@context.ModelType" TextWrap="false" Width="50" TextEllipsis="true" />
  18. <TableColumn @bind-Field="@context.Source" Width="120" TextWrap="false" TextEllipsis="true" />
  19. <TableColumn @bind-Field="@context.CollectionQuantity" Width="120" TextWrap="false" TextEllipsis="true" />
  20. <TableColumn @bind-Field="@context.GatherTime" Width="200" TextWrap="false" TextEllipsis="true">
  21. <Template Context="value">
  22. @if (value != null)
  23. {
  24. <span>@(value.Value.StartTimeString) — @(value.Value.EndTimeString)</span>
  25. }
  26. </Template>
  27. </TableColumn>
  28. <TableColumn @bind-Field="@context.SettlementTime" TextWrap="false" Width="175" TextEllipsis="true" FormatString="yyyy-MM-dd" />
  29. </TableColumns>
  30. <SearchTemplate>
  31. <div class="row g-3 form-inline">
  32. <div class="col-12 col-sm-4">
  33. <Select @bind-Value="@context.OrganizationId" Items="@_organizationItems" ShowLabel="true" />
  34. </div>
  35. <div class="col-12 col-sm-4">
  36. <BootstrapInput TValue="string" @bind-Value="@context.CategoryName" ShowLabel="true" PlaceHolder="请输入..." />
  37. </div>
  38. <div class="col-12 col-sm-4">
  39. <BootstrapInput TValue="string" @bind-Value="@context.GathererName" ShowLabel="true" PlaceHolder="请输入..." />
  40. </div>
  41. <div class="col-12 col-sm-4">
  42. <BootstrapInput TValue="string" @bind-Value="@context.ModelType" ShowLabel="true" PlaceHolder="请输入..." />
  43. </div>
  44. <div class="col-12 col-sm-4">
  45. <BootstrapInput TValue="string" @bind-Value="@context.Source" ShowLabel="true" PlaceHolder="请输入..." />
  46. </div>
  47. <div class="col-12 col-sm-4">
  48. <DateTimeRange DisplayText="结算时间" ShowLabel="true" ShowSidebar="true" @bind-Value="@SettlementTimeRange" />
  49. </div>
  50. </div>
  51. </SearchTemplate>
  52. <RowButtonTemplate Context="value">
  53. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Primary" Icon="fa fa-edit" Text="编辑" OnClickWithoutRender="@(()=>OnEditAsync(value) )" />
  54. </RowButtonTemplate>
  55. </Table>
  56. <Modal @ref="_createOrEditModal" OnCloseAsync="OnCloseAsync">
  57. <ModalDialog ShowCloseButton="true" IsCentered="true" Size="Size.Medium" Title="@_title">
  58. <BodyTemplate>
  59. <ValidateForm Model="_currentGatherData">
  60. <div class="row g-3 form-inline">
  61. <div class="col-12 col-sm-12">
  62. <Select Items="@_organizationItems" @bind-Value="@_currentGatherData.OrganizationId" OnSelectedItemChanged="OnOrganizationChanged" />
  63. </div>
  64. <div class="col-12 col-sm-12">
  65. <Select Items="@_categoryItems" @bind-Value="@_currentGatherData.CategoryId" OnSelectedItemChanged="OnGatherCategoryChanged" />
  66. </div>
  67. <div class="col-12 col-sm-12">
  68. <Select Items="@_gathererItems" @bind-Value="@_currentGatherData.GathererId" OnSelectedItemChanged="OnGatherChanged" />
  69. </div>
  70. <div class="col-12 col-sm-12">
  71. <BootstrapInput @bind-Value="@_currentGatherData.ModelType" />
  72. </div>
  73. <div class="col-12 col-sm-12">
  74. <BootstrapInput @bind-Value="@_currentGatherData.Source" />
  75. </div>
  76. <div class="col-12 col-sm-12">
  77. <BootstrapInput @bind-Value="@_currentGatherData.CollectionQuantity" />
  78. </div>
  79. <div class="col-12 col-sm-12">
  80. <DateTimeRange DisplayText="采集日期" ShowLabel="true" ShowSidebar="true" @bind-Value="@GatherTimeRange" />
  81. </div>
  82. <div class="col-12 col-sm-12">
  83. <DateTimePicker @bind-Value="@_currentGatherData.SettlementTime" />
  84. </div>
  85. </div>
  86. </ValidateForm>
  87. </BodyTemplate>
  88. <FooterTemplate>
  89. <Button Text="确定" Icon="fa fa-check" OnClick="@OnConfirmAsync" />
  90. </FooterTemplate>
  91. </ModalDialog>
  92. </Modal>
  93. <MessageBase @ref="_messageBaseRef"></MessageBase>