| | |
| | | import { CoorPickerService } from 'app/routes/map/coordinates-picker/coordinates-picker.service'; |
| | | import { AreaNames, MonitorPoint } from '@business/entity/data'; |
| | | import { Version, ValueTransformer } from '@angular/compiler/src/util'; |
| | | import { Subject } from 'rxjs/Subject'; |
| | |
| | | import { filter } from 'rxjs/operators/filter'; |
| | | import { MonitorPointEditComponent } from 'app/routes/devices/monitor-point/monitor-point-edit/monitor-point-edit.component'; |
| | | import { MonitorPointService } from '@business/services/http/monitor-point.service'; |
| | | import { CoordinatesPickerComponent } from 'app/routes/map/coordinates-picker/coordinates-picker.component'; |
| | | |
| | | |
| | | @Component({ |
| | |
| | | this.grid.pageSize = 10; |
| | | } |
| | | constructor( |
| | | private coorPickerService:CoorPickerService, |
| | | private monitorPointService: MonitorPointService, |
| | | |
| | | private confirmServ: NzModalService, |
| | |
| | | } |
| | | this.load(); |
| | | } |
| | | configCoord(record: MonitorPoint): void { |
| | | Object.assign(this.coorPickerService.data, record); |
| | | let _data = this.coorPickerService.data; |
| | | const areaNames = record.areaNames; |
| | | let adress = null; |
| | | if (areaNames != null) { |
| | | adress = areaNames.provinceName + areaNames.cityName + areaNames.areaName + record.address; |
| | | } |
| | | this.coorPickerService.data.address = adress; |
| | | this.coorPickerService.data['describe'] = '监控点名称'; |
| | | this.modalHelper.static(CoordinatesPickerComponent).subscribe( |
| | | (staticComp) => { |
| | | const data: MonitorPoint = { |
| | | id: record.id, |
| | | longitude: _data.longitude, |
| | | latitude: _data.latitude, |
| | | } |
| | | this.monitorPointService.save(data).subscribe( |
| | | (res: any) => { |
| | | if (res.code === 1) { |
| | | this.load(); |
| | | this.msgSrv.success('坐标配置成功!'); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | } |
| | | ); |
| | | } |
| | | } |