fengxiang
2018-05-15 008baf1470f2aaf6fe388a20b9a61069270a1471
src/app/routes/devices/basic-info/basic-info.component.ts
@@ -158,19 +158,35 @@
      });
  }
  configCoord(record: Device): void {  
    Object.assign(this.coorPickerService.data, record);
    const _data = this.coorPickerService.data;
      //当前 坐标未设置 取监控点地址
      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 = null;
                    let adress = '';
                if (areaNames != null) {
                  adress = areaNames.provinceName + areaNames.cityName + areaNames.areaName + res.data.address;
                      adress += !!areaNames.provinceName?areaNames.provinceName:'';
                      adress += ' ';
                      adress += !!areaNames.cityName?areaNames.cityName:'';
                      adress += ' ';
                      adress += !!areaNames.areaName?areaNames.areaName:'';
                      adress += ' ';
                      adress += !!res.data.address?res.data.address:'';
                }
                this.coorPickerService.data.address = adress;
                this.coorPickerService.data['describe'] = '设备名称';
                    this.openMap(record);
            }
              }
        );
      }else{
        this.openMap(record);
      }
  }
  private openMap(record: Device){
    Object.assign(this.coorPickerService.data, record);
    const _data = this.coorPickerService.data;
    this.coorPickerService.data['describe'] = '设备名称';
            this.modalHelper.static(CoordinatesPickerComponent).subscribe(
              (staticComp) => {
                     const data: Device = {
@@ -185,8 +201,6 @@
                          this.load();
                          this.msgSrv.success('坐标配置成功!');
                        }
                      }
                     );
              }
           );
         }