Users.razor 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. @page "/users"
  2. @attribute [Authorize]
  3. <Table TItem="UserDto" Items="@Items" HeaderStyle="TableHeaderStyle.Light" IsBordered="true" IsMultipleSelect="true"
  4. ClickToSelect="true" ShowToolbar="true" OnQueryAsync="@OnQueryAsync" OnAddAsync="@OnAddAsync"
  5. OnSaveAsync="@OnSaveAsync" OnDeleteAsync="@OnDeleteAsync" ShowExtendButtons="true">
  6. <TableColumns>
  7. <TableColumn @bind-Field="@context.Id" Width="180" />
  8. <TableColumn @bind-Field="@context.UserName" Width="180" />
  9. <TableColumn @bind-Field="@context.Name" />
  10. <TableColumn @bind-Field="@context.Email" />
  11. </TableColumns>
  12. <EditTemplate>
  13. <div class="row g-3">
  14. <div class="col-12 col-sm-6">
  15. <BootstrapInput @bind-Value="@context.UserName" placeholder="不可为空,50字以内" maxlength="50">
  16. </BootstrapInput>
  17. </div>
  18. <div class="col-12 col-sm-6">
  19. <BootstrapInput @bind-Value="@context.Name" placeholder="不可为空,50字以内" maxlength="50">
  20. </BootstrapInput>
  21. </div>
  22. <div class="col-12 col-sm-6">
  23. <BootstrapInput @bind-Value="@context.Email" placeholder="不可为空,50字以内" maxlength="50">
  24. </BootstrapInput>
  25. </div>
  26. <div class="col-12 col-sm-6">
  27. <BootstrapInput @bind-Value="@context.Password" placeholder="不可为空,50字以内" maxlength="50">
  28. </BootstrapInput>
  29. </div>
  30. <div class="col-12 col-sm-6">
  31. <DateTimePicker @bind-Value="@context.CreationTime">
  32. </DateTimePicker>
  33. </div>
  34. <div class="col-12 col-sm-6">
  35. <MultiSelect TValue="string" Items="@RoleItems" @bind-Value="@context.RoleNames"></MultiSelect>
  36. </div>
  37. </div>
  38. </EditTemplate>
  39. </Table>