公共组件 #18

Merged
xiaohai2271 merged 45 commits from dev into master 2020-07-11 10:41:50 +08:00
Showing only changes of commit 5814a484c6 - Show all commits

View File

@@ -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();
}
} }