2 Commits 03cf388072 ... 00c2243467

Author SHA1 Message Date
  Carlos 00c2243467 feat: update color of hazarded stations in DataV line map for chart consistency 5 days ago
  Carlos 06f045d1b1 fix: pass total property 6 days ago

+ 3 - 2
src/app/classes/d3/line.class.ts

@@ -1,7 +1,8 @@
 import { ElementRef, inject } from '@angular/core';
 import * as d3 from 'd3';
 import { Subject } from 'rxjs';
-import { hazardLevelColor, hazardLevels } from '../../pages/manager/hazard/hazard.utils';
+import { datavHazardLevelColor } from '../../pages/datav/datav.utils';
+import { hazardLevels } from '../../pages/manager/hazard/hazard.utils';
 import { Svg, SvgGroup } from './d3.utils';
 import { Station, StationD3Model } from './station.class';
 
@@ -48,7 +49,7 @@ export class LineD3Model {
   getHighlightColor(ids: number[], troubleList: Hazard.HazardDto[]) {
     const targetHazards = troubleList.filter(item => ids.includes(item.id));
     const highestLevel = hazardLevels.find(level => targetHazards.every(item => item.level === level));
-    return highestLevel ? hazardLevelColor[highestLevel] : undefined;
+    return highestLevel ? datavHazardLevelColor[highestLevel] : undefined;
   }
   initializeSvg() {
     // 创建 SVG 容器

+ 6 - 0
src/app/pages/datav/datav.utils.ts

@@ -0,0 +1,6 @@
+export const datavHazardLevelColor: Record<string, string> = {
+  '重大': '#FE6257',
+  'A': '#24D3AC',
+  B: '#F7C335',
+  C: '#327DFE',
+};

+ 3 - 2
src/app/pages/datav/digital-line/main-metro/main-metro.component.ts

@@ -2,7 +2,8 @@ import { Component, ElementRef, Input, ViewChild } from '@angular/core';
 import { StationEvent } from '../../../../classes/d3/line.class';
 import { StationD3Model } from '../../../../classes/d3/station.class';
 import { horizontalInOutReverse } from '../../../../common.animation';
-import { hazardLevelColor, hazardLevelOptions } from '../../../manager/hazard/hazard.utils';
+import { hazardLevelOptions } from '../../../manager/hazard/hazard.utils';
+import { datavHazardLevelColor } from '../../datav.utils';
 import { CommonNzModule } from './../../../../common.nz.module';
 import { KnowledgeService } from './../../../../services/knowledge.service';
 import { LineAirportComponent } from './../../../../shared/line/airport/airport.component';
@@ -55,7 +56,7 @@ export class MainMetroComponent {
     this.hazardLevels = hazardLevelOptions.map(option => ({
       label: option.label + '隐患',
       value: this.currentHazardItems.filter(item => item.level === option.value).length,
-      color: hazardLevelColor[option.value],
+      color: datavHazardLevelColor[option.value],
       key: option.value,
       checked: true,
     }));

+ 1 - 0
src/app/pages/datav/digital-line/right-panel/plan-panel/plan-panel.component.html

@@ -11,6 +11,7 @@
     <datav-pie-chart
       class="relative z-20"
       [height]="222"
+      [total]="total"
       title="排查计划"
       [static]="true"
       [data]="infos"