From 051a77599ca8b7972df8728ff46822d308627cbc Mon Sep 17 00:00:00 2001
From: xufenglei <xufenglei>
Date: Wed, 28 Mar 2018 14:32:32 +0800
Subject: [PATCH] 报表 优化
---
src/app/routes/reports/query/query.component.ts | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/src/app/routes/reports/query/query.component.ts b/src/app/routes/reports/query/query.component.ts
index ad91fcb..b878e2c 100644
--- a/src/app/routes/reports/query/query.component.ts
+++ b/src/app/routes/reports/query/query.component.ts
@@ -49,10 +49,10 @@
* @memberof QueryComponent
*/
public timeUnitOptions = [
- {label: '������', value: TimeUnits.MONTH},
- {label: '������', value: TimeUnits.DAY},
- {label: '������', value: TimeUnits.HOUR},
- {label: '������', value: TimeUnits.MINUTE},
+ {label: '���', value: TimeUnits.MONTH},
+ {label: '���', value: TimeUnits.DAY},
+ {label: '���', value: TimeUnits.HOUR},
+ {label: '���', value: TimeUnits.MINUTE},
];
public timeUnit: {label: string, value: TimeUnits} = this.timeUnitOptions[2];
// ���������������������������������������
@@ -169,7 +169,7 @@
// ������������ tree click ������
this.treeClickStream.debounceTime(1).subscribe( event => {
const data = event.node.data;
- console.log(data);
+ // console.log(data);
if (data.id === -1) {
const children = data.children;
// ������������
@@ -359,17 +359,19 @@
this.reloadSensorNames();
}
private reloadSensorNames(): void {
- this._sensorNames = '';
- this.sensorOptions[0].children.forEach(
- sensor => {
- const hasSensor = Object.keys(this._sensors).some(
- id => Number(id) === Number(sensor.id)
- );
- if (hasSensor) {
- this._sensorNames += sensor.name + ',';
+ // ������������������������
+ setTimeout(() => {
+ this._sensorNames = '';
+ const sensorNameList = Object.keys(this._sensors).map(
+ id => {
+ const sensor = this.sensorOptions[0].children.find(item => {
+ return Number(id) === Number(item.id) ;
+ });
+ return sensor.name;
}
- }
- );
+ );
+ this._sensorNames = sensorNameList.join(', ');
+ }, 1);
}
public setTimeUnit(val: {label: string, value: TimeUnits} ) {
switch (val.value) {
--
Gitblit v1.8.0