|
@@ -1,4 +1,4 @@
|
|
|
-import { Component, Input } from '@angular/core';
|
|
|
+import { Component, Input, SimpleChanges } from '@angular/core';
|
|
|
import { PieChartComponent } from '../pie-chart/pie-chart.component';
|
|
|
import { CommonNzModule } from './../../../../../common.nz.module';
|
|
|
import { PanelHeaderComponent } from './../panel-header/panel-header.component';
|
|
@@ -20,6 +20,18 @@ const greenColor: [string, string] = ['#53EFCD', '#24D3AC'];
|
|
|
export class PlanPanelComponent {
|
|
|
@Input() data: Datav.HazardStatisticsData | null = null;
|
|
|
|
|
|
+ total = 0;
|
|
|
+ deadline = 0;
|
|
|
+
|
|
|
+ ngOnChanges(changes: SimpleChanges): void {
|
|
|
+ if (changes['data']) {
|
|
|
+ if (this.data) {
|
|
|
+ this.setTotal();
|
|
|
+ this.setInfoValues();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
infos: { name: string; value: number; percent: string; colors: [string, string] }[] = [
|
|
|
{ name: '排查任务未制定', value: 30, percent: '30%', colors: redColor },
|
|
|
{ name: '已制定但未下发', value: 16, percent: '16%', colors: whiteColor },
|
|
@@ -27,4 +39,26 @@ export class PlanPanelComponent {
|
|
|
{ name: '排查任务已开展', value: 20, percent: '20%', colors: greenColor },
|
|
|
{ name: '排查任务已结束', value: 10, percent: '10%', colors: yellowColor },
|
|
|
];
|
|
|
+
|
|
|
+ setTotal() {
|
|
|
+ this.total = this.data?.troubleshootResolveInfo.total || 0;
|
|
|
+ this.deadline = this.data?.troubleshootResolveAdventNumber || 0;
|
|
|
+ }
|
|
|
+ setInfoValues() {
|
|
|
+ const [unMake, made, publish, processing, completed] = this.infos;
|
|
|
+ unMake.value = this.data?.troubleshootResolveInfo?.unformulated || 0;
|
|
|
+ unMake.percent = this.data?.troubleshootResolveInfo?.unformulatedPercentage || '0%';
|
|
|
+
|
|
|
+ made.value = this.data?.troubleshootResolveInfo?.unissued || 0;
|
|
|
+ made.percent = this.data?.troubleshootResolveInfo?.unissuedPercentage || '0%';
|
|
|
+ publish.value = this.data?.troubleshootResolveInfo?.uninitiated || 0;
|
|
|
+
|
|
|
+ publish.percent = this.data?.troubleshootResolveInfo?.uninitiatedPercentage || '0%';
|
|
|
+ processing.value = this.data?.troubleshootResolveInfo?.initiated || 0;
|
|
|
+
|
|
|
+ processing.percent = this.data?.troubleshootResolveInfo?.initiatedPercentage || '0%';
|
|
|
+ completed.value = this.data?.troubleshootResolveInfo?.completed || 0;
|
|
|
+
|
|
|
+ this.infos = this.infos.slice(); // for refreshing chart
|
|
|
+ }
|
|
|
}
|