diff --git a/yuthon_report/static/src/components/yuthon_dashboard/yuthon_dashboard.js b/yuthon_report/static/src/components/yuthon_dashboard/yuthon_dashboard.js index 5989c3dcc..f18af2487 100644 --- a/yuthon_report/static/src/components/yuthon_dashboard/yuthon_dashboard.js +++ b/yuthon_report/static/src/components/yuthon_dashboard/yuthon_dashboard.js @@ -106,6 +106,15 @@ class YuthonDashboard extends Component { const sections = this.state.dashboardData?.sections || []; const palette = ["#1890ff", "#52c41a", "#faad14", "#f5222d", "#722ed1", "#13c2c2", "#eb2f96", "#fa541c"]; + // 图表显示名:押金板块的「前期实收」明确标注为「押金前期实收」,避免与其他板块同名卡片混淆 + // label 保留原始卡片名(用于点击跳转 lookup),displayLabel 仅用于界面展示 + const chartLabel = (sec, card) => { + if (card.label === "前期实收" && /押金/.test(sec.title || "")) { + return "押金前期实收"; + } + return card.label; + }; + const chartSections = []; const pieRaw = []; @@ -115,6 +124,7 @@ class YuthonDashboard extends Component { .filter((c) => c.action && !c.is_percent) .map((c, idx) => ({ label: c.label, + displayLabel: chartLabel(section, c), value: Math.abs(Number(c.value) || 0), rawValue: Number(c.value) || 0, color: palette[idx % palette.length], @@ -147,6 +157,7 @@ class YuthonDashboard extends Component { return { ...d, path, + displayLabel: d.displayLabel || d.label, percent: ((d.value / total) * 100).toFixed(1), }; }); @@ -164,7 +175,7 @@ class YuthonDashboard extends Component { .forEach((c) => { const idx = section.cards.indexOf(c); allCards.push({ - label: c.label, + label: chartLabel(section, c), value: Math.abs(Number(c.value) || 0), rawValue: Number(c.value) || 0, color: palette[idx % palette.length], diff --git a/yuthon_report/static/src/components/yuthon_dashboard/yuthon_dashboard.xml b/yuthon_report/static/src/components/yuthon_dashboard/yuthon_dashboard.xml index 2523d21b7..213b1930c 100644 --- a/yuthon_report/static/src/components/yuthon_dashboard/yuthon_dashboard.xml +++ b/yuthon_report/static/src/components/yuthon_dashboard/yuthon_dashboard.xml @@ -147,7 +147,7 @@ t-att-data-card-label="slice.label" style="cursor: pointer;"> - + @@ -164,12 +164,12 @@