summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/home/home.component.ts
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2019-08-23 17:02:50 +0800
committercyuamber <xuranyjy@chinamobile.com>2019-08-23 17:33:55 +0800
commitc048639a46be107578e8ce0d8721bc7b5d4fe791 (patch)
tree3dd670c62d70897df604237bd99fc2562045fe9f /usecaseui-portal/src/app/views/home/home.component.ts
parent1ed096510209590d1656489a74692eb5ebcdeee4 (diff)
feat:optimize public function and home page api
Change-Id: Idf849f381af9adbfae7d8a6e012d8949d170c666 Issue-ID: USECASEUI-307 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/home/home.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/home/home.component.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/usecaseui-portal/src/app/views/home/home.component.ts b/usecaseui-portal/src/app/views/home/home.component.ts
index 681e272f..153e2219 100644
--- a/usecaseui-portal/src/app/views/home/home.component.ts
+++ b/usecaseui-portal/src/app/views/home/home.component.ts
@@ -16,6 +16,7 @@
import { Component, OnInit, Input, Output, EventEmitter, HostBinding } from '@angular/core';
import { HomesService } from '../../core/services/homes.service';
import { slideToRight } from '../../shared/utils/animates';
+import { Util } from '../../shared/utils/utils';
import { TranslateService } from "@ngx-translate/core";
import { Router } from '@angular/router';
@@ -28,7 +29,11 @@ import { Router } from '@angular/router';
export class HomeComponent implements OnInit {
@HostBinding('@routerAnimate') routerAnimateState;
- constructor(private myhttp: HomesService, private router: Router) { }
+ constructor(
+ private myhttp: HomesService,
+ private router: Router,
+ private Util: Util
+ ) { }
ngOnInit() {
this.getListSortMasters();
@@ -495,8 +500,8 @@ export class HomeComponent implements OnInit {
}
}
getHomeAlarmChartData() {
- let nowTime = this.myhttp.dateformater(Date.now());
- let startTime = this.myhttp.dateformater(Date.now() - 30 * 24 * 60 * 60 * 1000);
+ let nowTime = this.Util.dateformater(Date.now());
+ let startTime = this.Util.dateformater(Date.now() - 30 * 24 * 60 * 60 * 1000);
let obj = {
sourceName: this.sourceNameSelected,
startTime: startTime,