fengxiang
2018-06-19 27bd4a08bf807f4f6132bb524da33490b6d22f87
src/app/routes/devices/monitor-point/monitor-point.component.ts
@@ -40,7 +40,12 @@
        format: (value: any, col: Column, row: any) => {
          value = value == null ? '' : value;
          if (row['areaNames'] != null) {
            return row['areaNames']['provinceName'] + row['areaNames']['cityName'] + row['areaNames']['areaName'] + value;
            return row['areaNames']['provinceName']
              + (!!row['areaNames']['cityName'] ? row['areaNames']['cityName'] : '')
              + (!!row['areaNames']['areaName'] ? row['areaNames']['areaName'] : '')
              + (!!row['areaNames']['townName'] ? row['areaNames']['townName'] : '')
              + (!!row['areaNames']['villageName'] ? row['areaNames']['villageName'] : '')
              + value;
          } else {
            return value;
          }
@@ -52,12 +57,12 @@
        width: '300px'
      }
    };
    this.grid.title = '监控点';
    this.grid.title = '监控站点';
    this.grid.setColumns(this.monitorPoint);
    this.grid.pageSize = 10;
  }
  constructor(
    private coorPickerService:CoorPickerService,
    private coorPickerService: CoorPickerService,
    private monitorPointService: MonitorPointService,
    private confirmServ: NzModalService,
@@ -179,21 +184,27 @@
  }
  configCoord(record: MonitorPoint): void {
    Object.assign(this.coorPickerService.data, record);
    let _data = this.coorPickerService.data;
    const _data = this.coorPickerService.data;
    const areaNames = record.areaNames;
    let adress = null;
    let adress = '';
    if (areaNames != null) {
      adress = areaNames.provinceName + areaNames.cityName + areaNames.areaName + record.address;
      adress += !!areaNames.provinceName ? areaNames.provinceName : '';
      adress += ' ';
      adress += !!areaNames.cityName ? areaNames.cityName : '';
      adress += ' ';
      adress += !!areaNames.areaName ? areaNames.areaName : '';
      adress += ' ';
      adress += !!record.address ? record.address : '';
    }
    this.coorPickerService.data.address = adress;
    this.coorPickerService.data['describe'] = '监控点名称';
    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) {