From 27bd4a08bf807f4f6132bb524da33490b6d22f87 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Tue, 19 Jun 2018 11:45:11 +0800
Subject: [PATCH] 省市区兼容旧版本

---
 src/app/routes/devices/monitor-point/monitor-point.component.ts |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/app/routes/devices/monitor-point/monitor-point.component.ts b/src/app/routes/devices/monitor-point/monitor-point.component.ts
index a724ad9..67e290b 100644
--- a/src/app/routes/devices/monitor-point/monitor-point.component.ts
+++ b/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,7 +57,7 @@
         width: '300px'
       }
     };
-    this.grid.title = '���������';
+    this.grid.title = '������������';
     this.grid.setColumns(this.monitorPoint);
     this.grid.pageSize = 10;
   }
@@ -181,12 +186,18 @@
     Object.assign(this.coorPickerService.data, record);
     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 = {

--
Gitblit v1.8.0