From f3b49af9af43e4e351ad782f9a67f7492590a66f Mon Sep 17 00:00:00 2001 From: Argo Date: Sun, 12 Apr 2020 00:30:40 +0800 Subject: [PATCH] =?UTF-8?q?!38=20=E5=A2=9E=E5=8A=A0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=88=86=E9=A1=B5=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=20*=20fix:=20=E6=9B=B4=E6=94=B9=20OnPageItemsChanged=20?= =?UTF-8?q?=E4=B8=BA=20Action=20=E7=B1=BB=E5=9E=8B=20*=20refactor:=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=96=87=E6=A1=A3=20*=20Merge=20bra?= =?UTF-8?q?nch=20'dev'=20into=20dev-pagination=20*=20feat:=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=86=E9=A1=B5=E4=BF=A1=E6=81=AF=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8A=9F=E8=83=BD=20*=20doc:=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=88=86=E9=A1=B5=E7=BB=84=E4=BB=B6=E6=BC=94=E7=A4=BA?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=20*=20feat:=20=E6=AF=8F=E9=A1=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=B0=E9=87=8F=E6=94=B9=E5=8F=98=E6=97=B6=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E5=A4=96=E9=83=A8=E6=96=B9=E6=B3=95=20*=20feat:=20?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81=E5=A4=96?= =?UTF-8?q?=E7=BD=AE=E6=AF=8F=E9=A1=B5=E6=98=BE=E7=A4=BA=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=BA=90=20*=20style:=20=E8=AE=BE=E7=BD=AE=E9=A1=B5=E7=A0=81?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=8F=B3=E4=BE=A7=E5=AF=B9=E9=BD=90=20*=20re?= =?UTF-8?q?factor:=20=E6=A0=BC=E5=BC=8F=E5=8C=96=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=AF=8F=E9=A1=B5=E6=98=BE=E7=A4=BA=E6=95=B0=E9=87=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=20*=20feat:=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=80=82=E9=85=8D=20*=20feat:=20?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=AF=8F=E9=A1=B5=E6=98=BE=E7=A4=BA=E6=95=B0=E9=87=8F?= =?UTF-8?q?=20*=20feat:=20Select=20=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20Value=20=E5=B1=9E=E6=80=A7=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=80=BC=20*=20feat:=20=E5=A2=9E=E5=8A=A0=20Paginatio?= =?UTF-8?q?nItem=20=E7=BB=84=E4=BB=B6=20*=20feat:=20=E5=A2=9E=E5=8A=A0=20P?= =?UTF-8?q?aginationClass=20=E5=B1=9E=E6=80=A7=20*=20refactor:=20=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E7=BB=84=E4=BB=B6=E5=A2=9E=E5=8A=A0=E6=AF=8F=E9=A1=B5?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=95=B0=E9=87=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/Paginations.razor | 47 ++-- .../Pages/Paginations.razor.cs | 23 +- .../wwwroot/code/pagination.1.txt | 6 +- .../wwwroot/css/site.css | 2 +- .../Components/Pagination/Pagination.razor | 55 ++++- .../Components/Pagination/PaginationBase.cs | 226 ++++++++++-------- .../Pagination/PaginationItem.razor | 5 + .../Pagination/PaginationItem.razor.cs | 31 +++ .../Components/Select/Select.razor | 2 +- .../Components/Select/SelectBase.cs | 5 + .../Components/Table/Table.razor | 4 +- .../Components/Table/TableCell.cs | 4 +- .../wwwroot/css/bootstrap.blazor.css | 85 +++++-- 13 files changed, 322 insertions(+), 173 deletions(-) create mode 100644 src/BootstrapBlazor/Components/Pagination/PaginationItem.razor create mode 100644 src/BootstrapBlazor/Components/Pagination/PaginationItem.razor.cs diff --git a/src/BootstrapBlazor.WebConsole/Pages/Paginations.razor b/src/BootstrapBlazor.WebConsole/Pages/Paginations.razor index 312c1e6f1..69d31b43f 100644 --- a/src/BootstrapBlazor.WebConsole/Pages/Paginations.razor +++ b/src/BootstrapBlazor.WebConsole/Pages/Paginations.razor @@ -1,49 +1,36 @@ @page "/paginations" - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
+

Pagination 分页

- +

当数据量过多时,使用分页分解数据。

+ +
- +
+
+
+ +
+ + +
+
- -
-
- +
- +
- -
+ +
diff --git a/src/BootstrapBlazor.WebConsole/Pages/Paginations.razor.cs b/src/BootstrapBlazor.WebConsole/Pages/Paginations.razor.cs index 3bf1e1c1a..fa03f259d 100644 --- a/src/BootstrapBlazor.WebConsole/Pages/Paginations.razor.cs +++ b/src/BootstrapBlazor.WebConsole/Pages/Paginations.razor.cs @@ -9,21 +9,26 @@ namespace BootstrapBlazor.WebConsole.Pages /// public partial class Paginations { - /// - /// - /// - protected Logger? Trace { get; set; } + private Logger? Trace { get; set; } + + private void OnPageClick(int pageIndex, int pageItems) + { + Trace?.Log($"PageIndex: {pageIndex} PageItems: {pageItems}"); + } + + private void OnPageItemsChanged(int pageItems) + { + Trace?.Log($"PageItems: {pageItems}"); + } + + private IEnumerable PageItems => new int[] { 3, 10, 20, 40 }; - /// - /// - /// - List disableList = new List() { "1", "5", "Next" }; /// /// 获得属性方法 /// /// protected IEnumerable GetAttributes() => new AttributeItem[] - { + { new AttributeItem() { Name = "Total", Description = "分页总页数", diff --git a/src/BootstrapBlazor.WebConsole/wwwroot/code/pagination.1.txt b/src/BootstrapBlazor.WebConsole/wwwroot/code/pagination.1.txt index 9d4c59093..431c73e80 100644 --- a/src/BootstrapBlazor.WebConsole/wwwroot/code/pagination.1.txt +++ b/src/BootstrapBlazor.WebConsole/wwwroot/code/pagination.1.txt @@ -1,5 +1 @@ - - - - - + diff --git a/src/BootstrapBlazor.WebConsole/wwwroot/css/site.css b/src/BootstrapBlazor.WebConsole/wwwroot/css/site.css index 53ce8aa25..e15bd5e01 100644 --- a/src/BootstrapBlazor.WebConsole/wwwroot/css/site.css +++ b/src/BootstrapBlazor.WebConsole/wwwroot/css/site.css @@ -291,7 +291,7 @@ section { margin-left: 38px; } - .content ul li:not(:last-child) { + .content .sidebar-content ul li:not(:last-child) { padding-bottom: 0.5rem; } diff --git a/src/BootstrapBlazor/Components/Pagination/Pagination.razor b/src/BootstrapBlazor/Components/Pagination/Pagination.razor index 4f4dd056e..0f5d866ed 100644 --- a/src/BootstrapBlazor/Components/Pagination/Pagination.razor +++ b/src/BootstrapBlazor/Components/Pagination/Pagination.razor @@ -1,11 +1,50 @@ @namespace BootstrapBlazor.Components @inherits PaginationBase -
    - @foreach (string str in GetShowPagination(CurrentPage, Total)) - { - var num = str; - var pagestr = "第" + str + "页"; -
  • @num
  • - } -
\ No newline at end of file +