From 309d1f9d649daa08bb9b068af014749f6d4a5bce Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Fri, 06 Jul 2018 14:00:45 +0800 Subject: [PATCH] 设备和监控点父页面 筛选条件不予 编辑页面联动 --- src/app/business/services/http/device.service.ts | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/app/business/services/http/device.service.ts b/src/app/business/services/http/device.service.ts index 9ad5d43..31de514 100644 --- a/src/app/business/services/http/device.service.ts +++ b/src/app/business/services/http/device.service.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; import { ResultBean, PageBean } from '@business/entity/grid'; import { Observable } from 'rxjs/Observable'; -import { ExampleService } from '@business/services/util/example.service'; +import { ExampleService, Criteria } from '@business/services/util/example.service'; import { Device } from '@business/entity/data'; @Injectable() @@ -11,19 +11,13 @@ private urls = { list: environment.SERVER_BASH_URL + 'device/page-list', save: environment.SERVER_BASH_URL + 'device/add-or-modify', - delete: environment.SERVER_BASH_URL + 'device/delete-by-ids' + delete: environment.SERVER_BASH_URL + 'device/delete-by-ids', + count: environment.SERVER_BASH_URL + 'device/count-by-example' }; public getListUrl () { return this.urls.list; } - public getSqlParams(queryText: string) { - const example = new ExampleService(); - if (queryText != null && queryText !== '') { - example.or().andLike({name: 'name', value: '%' + queryText + '%'}); - example.or().andLike({name: 'mac', value: '%' + queryText + '%'}); - } - return example.getSqlParam(); - } + constructor(private http: _HttpClient) { } delete(...ids: number[]): Observable< ResultBean<any> > { return this.http.post(this.urls.delete, ids); @@ -31,6 +25,9 @@ public save(data: Device): Observable<any> { return this.http.post(this.urls.save, data); } + public countByExample(example: ExampleService): Observable<ResultBean<number>> { + return this.http.get(this.urls.count, { queryParams: example.getSqlParam()}); + } public getPageByExample(page: PageBean, example: ExampleService): Observable<PageBean> { let orderByClause = ''; const _queryParams = !!example ? example.getSqlParam() : ''; -- Gitblit v1.8.0