From 92381eb59bd9b182e5bc8f2f82833806a3496a31 Mon Sep 17 00:00:00 2001
From: xufenglei <xufenglei>
Date: Fri, 16 Mar 2018 13:42:17 +0800
Subject: [PATCH] 报表优化
---
src/app/routes/reports/demo/demo.component.ts | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/app/routes/reports/demo/demo.component.ts b/src/app/routes/reports/demo/demo.component.ts
index ad81b13..1189314 100644
--- a/src/app/routes/reports/demo/demo.component.ts
+++ b/src/app/routes/reports/demo/demo.component.ts
@@ -26,7 +26,10 @@
time: null,
formatTime: null,
monitorPointName: '',
- deviceName: ''
+ deviceName: '',
+ monitorPointAddress: '',
+ deviceCount: ''
+
}];
public sensorOptions = [];
@@ -54,13 +57,15 @@
addItem() {
const id = (this.items.length > 0) ? this.items[this.items.length - 1].id + 1 : 0;
const index = this.items.push({
- id,
+ id: id,
monitorPoint: null,
mac: '',
time: null,
formatTime: null,
monitorPointName: '',
- deviceName: ''
+ deviceName: '',
+ monitorPointAddress: '',
+ deviceCount: ''
});
}
@@ -86,6 +91,7 @@
this.monitorPointOptions.forEach(monitorPoint => {
if (monitorPoint.id === value) {
this.items[i].monitorPointName = monitorPoint.name;
+ this.items[i].monitorPointAddress = monitorPoint.address;
}
});
this.http.get(environment.SERVER_BASH_URL + 'device/monitorPointId', {params: {monitorPointId: value}}).subscribe((res: any) => {
@@ -93,6 +99,7 @@
this.msgSrv.error(res.message);
} else {
this.deviceOptions = res.data;
+ this.items[i].deviceCount = res.data.length;
}
});
} else {
@@ -146,12 +153,9 @@
}
}
if (validate && query.type) {
- query.format = this.timeType.format;
- query.typeFormat = this.timeType.typeFormat;
- query.xAxisName = this.timeType.xAxisName;
- query.label = this.timeType.label;
- query.timeLength = this.timeType.timeLength;
+ query.timeType = JSON.stringify(this.timeType);
query.items = JSON.stringify(this.items);
+ console.info(this.items);
this.router.navigate(['report'], {queryParams: query});
} else {
this.msgSrv.error('���������������������������������������');
--
Gitblit v1.8.0