Newer
Older
import { Component } from '@angular/core';
import { NavController} from 'ionic-angular';
import { Response } from '@angular/http';
import { AppService } from '../../../service/appHttpService';
import { ActivityTrackPage } from '../../activity-track/activityTrack/activityTrack';
import { ReportTrackPage } from '../../report/reportTrack/reportTrack';
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { ActivityStatisticService } from '../../../service/activityStatisticService';
import { Storage } from '@ionic/storage';
@Component({
selector: 'page-workbench',
templateUrl: 'workbench.html'
})
export class WorkbenchPage {
activitycount:number = 0;
reportCount:number = 0;
role:any;
constructor(
public navCtrl: NavController,
public activityStatisticService: ActivityStatisticService,
public appService: AppService,
public storage: Storage
) {
}
ionViewDidLoad(){
//判断角色
this.queryUserRole();
//统计活动数目
this.activityStatisticService.statisticActivityNum((data) => {
this.activitycount = data;
});
this.getReportCount();
}
//统计报备数目
getReportCount(){
this.appService.ObserverHttpPost("/wisdomgroup/modules/premanager/getReportCount", null)
.subscribe((res: Response) => {
let data = res.json();
this.reportCount = data;
}, error => {
this.appService.alert('网络异常!');
}
);
}
goActivityTrack(){
this.navCtrl.push("ActivityTrackPage");
}
goReportTrack(){
this.navCtrl.push("ReportTrackPage");
}
//获取角色
queryUserRole() {
this.storage.get("userLoginInfo").then((data) => {
this.appService.ObserverHttpGet("/wisdomgroup/sysmanagement/user/queryRoleByUserid", { userid: data.userid })
.subscribe((res: Response) => {
this.role = res.json();
//this.storage.set("role",this.role);
}, error => {
this.appService.alert('网络异常!');
}
);
});
}
}