Site.razor 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. @page "/site/list"
  2. @using AI.Platform.Core.Entity.Site
  3. @using AI.Platform.Page.Pages.Site.Model
  4. @attribute [ReuseTabsPage(Title = "创建站点")]
  5. <Spin Spinning="Loading">
  6. <div class="filter_box">
  7. <div class="filter_row" style="justify-content:start">
  8. <span>站名</span><Input Placeholder="请输入要查找的站名" @bind-Value="filterData.siteName" Style="width:30%" />
  9. </div>
  10. <div class="filter_row" style="justify-content:start">
  11. <Button Icon="search" OnClick="Query" Style="margin-right:2%">查询</Button>
  12. <Button Icon="reload" OnClick="HandleReset" Style="margin-right:2%">重置</Button>
  13. <Button Icon="upload" OnClick="@(() => ShowDialog(1, null))">新增</Button>
  14. </div>
  15. </div>
  16. <UpdateSiteDialog onCallback="OnDialogCallback" onVisibleCallback="OnDialogVisibleCallback" @bind-IsVisible="isOpen" @bind-model="model" />
  17. <Table @ref="_Table" AutoHeight TItem="SiteOutput" DataSource="_DataSource" PageSize="filterData.pageSize" Total="Total"
  18. OnChange="OnChange">
  19. <ColumnDefinitions Context="row">
  20. <PropertyColumn Property="c => c.Name" Title="站名" />
  21. <PropertyColumn Property="c => c.Address" Title="地址" />
  22. <PropertyColumn Property="c => c.ParentName" Title="归属集团" />
  23. <PropertyColumn Property="c => c.Contact" Title="联系方式" />
  24. <ActionColumn Width="180" Title="操作" Fixed="ColumnFixPlacement.Right">
  25. <Button Type="ButtonType.Primary" Color="Color.Blue6" OnClick="@(() => ShowDialog(2, row))">编辑</Button>
  26. <Button Type="ButtonType.Primary" Color="Color.Red6" OnClick="@(() => ShowDialog(3, row))">删除</Button>
  27. </ActionColumn>
  28. </ColumnDefinitions>
  29. <PaginationTemplate>
  30. <Pagination Class="@(context.PaginationClass + " my-custom-pagination")"
  31. Total="Total"
  32. PageSize="filterData.pageSize"
  33. Current="filterData.currentPage"
  34. ShowSizeChanger="true"
  35. ShowQuickJumper="true"
  36. OnChange="OnPageChange"
  37. ShowTotal="showTotal" />
  38. </PaginationTemplate>
  39. </Table>
  40. </Spin>
  41. <style>
  42. .filter_box{
  43. display:flex;
  44. flex-direction:column;
  45. align-items:center;
  46. background:#ffffff;
  47. padding:2%;
  48. }
  49. .filter_row{
  50. display:flex;
  51. flex-direction:row;
  52. justify-content:space-between;
  53. align-items:center;
  54. width:100%;
  55. margin-top:2%;
  56. }
  57. </style>