fix(commonTable): 请求参数的传递

This commit is contained in:
禾几海
2020-09-05 17:19:07 +08:00
parent 072eaa12e8
commit 138b93da09
2 changed files with 8 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ export class RequestObj {
method: 'GET' | 'POST' | 'PUT' | 'DELETE'; method: 'GET' | 'POST' | 'PUT' | 'DELETE';
data?: {}; data?: {};
contentType?: 'application/json' | 'application/x-www-form-urlencoded'; contentType?: 'application/json' | 'application/x-www-form-urlencoded';
queryParam?: {}; queryParam?: { [key: string]: any };
header?: HttpHeaders | { header?: HttpHeaders | {
[header: string]: string | string[]; [header: string]: string | string[];
}; };

View File

@@ -59,10 +59,13 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
this.loading = true; this.loading = true;
const pageValue = this.dataList.pageNum ? this.dataList.pageNum : 1; const pageValue = this.dataList.pageNum ? this.dataList.pageNum : 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;
count: countValue this.request.queryParam.count = countValue;
} // this.request.queryParam = {
// page: pageValue,
// count: countValue
// }
this.pageInfo.emit({page: pageValue, pageSize: countValue}) this.pageInfo.emit({page: pageValue, pageSize: countValue})
return this.httpService.Service<PageList<T>>(this.request).subscribe({ return this.httpService.Service<PageList<T>>(this.request).subscribe({
next: resp => { next: resp => {