| | |
| | | import { AlarmConfigService } from '@business/services/http/alarm-config.service'; |
| | | import { SensorsService } from '@business/services/http/sensors.service'; |
| | | import { Router } from '@angular/router'; |
| | | import { ModalHelper } from '@delon/theme'; |
| | | import { ModalHelper, _HttpClient } from '@delon/theme'; |
| | | import { NzModalService, NzMessageService } from 'ng-zorro-antd'; |
| | | import { OrganizationService } from '@business/services/http/organization.service'; |
| | | import { Grid, Column, PageBean } from '@business/entity/grid'; |
| | | import { Organization } from '@business/entity/data'; |
| | | import { Grid, Column, PageBean, ResultBean } from '@business/entity/grid'; |
| | | import { Organization, OrganizationSensorUnit } from '@business/entity/data'; |
| | | import { Component, OnInit } from '@angular/core'; |
| | | import { Subject } from 'rxjs/Subject'; |
| | | import { Types } from '@business/enum/types.enum'; |
| | |
| | | private router: Router, |
| | | private sensorsService: SensorsService, |
| | | private alarmConfigService: AlarmConfigService, |
| | | private http: _HttpClient |
| | | ) {} |
| | | |
| | | ngOnInit() { |
| | |
| | | } |
| | | this.load(); |
| | | } |
| | | config(row) { |
| | | configAlarm(row) { |
| | | // 延时加载避免ExpressionChangedAfterItHasBeenCheckedError |
| | | setTimeout(() => { |
| | | this.grid.loading = true; |
| | |
| | | this.sensorsService.getPagingList({pageIndex: 0, pageSize: 0}, null), |
| | | this.alarmConfigService.getByOid( row.id ) |
| | | ).subscribe(([pageBean, resultBean]) => { |
| | | console.log(pageBean); |
| | | this.grid.loading = false; |
| | | this.organizationService.handle = 'config' ; |
| | | this.organizationService.data = row; |
| | | this.organizationService.config = {pageBean, resultBean}; |
| | | this.organizationService.title = '组织配置'; |
| | | this.organizationService.title = '配置三级警报'; |
| | | }); |
| | | } |
| | | |
| | | registration(row){ |
| | | sessionStorage.setItem("organization", JSON.stringify(row)); |
| | | configScreenLayout(row) { |
| | | // 延时加载避免ExpressionChangedAfterItHasBeenCheckedError |
| | | setTimeout(() => { |
| | | this.grid.loading = true; |
| | | }, 1); |
| | | this.http.get('org-layout/rtd-config', {orgId: row.id}).subscribe( |
| | | (res: ResultBean<any>) => { |
| | | if ( res.code > 0 ) { |
| | | this.grid.loading = false; |
| | | this.organizationService.handle = 'screen' ; |
| | | this.organizationService.data = row; |
| | | this.organizationService.config['resultBean'] = res; |
| | | console.log(res); |
| | | this.organizationService.title = '配置大屏布局'; |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | configShowUnit(row) { |
| | | // 延时加载避免ExpressionChangedAfterItHasBeenCheckedError |
| | | setTimeout(() => { |
| | | this.grid.loading = true; |
| | | }, 1); |
| | | this.http.get('org-sunit/gets-byoid', {orgId: row.id}).subscribe( |
| | | (res: ResultBean<any>) => { |
| | | if ( res.code > 0 ) { |
| | | this.grid.loading = false; |
| | | this.organizationService.handle = 'unit' ; |
| | | this.organizationService.data = row; |
| | | this.organizationService.config['resultBean'] = res; |
| | | console.log(res); |
| | | this.organizationService.title = '配置显示单位'; |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | registration(row) { |
| | | sessionStorage.setItem('organization', JSON.stringify(row)); |
| | | } |
| | | } |