From 21ec9878f8687d3da75b4fd424ffa4ee8d73d448 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Mon, 28 May 2018 11:48:34 +0800 Subject: [PATCH] 坐标完善 --- src/app/routes/devices/basic-info/basic-info.component.ts | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/app/routes/devices/basic-info/basic-info.component.ts b/src/app/routes/devices/basic-info/basic-info.component.ts index 1d5b1c4..526253c 100644 --- a/src/app/routes/devices/basic-info/basic-info.component.ts +++ b/src/app/routes/devices/basic-info/basic-info.component.ts @@ -158,35 +158,36 @@ }); } configCoord(record: Device): void { - //������ ��������������� ������������������ - if((!!record.latitude||!!record.longitude)&&!!record.monitorPointId){ + // ������������������������������������������adress������������ + Object.assign(this.coorPickerService.data, record); + this.coorPickerService.data['describe'] = '������������'; + // ������ ��������������� ������������������ + if ((!record.latitude || !record.longitude) && !!record.monitorPointId) { this.monitorPointService.getEntity(record.monitorPointId).subscribe( res => { if (res != null && res.code === 1 && res.data != null) { const areaNames = res.data.areaNames; let adress = ''; if (areaNames != null) { - adress += !!areaNames.provinceName?areaNames.provinceName:''; + adress += !!areaNames.provinceName ? areaNames.provinceName : ''; adress += ' '; - adress += !!areaNames.cityName?areaNames.cityName:''; + adress += !!areaNames.cityName ? areaNames.cityName : ''; adress += ' '; - adress += !!areaNames.areaName?areaNames.areaName:''; + adress += !!areaNames.areaName ? areaNames.areaName : ''; adress += ' '; - adress += !!res.data.address?res.data.address:''; + adress += !!res.data.address ? res.data.address : ''; } this.coorPickerService.data.address = adress; this.openMap(record); } } ); - }else{ + }else { this.openMap(record); } } - private openMap(record: Device){ - Object.assign(this.coorPickerService.data, record); - const _data = this.coorPickerService.data; - this.coorPickerService.data['describe'] = '������������'; + private openMap(record: Device) { + const _data = this.coorPickerService.data; this.modalHelper.static(CoordinatesPickerComponent).subscribe( (staticComp) => { const data: Device = { -- Gitblit v1.8.0