fix(common-table): 修复table组件无法切换页面
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<ng-template #table>
|
<ng-template #table>
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
<nz-table (nzPageIndexChange)="getData()"
|
<nz-table (nzPageIndexChange)="getData($event)"
|
||||||
[(nzPageIndex)]="dataList.pageNum"
|
[(nzPageIndex)]="dataList.pageNum"
|
||||||
[nzData]="dataList.list"
|
[nzData]="dataList.list"
|
||||||
[nzLoading]="loading"
|
[nzLoading]="loading"
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
|
|||||||
this.getData();
|
this.getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
getData = () => {
|
getData = (pageNumber?: number) => {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const pageValue = this.dataList.pageNum ? this.dataList.pageNum : 1;
|
const pageValue = pageNumber ? pageNumber : 1;
|
||||||
const countValue = this.dataList.pageSize ? this.dataList.pageSize : 10
|
const countValue = this.dataList.pageSize ? this.dataList.pageSize : 10;
|
||||||
|
|
||||||
this.request.queryParam.page = pageValue;
|
this.request.queryParam.page = pageValue;
|
||||||
this.request.queryParam.count = countValue;
|
this.request.queryParam.count = countValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user