From f1f78b9bae93fe9a07cc3ebdc743eb71ac78c29e Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Mon, 28 May 2018 11:49:02 +0800
Subject: [PATCH] Merge branch 'develop' of http://blit.7drlb.com:8888/r/screen-frontend into develop

---
 src/app/routes/reports/excel/excel.component.ts |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/app/routes/reports/excel/excel.component.ts b/src/app/routes/reports/excel/excel.component.ts
index 0d8244e..8e4dba4 100644
--- a/src/app/routes/reports/excel/excel.component.ts
+++ b/src/app/routes/reports/excel/excel.component.ts
@@ -26,6 +26,7 @@
     {value: 'day', label: '���', format: 'YYYY-MM-DD'},
     {value: 'hour', label: '���', format: 'YYYY-MM-DD HH'}
   ];
+  public professionOptions = [];
 
   private treeClickStream: Subject<any> = new Subject<any>();
   private _sensors: {[key: string]: string} = {};
@@ -52,6 +53,13 @@
         this.msgSrv.error(res.message);
       } else {
         this.sensorOptions.push({id: -1, name: '������', isExpanded: true, children: res.data});
+      }
+    });
+    this.http.get(environment.SERVER_BASH_URL + 'mobile/profession').subscribe((res: any) => {
+      if (res.errno !== 0) {
+        this.msgSrv.error(res.message);
+      } else {
+        this.professionOptions = res.data;
       }
     });
   }
@@ -128,7 +136,6 @@
     const option = event.option;
     this.query.areaCode = null;
     this.query.monitorPointId = null;
-    this.query.mac = null;
     switch (event.index) {
       case 0:
         name = 'provinceCode';
@@ -151,20 +158,19 @@
         this.monitorPointOptions = res.data;
       }
     });
+   this.getDevices();
+
   }
 
-  monitorPointChange(value) {
+  getDevices() {
     this.query.mac = null;
-    this.deviceOptions = [];
-    if (value) {
-      this.http.get(environment.SERVER_BASH_URL + 'device/monitorPointId', {params: {monitorPointId: value}}).subscribe((res: any) => {
-        if (res.code === 0) {
-          this.msgSrv.error(res.message);
-        } else {
-          this.deviceOptions = res.data;
-        }
-      });
-    }
+    return this.http.get(environment.SERVER_BASH_URL + 'device/professionId', {params: this.query}).subscribe((res: any) => {
+      if (res.code === 0) {
+        this.msgSrv.error(res.message);
+      } else {
+        this.deviceOptions = res.data;
+      }
+    });
   }
 
   reportQuery() {

--
Gitblit v1.8.0