[web-app]bugfix: filter is missing when alert-center pageSize change (#97)

This commit is contained in:
tomsun28
2022-04-16 22:16:55 +08:00
committed by GitHub
parent 7c54bf0203
commit 589d178586
5 changed files with 14 additions and 54 deletions

View File

@@ -16,22 +16,7 @@ const alerts_status_uri = '/alerts/status';
export class AlertService {
constructor(private http: HttpClient) {}
public getAlerts(pageIndex: number, pageSize: number): Observable<Message<Page<Alert>>> {
pageIndex = pageIndex ? pageIndex : 0;
pageSize = pageSize ? pageSize : 8;
// 注意HttpParams是不可变对象 需要保存set后返回的对象为最新对象
let httpParams = new HttpParams();
httpParams = httpParams.appendAll({
sort: 'id',
order: 'desc',
pageIndex: pageIndex,
pageSize: pageSize
});
const options = { params: httpParams };
return this.http.get<Message<Page<Alert>>>(alerts_uri, options);
}
public searchAlerts(
public loadAlerts(
status: number | undefined,
priority: number | undefined,
content: string | undefined,