| import { Organization, AlarmConfig } from '@business/entity/data'; | 
| import { ExampleService } from '@business/services/util/example.service'; | 
| import { _HttpClient } from '@delon/theme'; | 
| import { environment } from 'environments/environment'; | 
| import { RouteConfigLoadStart } from '@angular/router'; | 
| import { Injectable } from '@angular/core'; | 
| import { equal } from 'assert'; | 
| import { Observable } from 'rxjs/Observable'; | 
| import {  PageBean, ResultBean } from '@business/entity/grid'; | 
|   | 
|   | 
| @Injectable() | 
| export class OrganizationService { | 
|   handle: 'list'|'config' = 'list'; | 
|   config: {pageBean: PageBean, resultBean: ResultBean<AlarmConfig>}; | 
|   data: Organization; | 
|   title: '组织列表'|'组织配置' = '组织列表'; | 
|   private urls = { | 
|       list: environment.SERVER_BASH_URL + '/organization/page-list', | 
|       save: environment.SERVER_BASH_URL + '/organization/add-or-modify', | 
|       delete: environment.SERVER_BASH_URL + '/organization/delete-by-ids' | 
|   }; | 
|   constructor(private http: _HttpClient) { } | 
|    public getPagingList(page: PageBean, queryText: string): Observable<PageBean> { | 
|     const example = new ExampleService(); | 
|     if (queryText != null && queryText !== '') { | 
|       example.or().andLike({name: 'name', value: '%' + queryText + '%'}); | 
|     } | 
|     let orderByClause = ''; | 
|     if ( page.getOrderByClause != null && page.getOrderByClause instanceof Function) { | 
|       orderByClause = page.getOrderByClause(); | 
|     } | 
|     const param: PageBean = {pageSize: page.pageSize, pageIndex: page.pageIndex,  | 
|         queryParams: example.getSqlParam(), orderByClause: orderByClause}; | 
|         return this.http.get(this.urls.list, param); | 
|   } | 
|   public save(data: any): Observable<any> { | 
|         return this.http.post(this.urls.save, data); | 
|   } | 
|   public delete(...ids: number[]): Observable<any> {              | 
|         return this.http.post(this.urls.delete, ids); | 
|   } | 
| } |