Commit f5cf0161 authored by wangqinghua's avatar wangqinghua

bug update

parent 8cf4aa9f
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<nz-select style="width: 100%;" nzPlaceHolder="选择分组" nzShowSearch nzAllowClear [(ngModel)]="obj.itemKey" <nz-select style="width: 100%;" nzPlaceHolder="选择分组" nzShowSearch nzAllowClear [(ngModel)]="obj.itemKey"
(ngModelChange)="getEcharts()"> (ngModelChange)="getEcharts()">
<ng-container *ngFor="let item of checkList;"> <ng-container *ngFor="let item of checkList;">
<nz-option [nzLabel]="item.name" [nzValue]="item.name"></nz-option> <nz-option [nzLabel]="item.name" [nzValue]="item.key"></nz-option>
</ng-container> </ng-container>
</nz-select> </nz-select>
</div> </div>
......
...@@ -121,7 +121,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -121,7 +121,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.overAllSer.findCheckByType(data).subscribe( this.overAllSer.findCheckByType(data).subscribe(
(res) => { (res) => {
this.checkList = res.data.data; this.checkList = res.data.data;
this.obj.itemKey = this.checkList[0].name; this.obj.itemKey = this.checkList[0].key;
this.getEcharts(); this.getEcharts();
} }
); );
...@@ -151,7 +151,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -151,7 +151,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.data.history = false; this.data.history = false;
this.inEchartData = res.data.map(e => { this.inEchartData = res.data.map(e => {
const a = { const a = {
clock: this.datePipe.transform(e.clock * 1000, 'yyyy-MM-dd HH:mm'), clock: this.datePipe.transform(e.clock * 1000, 'yyyy/MM/dd HH:mm'),
avg: e.avg avg: e.avg
}; };
console.log(a) console.log(a)
...@@ -268,8 +268,8 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -268,8 +268,8 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
//搜索 //搜索
search() { search() {
if (this.timeType == '99') { if (this.timeType == '99') {
this.obj.startTime = this.datePipe.transform(this.timeBegin, 'yyyy-MM-dd HH:mm:ss'); this.obj.startTime = this.datePipe.transform(this.timeBegin, 'yyyy/MM/dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.timeEnd, 'yyyy-MM-dd HH:mm:ss'); this.obj.endTime = this.datePipe.transform(this.timeEnd, 'yyyy/MM/dd HH:mm:ss');
} }
this.getEcharts(); this.getEcharts();
} }
......
...@@ -200,47 +200,47 @@ export class CommonService implements OnInit { ...@@ -200,47 +200,47 @@ export class CommonService implements OnInit {
switch (timeType) { switch (timeType) {
case'0': { //最近一小时 case'0': { //最近一小时
day1 = nowDate - 1 * 60 * 60 * 1000; day1 = nowDate - 1 * 60 * 60 * 1000;
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd HH:mm:ss'); obj.startTime = this.datePipe.transform(day1, 'yyyy/MM/dd HH:mm:ss');
obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd HH:mm:ss'); obj.endTime = this.datePipe.transform(nowDate, 'yyyy/MM/dd HH:mm:ss');
break; break;
} }
case'1': { //今天 case'1': { //今天
obj.startTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 00:00:00'; obj.startTime = this.datePipe.transform(nowDate, 'yyyy/MM/dd') + ' 00:00:00';
obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59'; obj.endTime = this.datePipe.transform(nowDate, 'yyyy/MM/dd') + ' 23:59:59';
break; break;
} }
case'2': { //昨天 case'2': { //昨天
day1 = nowDate - 1 * 24 * 60 * 60 * 1000; day1 = nowDate - 1 * 24 * 60 * 60 * 1000;
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00'; obj.startTime = this.datePipe.transform(day1, 'yyyy/MM/dd') + ' 00:00:00';
obj.endTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 23:59:59'; obj.endTime = this.datePipe.transform(day1, 'yyyy/MM/dd') + ' 23:59:59';
break; break;
} }
case'3': { //最近三天 case'3': { //最近三天
day1 = nowDate - 3 * 24 * 60 * 60 * 1000; day1 = nowDate - 3 * 24 * 60 * 60 * 1000;
day2 = nowDate; day2 = nowDate;
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00'; obj.startTime = this.datePipe.transform(day1, 'yyyy/MM/dd') + ' 00:00:00';
obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59'; obj.endTime = this.datePipe.transform(day2, 'yyyy/MM/dd') + ' 23:59:59';
break; break;
} }
case'4': { //最近一周 case'4': { //最近一周
day1 = nowDate - 7 * 24 * 60 * 60 * 1000; day1 = nowDate - 7 * 24 * 60 * 60 * 1000;
day2 = nowDate; day2 = nowDate;
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00'; obj.startTime = this.datePipe.transform(day1, 'yyyy/MM/dd') + ' 00:00:00';
obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59'; obj.endTime = this.datePipe.transform(day2, 'yyyy/MM/dd') + ' 23:59:59';
break; break;
} }
case'5': { //最近一个月 case'5': { //最近一个月
day1 = nowDate - 30 * 24 * 60 * 60 * 1000; day1 = nowDate - 30 * 24 * 60 * 60 * 1000;
day2 = nowDate; day2 = nowDate;
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00'; obj.startTime = this.datePipe.transform(day1, 'yyyy/MM/dd') + ' 00:00:00';
obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59'; obj.endTime = this.datePipe.transform(day2, 'yyyy/MM/dd') + ' 23:59:59';
break; break;
} }
case'6': { //最近一年 case'6': { //最近一年
day1 = nowDate - 365 * 24 * 60 * 60 * 1000; day1 = nowDate - 365 * 24 * 60 * 60 * 1000;
day2 = nowDate; day2 = nowDate;
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00'; obj.startTime = this.datePipe.transform(day1, 'yyyy/MM/dd') + ' 00:00:00';
obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59'; obj.endTime = this.datePipe.transform(day2, 'yyyy/MM/dd') + ' 23:59:59';
break; break;
} }
case'7': { case'7': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment