2021-12-23 15:59:49 +08:00
|
|
|
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnDestroy, OnInit } from '@angular/core';
|
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
|
import { I18NService } from '@core';
|
|
|
|
|
|
import { ALAIN_I18N_TOKEN } from '@delon/theme';
|
2021-12-08 12:11:35 +08:00
|
|
|
|
import { EChartsOption } from 'echarts';
|
2021-12-23 15:59:49 +08:00
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
2022-01-30 10:16:23 +08:00
|
|
|
|
import { fromEvent } from 'rxjs';
|
2021-12-23 15:59:49 +08:00
|
|
|
|
|
2022-03-06 21:48:00 +08:00
|
|
|
|
import { Alert } from '../../pojo/Alert';
|
|
|
|
|
|
import { AppCount } from '../../pojo/AppCount';
|
|
|
|
|
|
import { AlertService } from '../../service/alert.service';
|
2021-12-23 15:59:49 +08:00
|
|
|
|
import { MonitorService } from '../../service/monitor.service';
|
2021-11-27 22:21:52 +08:00
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
|
selector: 'app-dashboard',
|
|
|
|
|
|
templateUrl: './dashboard.component.html',
|
2021-11-28 14:58:20 +08:00
|
|
|
|
styleUrls: ['./dashboard.component.less'],
|
2021-11-27 22:21:52 +08:00
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
|
|
|
|
})
|
2021-12-08 12:11:35 +08:00
|
|
|
|
export class DashboardComponent implements OnInit, OnDestroy {
|
2021-12-23 15:59:49 +08:00
|
|
|
|
constructor(
|
|
|
|
|
|
private msg: NzMessageService,
|
|
|
|
|
|
private monitorSvc: MonitorService,
|
2022-03-06 21:48:00 +08:00
|
|
|
|
private alertSvc: AlertService,
|
2021-12-23 15:59:49 +08:00
|
|
|
|
@Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService,
|
|
|
|
|
|
private router: Router,
|
|
|
|
|
|
private cdr: ChangeDetectorRef
|
|
|
|
|
|
) {}
|
2021-12-02 21:34:05 +08:00
|
|
|
|
|
2022-03-06 21:48:00 +08:00
|
|
|
|
// start 大类别数量信息
|
|
|
|
|
|
appCountService: AppCount = new AppCount();
|
|
|
|
|
|
appCountOs: AppCount = new AppCount();
|
|
|
|
|
|
appCountDb: AppCount = new AppCount();
|
|
|
|
|
|
appCountCustom: AppCount = new AppCount();
|
|
|
|
|
|
|
|
|
|
|
|
// start 数量全局概览
|
2021-12-08 12:11:35 +08:00
|
|
|
|
interval$!: number;
|
|
|
|
|
|
appsCountLoading: boolean = true;
|
|
|
|
|
|
appsCountTableData: any[] = [];
|
|
|
|
|
|
appsCountEChartOption!: EChartsOption;
|
2022-01-30 10:16:23 +08:00
|
|
|
|
appsCountTheme!: EChartsOption;
|
2022-03-06 21:48:00 +08:00
|
|
|
|
appsCountEchartsInstance!: any;
|
2022-01-30 10:16:23 +08:00
|
|
|
|
pageResize$!: any;
|
2021-12-02 21:34:05 +08:00
|
|
|
|
|
2022-03-06 21:48:00 +08:00
|
|
|
|
// 告警列表
|
|
|
|
|
|
alerts!: Alert[];
|
|
|
|
|
|
|
2021-12-02 21:34:05 +08:00
|
|
|
|
ngOnInit(): void {
|
2022-01-30 10:16:23 +08:00
|
|
|
|
this.appsCountTheme = {
|
|
|
|
|
|
title: {
|
2022-04-11 22:59:36 +08:00
|
|
|
|
text: this.i18nSvc.fanyi('dashboard.monitors.title'),
|
|
|
|
|
|
subtext: this.i18nSvc.fanyi('dashboard.monitors.sub-title'),
|
2022-01-30 10:16:23 +08:00
|
|
|
|
left: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
trigger: 'item',
|
2022-04-11 22:59:36 +08:00
|
|
|
|
formatter: `{a} <br/>{b} : {c}${this.i18nSvc.fanyi('dashboard.monitors.formatter')}({d}%)`
|
2022-01-30 10:16:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
legend: {
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
itemWidth: 80,
|
|
|
|
|
|
itemHeight: 20,
|
|
|
|
|
|
right: 0,
|
|
|
|
|
|
orient: 'vertical'
|
|
|
|
|
|
},
|
|
|
|
|
|
calculable: true,
|
|
|
|
|
|
series: [
|
|
|
|
|
|
{
|
2022-04-11 22:59:36 +08:00
|
|
|
|
name: this.i18nSvc.fanyi('dashboard.monitors.total'),
|
2022-01-30 10:16:23 +08:00
|
|
|
|
type: 'pie',
|
|
|
|
|
|
selectedMode: 'single',
|
|
|
|
|
|
color: '#722ED1',
|
|
|
|
|
|
radius: [0, '30%'],
|
|
|
|
|
|
label: {
|
|
|
|
|
|
position: 'center',
|
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
|
color: '#ffffff',
|
|
|
|
|
|
fontStyle: 'oblique',
|
|
|
|
|
|
formatter: '{a}:{c}'
|
|
|
|
|
|
},
|
|
|
|
|
|
labelLine: {
|
|
|
|
|
|
show: false
|
|
|
|
|
|
},
|
2022-04-11 22:59:36 +08:00
|
|
|
|
data: [{ value: 0, name: this.i18nSvc.fanyi('dashboard.monitors.total') }]
|
2022-01-30 10:16:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2022-04-11 22:59:36 +08:00
|
|
|
|
name: this.i18nSvc.fanyi('dashboard.monitors.distribute'),
|
2022-01-30 10:16:23 +08:00
|
|
|
|
type: 'pie',
|
|
|
|
|
|
radius: ['45%', '65%'],
|
|
|
|
|
|
labelLine: {
|
|
|
|
|
|
length: 30
|
|
|
|
|
|
},
|
|
|
|
|
|
label: {
|
|
|
|
|
|
formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ',
|
|
|
|
|
|
backgroundColor: '#F6F8FC',
|
|
|
|
|
|
borderColor: '#8C8D8E',
|
|
|
|
|
|
borderWidth: 1,
|
|
|
|
|
|
borderRadius: 4,
|
|
|
|
|
|
rich: {
|
|
|
|
|
|
a: {
|
|
|
|
|
|
color: '#6E7079',
|
|
|
|
|
|
lineHeight: 22,
|
|
|
|
|
|
align: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
hr: {
|
|
|
|
|
|
borderColor: '#8C8D8E',
|
|
|
|
|
|
width: '100%',
|
|
|
|
|
|
borderWidth: 1,
|
|
|
|
|
|
height: 0
|
|
|
|
|
|
},
|
|
|
|
|
|
b: {
|
|
|
|
|
|
color: '#4C5058',
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
fontWeight: 'bold',
|
|
|
|
|
|
lineHeight: 33
|
|
|
|
|
|
},
|
|
|
|
|
|
per: {
|
|
|
|
|
|
color: '#fff',
|
|
|
|
|
|
backgroundColor: '#4C5058',
|
|
|
|
|
|
padding: [3, 4],
|
|
|
|
|
|
borderRadius: 4
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
};
|
2022-03-06 21:48:00 +08:00
|
|
|
|
this.alertsTheme = {
|
|
|
|
|
|
title: {
|
2022-04-11 22:59:36 +08:00
|
|
|
|
subtext: this.i18nSvc.fanyi('dashboard.alerts.distribute'),
|
2022-03-06 21:48:00 +08:00
|
|
|
|
left: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
|
axisPointer: {
|
|
|
|
|
|
type: 'shadow'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
xAxis: {
|
|
|
|
|
|
type: 'category',
|
2022-04-11 22:59:36 +08:00
|
|
|
|
data: [this.i18nSvc.fanyi('alert.priority.2'), this.i18nSvc.fanyi('alert.priority.1'), this.i18nSvc.fanyi('alert.priority.0')]
|
2022-03-06 21:48:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
yAxis: {
|
|
|
|
|
|
type: 'value'
|
|
|
|
|
|
},
|
|
|
|
|
|
series: [
|
|
|
|
|
|
{
|
2022-04-11 22:59:36 +08:00
|
|
|
|
name: this.i18nSvc.fanyi('dashboard.alerts.num'),
|
2022-03-06 21:48:00 +08:00
|
|
|
|
type: 'bar',
|
|
|
|
|
|
data: [
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 0,
|
|
|
|
|
|
// 设置单个柱子的样式
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: '#ffb72b',
|
|
|
|
|
|
shadowColor: '#91cc75'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 0,
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: '#fa6202',
|
|
|
|
|
|
shadowColor: '#91cc75'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: 0,
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: '#dc1313',
|
|
|
|
|
|
shadowColor: '#91cc75'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
};
|
|
|
|
|
|
this.alertsDealTheme = {
|
|
|
|
|
|
title: {
|
2022-04-11 22:59:36 +08:00
|
|
|
|
subtext: this.i18nSvc.fanyi('dashboard.alerts.deal'),
|
2022-03-06 21:48:00 +08:00
|
|
|
|
left: 'center'
|
|
|
|
|
|
},
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
formatter: '{b} : {c}%'
|
|
|
|
|
|
},
|
|
|
|
|
|
series: [
|
|
|
|
|
|
{
|
2022-04-11 22:59:36 +08:00
|
|
|
|
name: this.i18nSvc.fanyi('dashboard.alerts.deal-percent'),
|
2022-03-06 21:48:00 +08:00
|
|
|
|
type: 'gauge',
|
|
|
|
|
|
progress: {
|
|
|
|
|
|
show: true
|
|
|
|
|
|
},
|
|
|
|
|
|
detail: {
|
|
|
|
|
|
valueAnimation: true,
|
|
|
|
|
|
formatter: '{value}'
|
|
|
|
|
|
},
|
|
|
|
|
|
data: [
|
|
|
|
|
|
{
|
2022-03-07 08:47:17 +08:00
|
|
|
|
value: 100,
|
2022-04-11 22:59:36 +08:00
|
|
|
|
name: this.i18nSvc.fanyi('dashboard.alerts.deal-percent')
|
2022-03-06 21:48:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
};
|
|
|
|
|
|
this.appsCountLoading = true;
|
|
|
|
|
|
this.alertsLoading = true;
|
2021-12-02 21:34:05 +08:00
|
|
|
|
this.refresh();
|
2021-12-08 12:11:35 +08:00
|
|
|
|
// https://stackoverflow.com/questions/43908009/why-is-setinterval-in-an-angular-service-only-firing-one-time
|
2021-12-08 14:56:19 +08:00
|
|
|
|
this.interval$ = setInterval(this.refresh.bind(this), 30000);
|
2022-01-30 10:16:23 +08:00
|
|
|
|
this.pageResize$ = fromEvent(window, 'resize').subscribe(event => {
|
|
|
|
|
|
this.resizeChart();
|
|
|
|
|
|
});
|
2021-12-02 21:34:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-08 12:11:35 +08:00
|
|
|
|
ngOnDestroy(): void {
|
|
|
|
|
|
clearInterval(this.interval$);
|
2022-01-30 10:16:23 +08:00
|
|
|
|
if (this.pageResize$) {
|
|
|
|
|
|
this.pageResize$.unsubscribe();
|
|
|
|
|
|
}
|
2021-12-02 21:34:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-08 12:11:35 +08:00
|
|
|
|
refresh(): void {
|
2022-03-06 21:48:00 +08:00
|
|
|
|
this.refreshAppsCount();
|
|
|
|
|
|
this.refreshAlertContentList();
|
|
|
|
|
|
this.refreshAlertSummary();
|
|
|
|
|
|
}
|
|
|
|
|
|
refreshAppsCount(): void {
|
|
|
|
|
|
this.appCountService = new AppCount();
|
|
|
|
|
|
this.appCountOs = new AppCount();
|
|
|
|
|
|
this.appCountDb = new AppCount();
|
|
|
|
|
|
this.appCountCustom = new AppCount();
|
2021-12-23 15:59:49 +08:00
|
|
|
|
let dashboard$ = this.monitorSvc.getAppsMonitorSummary().subscribe(
|
|
|
|
|
|
message => {
|
2021-12-08 12:11:35 +08:00
|
|
|
|
dashboard$.unsubscribe();
|
2022-01-30 10:16:23 +08:00
|
|
|
|
if (message.code === 0 && message.data.apps != undefined) {
|
2021-12-08 12:11:35 +08:00
|
|
|
|
// {app:'linux',size: 12}
|
2022-03-06 21:48:00 +08:00
|
|
|
|
let apps: AppCount[] = message.data.apps;
|
2021-12-08 12:11:35 +08:00
|
|
|
|
this.appsCountTableData = [];
|
|
|
|
|
|
let total = 0;
|
|
|
|
|
|
apps.forEach(app => {
|
2021-12-23 15:59:49 +08:00
|
|
|
|
let appName = this.i18nSvc.fanyi(`monitor.app.${app.app}`);
|
2021-12-08 12:11:35 +08:00
|
|
|
|
this.appsCountTableData.push({
|
|
|
|
|
|
// 自定义属性
|
|
|
|
|
|
app: app.app,
|
|
|
|
|
|
// 默认属性
|
|
|
|
|
|
name: appName,
|
|
|
|
|
|
value: app.size
|
|
|
|
|
|
});
|
2022-01-30 10:16:23 +08:00
|
|
|
|
total = total + (app.size ? app.size : 0);
|
2022-03-06 21:48:00 +08:00
|
|
|
|
switch (app.category) {
|
|
|
|
|
|
case 'service':
|
|
|
|
|
|
this.appCountService.size += app.size;
|
|
|
|
|
|
this.appCountService.availableSize += app.availableSize;
|
|
|
|
|
|
this.appCountService.unAvailableSize += app.unAvailableSize;
|
|
|
|
|
|
this.appCountService.unManageSize += app.unManageSize;
|
|
|
|
|
|
this.appCountService.unReachableSize += app.unReachableSize;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'db':
|
|
|
|
|
|
this.appCountDb.size += app.size;
|
|
|
|
|
|
this.appCountDb.availableSize += app.availableSize;
|
|
|
|
|
|
this.appCountDb.unAvailableSize += app.unAvailableSize;
|
|
|
|
|
|
this.appCountDb.unManageSize += app.unManageSize;
|
|
|
|
|
|
this.appCountDb.unReachableSize += app.unReachableSize;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'os':
|
|
|
|
|
|
this.appCountOs.size += app.size;
|
|
|
|
|
|
this.appCountOs.availableSize += app.availableSize;
|
|
|
|
|
|
this.appCountOs.unAvailableSize += app.unAvailableSize;
|
|
|
|
|
|
this.appCountOs.unManageSize += app.unManageSize;
|
|
|
|
|
|
this.appCountOs.unReachableSize += app.unReachableSize;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'custom':
|
|
|
|
|
|
this.appCountCustom.size += app.size;
|
|
|
|
|
|
this.appCountCustom.availableSize += app.availableSize;
|
|
|
|
|
|
this.appCountCustom.unAvailableSize += app.unAvailableSize;
|
|
|
|
|
|
this.appCountCustom.unManageSize += app.unManageSize;
|
|
|
|
|
|
this.appCountCustom.unReachableSize += app.unReachableSize;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
2021-12-08 12:11:35 +08:00
|
|
|
|
});
|
2022-01-30 10:16:23 +08:00
|
|
|
|
// @ts-ignore
|
2022-04-11 22:59:36 +08:00
|
|
|
|
this.appsCountTheme.series[0].data = [{ value: total, name: this.i18nSvc.fanyi('dashboard.monitors.total') }];
|
2022-01-30 10:16:23 +08:00
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
this.appsCountTheme.series[1].data = this.appsCountTableData;
|
|
|
|
|
|
this.appsCountEChartOption = this.appsCountTheme;
|
|
|
|
|
|
this.cdr.detectChanges();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.appsCountEChartOption = this.appsCountTheme;
|
2021-12-08 12:11:35 +08:00
|
|
|
|
this.cdr.detectChanges();
|
|
|
|
|
|
}
|
2022-03-06 21:48:00 +08:00
|
|
|
|
this.appsCountLoading = false;
|
2021-12-23 15:59:49 +08:00
|
|
|
|
},
|
|
|
|
|
|
error => {
|
2021-12-08 12:11:35 +08:00
|
|
|
|
console.error(error);
|
2022-03-06 21:48:00 +08:00
|
|
|
|
this.appsCountLoading = false;
|
2021-12-08 12:11:35 +08:00
|
|
|
|
dashboard$.unsubscribe();
|
2021-12-23 15:59:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
);
|
2021-12-02 21:34:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-08 12:11:35 +08:00
|
|
|
|
onChartClick(click: any) {
|
|
|
|
|
|
if (click != undefined) {
|
|
|
|
|
|
let app = click.data?.app;
|
|
|
|
|
|
if (app != undefined) {
|
|
|
|
|
|
this.router.navigate(['/monitors'], { queryParams: { app: app } });
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-01-30 10:16:23 +08:00
|
|
|
|
|
2022-03-06 21:48:00 +08:00
|
|
|
|
onAppsCountChartInit(ec: any) {
|
|
|
|
|
|
this.appsCountEchartsInstance = ec;
|
|
|
|
|
|
}
|
|
|
|
|
|
onAlertNumChartInit(ec: any) {
|
|
|
|
|
|
this.alertsEchartsInstance = ec;
|
|
|
|
|
|
}
|
|
|
|
|
|
onAlertRateChartInit(ec: any) {
|
|
|
|
|
|
this.alertsDealEchartsInstance = ec;
|
2022-01-30 10:16:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
resizeChart() {
|
2022-03-06 21:48:00 +08:00
|
|
|
|
if (this.appsCountEchartsInstance) {
|
|
|
|
|
|
this.appsCountEchartsInstance.resize();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.alertsEchartsInstance) {
|
|
|
|
|
|
this.alertsEchartsInstance.resize();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.alertsDealEchartsInstance) {
|
|
|
|
|
|
this.alertsDealEchartsInstance.resize();
|
2022-01-30 10:16:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-03-06 21:48:00 +08:00
|
|
|
|
|
|
|
|
|
|
// start 告警分布
|
|
|
|
|
|
alertsEChartOption!: EChartsOption;
|
|
|
|
|
|
alertsTheme!: EChartsOption;
|
|
|
|
|
|
alertsEchartsInstance!: any;
|
|
|
|
|
|
alertsLoading: boolean = true;
|
|
|
|
|
|
|
|
|
|
|
|
refreshAlerts(): void {
|
|
|
|
|
|
this.alertsEChartOption = this.alertsTheme;
|
|
|
|
|
|
this.cdr.detectChanges();
|
|
|
|
|
|
this.alertsLoading = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// start 告警处理率
|
|
|
|
|
|
alertsDealEChartOption!: EChartsOption;
|
|
|
|
|
|
alertsDealTheme!: EChartsOption;
|
|
|
|
|
|
alertsDealEchartsInstance!: any;
|
|
|
|
|
|
alertsDealLoading: boolean = true;
|
|
|
|
|
|
|
|
|
|
|
|
refreshAlertContentList(): void {
|
|
|
|
|
|
let alertsInit$ = this.alertSvc.getAlerts(0, 4).subscribe(
|
|
|
|
|
|
message => {
|
|
|
|
|
|
if (message.code === 0) {
|
|
|
|
|
|
let page = message.data;
|
|
|
|
|
|
this.alerts = page.content;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
console.warn(message.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
alertsInit$.unsubscribe();
|
|
|
|
|
|
},
|
|
|
|
|
|
error => {
|
|
|
|
|
|
alertsInit$.unsubscribe();
|
|
|
|
|
|
console.error(error.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
refreshAlertSummary(): void {
|
|
|
|
|
|
let alertSummaryInit$ = this.alertSvc.getAlertsSummary().subscribe(
|
|
|
|
|
|
message => {
|
|
|
|
|
|
if (message.code === 0) {
|
|
|
|
|
|
let summary = message.data;
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
this.alertsTheme.series[0].data = [
|
|
|
|
|
|
{
|
|
|
|
|
|
value: summary.priorityWarningNum,
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: '#ffb72b',
|
|
|
|
|
|
shadowColor: '#91cc75'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: summary.priorityCriticalNum,
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: '#fa6202',
|
|
|
|
|
|
shadowColor: '#91cc75'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: summary.priorityEmergencyNum,
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: '#dc1313',
|
|
|
|
|
|
shadowColor: '#91cc75'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
];
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
this.alertsDealTheme.series[0].data = [
|
|
|
|
|
|
{
|
|
|
|
|
|
value: summary.rate,
|
2022-04-11 22:59:36 +08:00
|
|
|
|
name: this.i18nSvc.fanyi('dashboard.alerts.deal-percent')
|
2022-03-06 21:48:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
];
|
|
|
|
|
|
this.alertsEChartOption = this.alertsTheme;
|
|
|
|
|
|
this.alertsDealEChartOption = this.alertsDealTheme;
|
|
|
|
|
|
this.cdr.detectChanges();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
console.warn(message.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
alertSummaryInit$.unsubscribe();
|
|
|
|
|
|
},
|
|
|
|
|
|
error => {
|
|
|
|
|
|
alertSummaryInit$.unsubscribe();
|
|
|
|
|
|
this.alertsDealLoading = false;
|
|
|
|
|
|
this.alertsLoading = false;
|
|
|
|
|
|
console.error(error.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2021-12-02 21:34:05 +08:00
|
|
|
|
}
|