公共组件 #18
@@ -54,7 +54,7 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
|
|||||||
count: countValue
|
count: countValue
|
||||||
}
|
}
|
||||||
this.pageInfo.emit({page: pageValue, pageSize: countValue})
|
this.pageInfo.emit({page: pageValue, pageSize: countValue})
|
||||||
this.httpService.Service<PageList<T>>(this.request).subscribe({
|
return this.httpService.Service<PageList<T>>(this.request).subscribe({
|
||||||
next: resp => {
|
next: resp => {
|
||||||
this.dataList = resp.result;
|
this.dataList = resp.result;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -64,6 +64,12 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
|
if (changes.request && !changes.request.isFirstChange()) {
|
||||||
|
console.log(changes.request)
|
||||||
|
this.request = changes.request.currentValue;
|
||||||
|
this.getData().unsubscribe();
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user