From 138b93da09eda3de94765d1d3b41a43ab4974dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BE=E5=87=A0=E6=B5=B7?= Date: Sat, 5 Sep 2020 17:19:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(commonTable):=20=E8=AF=B7=E6=B1=82=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=9A=84=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/class/HttpReqAndResp.ts | 2 +- .../components/common-table/common-table.component.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/class/HttpReqAndResp.ts b/src/app/class/HttpReqAndResp.ts index 4371115..e839be1 100644 --- a/src/app/class/HttpReqAndResp.ts +++ b/src/app/class/HttpReqAndResp.ts @@ -6,7 +6,7 @@ export class RequestObj { method: 'GET' | 'POST' | 'PUT' | 'DELETE'; data?: {}; contentType?: 'application/json' | 'application/x-www-form-urlencoded'; - queryParam?: {}; + queryParam?: { [key: string]: any }; header?: HttpHeaders | { [header: string]: string | string[]; }; diff --git a/src/app/view/admin/components/common-table/common-table.component.ts b/src/app/view/admin/components/common-table/common-table.component.ts index 1575841..e0fc7e8 100644 --- a/src/app/view/admin/components/common-table/common-table.component.ts +++ b/src/app/view/admin/components/common-table/common-table.component.ts @@ -59,10 +59,13 @@ export class CommonTableComponent implements OnInit, OnChanges { this.loading = true; const pageValue = this.dataList.pageNum ? this.dataList.pageNum : 1; const countValue = this.dataList.pageSize ? this.dataList.pageSize : 10 - this.request.queryParam = { - page: pageValue, - count: countValue - } + + this.request.queryParam.page = pageValue; + this.request.queryParam.count = countValue; + // this.request.queryParam = { + // page: pageValue, + // count: countValue + // } this.pageInfo.emit({page: pageValue, pageSize: countValue}) return this.httpService.Service>(this.request).subscribe({ next: resp => {