Browse Source

[完善]首页数据完善

beijing
邵佳豪 2 years ago
parent
commit
1359fad5f2
  1. 8
      src/app/pages/home-page/home-page.component.ts

8
src/app/pages/home-page/home-page.component.ts

@ -736,7 +736,7 @@ export class HomePageComponent implements OnInit {
this.warningechartpieOptionAll.series[0].data = this.warningechartpieOptionAll.series[0].data =
data.violationType.violationTypeAggAll; data.violationType.violationTypeAggAll;
this.warningechartpieOptionAll.series[0].label.normal.formatter = this.warningechartpieOptionAll.series[0].label.normal.formatter =
"{total|" + violationTypeAggCountAll + "}" + "\n\r" + "{active|累计预警}"; "{total|" + data.recordCount + "}" + "\n\r" + "{active|累计预警}";
this.warningechartpieAll.setOption(this.warningechartpieOptionAll); this.warningechartpieAll.setOption(this.warningechartpieOptionAll);
// 可调用clearLoop方法,清除定时器 // 可调用clearLoop方法,清除定时器
@ -791,8 +791,8 @@ export class HomePageComponent implements OnInit {
//下面两个柱状图 //下面两个柱状图
isSpinOfEventWarning = false; isSpinOfEventWarning = true;
isSpinOfOilDischarge = false; isSpinOfOilDischarge = true;
get30daysViolate(type, data) { get30daysViolate(type, data) {
//type = true 代表预警 false代表卸油 //type = true 代表预警 false代表卸油
type type
@ -828,6 +828,7 @@ export class HomePageComponent implements OnInit {
let violationTypeAggCount = 0; let violationTypeAggCount = 0;
let monthArr = []; let monthArr = [];
let valuedata = []; let valuedata = [];
data.forEach((element) => { data.forEach((element) => {
violationTypeAggCount += element.count; violationTypeAggCount += element.count;
monthArr.push(moment(element.key).format("MM.DD")); monthArr.push(moment(element.key).format("MM.DD"));
@ -854,7 +855,6 @@ export class HomePageComponent implements OnInit {
}; };
} }
this.warningechartbar.setOption(this.warningechartbarOption); this.warningechartbar.setOption(this.warningechartbarOption);
this.warningechartpieOption.series[0].label.normal.formatter = this.warningechartpieOption.series[0].label.normal.formatter =
"{total|" + violationTypeAggCount + "}" + "\n\r" + "{active|预警事件}"; "{total|" + violationTypeAggCount + "}" + "\n\r" + "{active|预警事件}";
this.warningechartpie.setOption(this.warningechartpieOption); this.warningechartpie.setOption(this.warningechartpieOption);

Loading…
Cancel
Save