1
2
3
4
5
6
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
| import { Component, OnInit, OnDestroy } from '@angular/core';
| import { zip } from 'rxjs';
| import { NzMessageService } from 'ng-zorro-antd';
| import { getTimeDistance, yuan } from '@delon/util';
| import { _HttpClient } from '@delon/theme';
| import { JWTTokenModel } from '@delon/auth';
|
| @Component({
| selector: 'app-dashboard-workplace',
| templateUrl: './workplace.component.html',
| styleUrls: ['./workplace.component.less'],
| })
| export class DashboardWorkplaceComponent implements OnInit, OnDestroy {
| notice: any[] = [];
| activities: any[] = [];
| radarData: any[] = [];
| loading = true;
|
| // region: mock data
| links = [
| {
| title: '操作一',
| href: '',
| },
| {
| title: '操作二',
| href: '',
| },
| {
| title: '操作三',
| href: '',
| },
| {
| title: '操作四',
| href: '',
| },
| {
| title: '操作五',
| href: '',
| },
| {
| title: '操作六',
| href: '',
| },
| ];
| members = [
| {
| id: 'members-1',
| title: '科学搬砖组',
| logo:
| 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
| link: '',
| },
| {
| id: 'members-2',
| title: '程序员日常',
| logo:
| 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
| link: '',
| },
| {
| id: 'members-3',
| title: '设计天团',
| logo:
| 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png',
| link: '',
| },
| {
| id: 'members-4',
| title: '中二少女团',
| logo:
| 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png',
| link: '',
| },
| {
| id: 'members-5',
| title: '骗你学计算机',
| logo:
| 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png',
| link: '',
| },
| ];
| // endregion
|
| constructor(private http: _HttpClient, public msg: NzMessageService) {}
|
| ngOnInit() {
| this.http.get('user-context').subscribe(
| res => {
| console.log(res);
| }
| );
| zip(
| this.http.get('/chart'),
| this.http.get('/api/notice'),
| this.http.get('/api/activities'),
| ).subscribe(([chart, notice, activities]: [any, any, any]) => {
| this.radarData = chart.radarData;
| this.notice = notice;
| this.activities = activities.map((item: any) => {
| item.template = item.template
| .split(/@\{([^{}]*)\}/gi)
| .map((key: string) => {
| if (item[key]) return `<a>${item[key].name}</a>`;
| return key;
| });
| return item;
| });
| this.loading = false;
| });
| }
|
| ngOnDestroy(): void {}
| }
|
|