From 87393cfec0e482f1d0c1d36196a4788b104df859 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Thu, 29 Mar 2018 10:45:03 +0800
Subject: [PATCH] Merge branch 'develop' of http://blit.7drlb.com:8888/r/screen-frontend into develop

---
 src/app/routes/reports/demo/demo.component.ts |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/app/routes/reports/demo/demo.component.ts b/src/app/routes/reports/demo/demo.component.ts
index c64baca..37cf5ed 100644
--- a/src/app/routes/reports/demo/demo.component.ts
+++ b/src/app/routes/reports/demo/demo.component.ts
@@ -16,10 +16,10 @@
   public query: any = {};
   public sensorOptions = [];
   public typeOptions = [
-    {value: 'year', label: '���', format: 'yyyy', typeFormat: '%Y-%m', timeLength: 12},
-    {value: 'month', label: '���', format: 'yyyy-MM', typeFormat: '%Y-%m-%d', timeLength: 28},
-    {value: 'day', label: '���', format: 'yyyy-MM-dd', typeFormat: '%Y-%m-%d %H', timeLength: 24},
-    {value: 'hour', label: '���', format: 'yyyy-MM-dd HH', typeFormat: '%Y-%m-%d %H:%i', timeLength: 60}
+    {value: 'year', label: '���', format: 'YYYY'},
+    {value: 'month', label: '���', format: 'YYYY-MM'},
+    {value: 'day', label: '���', format: 'YYYY-MM-DD'},
+    {value: 'hour', label: '���', format: 'YYYY-MM-DD HH'}
   ];
   public reportOptions = [
     {value: 'bar', label: '���������'},
@@ -122,7 +122,7 @@
         }
         queryItem.deviceCount = queryItem.deviceOptions.length;
         delete queryItem.deviceOptions;
-        queryItem.formatTime = this.dateSrv.date_format(queryItem.time, this.timeType.format.toUpperCase());
+        queryItem.formatTime = this.dateSrv.date_format(queryItem.time, this.timeType.format);
         delete queryItem.time;
         queryItems.push(queryItem);
       } else {
@@ -131,16 +131,11 @@
       }
     }
     if (validate && this.timeType && query.reportType) {
-      query.sensors = null;
       if (query.sensorKey && query.sensorKey.length > 0) {
-        const sensors = [];
-        query.sensorKey.forEach(sensor => {
-          sensors.push(sensor.sensorKey + '-' + sensor.name + '-' + sensor.unit);
-        });
-        query.sensors = JSON.stringify(sensors);
+        query.sensors = JSON.stringify(query.sensorKey);
       }
       query.items = JSON.stringify(queryItems);
-      query.timeType = JSON.stringify(this.timeType);
+      query.type = this.timeType.value;
       this.router.navigate(['report'], {queryParams: query});
     } else {
       this.msgSrv.error('���������������������������������������');

--
Gitblit v1.8.0