Commit b287c733 authored by wangqinghua's avatar wangqinghua

(click)="ngOnInit()"

parent aa1c5319
......@@ -120,9 +120,9 @@
</div>
<div nz-col nzSpan="12" class="height-150" echarts [options]="item.option"></div>
<div class="chart-font">
<p>CPU使用率 {{item.cpu}}%</p>
<p>内存使用率 0%</p>
<p>带宽使用率 {{item.lose}}%</p>
<p> <nz-tag nzColor="#f09363"></nz-tag> CPU使用率 {{item.cpu}}%</p>
<p> <nz-tag nzColor="#80ba78"></nz-tag> 内存使用率 0%</p>
<p> <nz-tag nzColor="#73b6e4"></nz-tag> 带宽使用率 {{item.lose}}%</p>
</div>
</div>
......
......@@ -169,7 +169,12 @@ export class HomeComponent implements OnInit,AfterViewInit {
},
data: [{
value: e.cpu,
name: 'CPU使用率'
name: 'CPU使用率',
itemStyle: {
normal: {
color: "#f09363"
}
}
},
{
value: 100 - e.cpu,
......@@ -191,11 +196,16 @@ export class HomeComponent implements OnInit,AfterViewInit {
hoverAnimation: false,
startAngle: 90,
data: [{
value: e.memory,
name: '内存使用率'
value: 0,
name: '内存使用率',
itemStyle: {
normal: {
color: "#80ba78"
}
}
},
{
value: 0,
value: 100,
name: '',
tooltip: {
show: false
......@@ -215,7 +225,12 @@ export class HomeComponent implements OnInit,AfterViewInit {
startAngle: 90,
data: [{
value: e.lose,
name: '带宽使用率'
name: '带宽使用率',
itemStyle: {
normal: {
color: "#73b6e4"
}
}
},
{
value: 100 - e.lose,
......@@ -265,7 +280,12 @@ export class HomeComponent implements OnInit,AfterViewInit {
}
setLeftOne(data){
this.leftOneDataPre = {
highPer:0,
warningPer:0,
normalPer:0,
disabledPer:0,
};
this.leftOneTotal = data.disabled + data.high + data.normal + data.warning;
if(this.leftOneData.high > 0){
......@@ -348,6 +368,12 @@ export class HomeComponent implements OnInit,AfterViewInit {
}
setLeftTwo(data){
this.leftTwoDataPre = {
highPer:0,
warningPer:0,
normalPer:0,
disabledPer:0,
};
this.leftTwoTotal = data.disabled + data.high + data.normal + data.warning;
if(this.leftTwoData.high > 0){
let w:any = ( (this.leftTwoData.high / this.leftTwoTotal)*100 );
......
......@@ -100,8 +100,13 @@ p {
right: 15px;
}
.chart-font{
font-size: 12px;
position: absolute;
top: 50%;
right: 5%;
transform: translate(10%,-50%);
}
:host ::ng-deep .ant-tag{
height: 16px;
vertical-align: middle;
}
\ No newline at end of file
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