| | |
| | | import { Organization, AlarmConfig } from '@business/entity/data'; |
| | | import { Organization, AlarmConfig, OrganizationSensorUnit, SensorUnit } from '@business/entity/data'; |
| | | import { ExampleService } from '@business/services/util/example.service'; |
| | | import { _HttpClient } from '@delon/theme'; |
| | | import { environment } from 'environments/environment'; |
| | |
| | | |
| | | @Injectable() |
| | | export class OrganizationService { |
| | | handle: 'list'|'config' = 'list'; |
| | | config: {pageBean: PageBean, resultBean: ResultBean<AlarmConfig>}; |
| | | handle: 'list'|'config'|'unit'|'screen' = 'list'; |
| | | config: {pageBean?: PageBean, resultBean?: ResultBean<AlarmConfig|any>} = {}; |
| | | data: Organization; |
| | | title: '组织列表'|'组织配置' = '组织列表'; |
| | | title: '组织列表'|'配置三级警报'|'配置显示单位'|'配置大屏布局' = '组织列表'; |
| | | private urls = { |
| | | list: environment.SERVER_BASH_URL + '/organization/page-list', |
| | | save: environment.SERVER_BASH_URL + '/organization/add-or-modify', |
| | |
| | | }; |
| | | constructor(private http: _HttpClient) { } |
| | | public getPagingList(page: PageBean, queryText: string): Observable<PageBean> { |
| | | queryText = !!queryText && !!queryText.trim() ? queryText : null; |
| | | const example = new ExampleService(); |
| | | if (queryText != null && queryText !== '') { |
| | | example.or().andLike({name: 'name', value: '%' + queryText + '%'}); |
| | |
| | | public delete(...ids: number[]): Observable<any> { |
| | | return this.http.post(this.urls.delete, ids); |
| | | } |
| | | public getResultBeanData(key: string) { |
| | | if (!!this.config.resultBean |
| | | && !!this.config.resultBean.code |
| | | && !!this.config.resultBean.data) { |
| | | return this.config.resultBean.data[key]; |
| | | } |
| | | return null; |
| | | } |
| | | } |