押金前期实收
This commit is contained in:
@@ -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],
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
t-att-data-card-label="slice.label"
|
||||
style="cursor: pointer;">
|
||||
<span class="legend-color" t-att-style="'background: ' + slice.color + ';'"/>
|
||||
<span class="legend-label" t-esc="slice.label"/>
|
||||
<span class="legend-label" t-esc="slice.displayLabel"/>
|
||||
<span class="legend-value" t-esc="formatValue(slice.rawValue)"/>
|
||||
<span class="legend-percent" t-esc="slice.percent + '%'"/>
|
||||
</div>
|
||||
@@ -164,12 +164,12 @@
|
||||
<div class="bar-item" t-on-click="onChartClick"
|
||||
t-att-data-section-id="sec.id"
|
||||
t-att-data-card-label="bar.label"
|
||||
t-att-title="bar.label" style="cursor: pointer;">
|
||||
t-att-title="bar.displayLabel" style="cursor: pointer;">
|
||||
<div class="bar-value" t-esc="formatValue(bar.rawValue)"/>
|
||||
<div class="bar-track">
|
||||
<div class="bar-rect" t-att-style="'height: ' + bar.heightPct + '%; background: ' + bar.color + ';'"/>
|
||||
</div>
|
||||
<div class="bar-label" t-esc="bar.label"/>
|
||||
<div class="bar-label" t-esc="bar.displayLabel"/>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user