From 5814a484c6292e66230d2cf9bc3f2e591131102b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BE=E5=87=A0=E6=B5=B7?= Date: Thu, 2 Jul 2020 22:05:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=94=A8=E8=A1=A8=E6=A0=BC=E7=BB=84?= =?UTF-8?q?=E4=BB=B6-request=E6=95=B0=E6=8D=AE=E5=8F=98=E6=9B=B4=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=AF=B7=E6=B1=82=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common-table/common-table.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 cf7ec26..7f9d56c 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 @@ -54,7 +54,7 @@ export class CommonTableComponent implements OnInit, OnChanges { count: countValue } this.pageInfo.emit({page: pageValue, pageSize: countValue}) - this.httpService.Service>(this.request).subscribe({ + return this.httpService.Service>(this.request).subscribe({ next: resp => { this.dataList = resp.result; this.loading = false; @@ -64,6 +64,12 @@ export class CommonTableComponent implements OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { + if (changes.request && !changes.request.isFirstChange()) { + console.log(changes.request) + this.request = changes.request.currentValue; + this.getData().unsubscribe(); + this.getData(); + } }