Commit 309016838538c0f960fa9b2b11298dd2ab99dc19
1 parent
3aac27a2
fix: 报表点击
Showing
1 changed file
with
6 additions
and
2 deletions
src/pages/OrderReport/components/OrderDualAxes.tsx
@@ -52,7 +52,7 @@ const OrderDualAxes = ({ data, statisticMethod, onXValueClick }) => { | @@ -52,7 +52,7 @@ const OrderDualAxes = ({ data, statisticMethod, onXValueClick }) => { | ||
52 | if (!yearFromXValue) { | 52 | if (!yearFromXValue) { |
53 | return; | 53 | return; |
54 | } | 54 | } |
55 | - | 55 | + console.log(pointData, '5656pointData'); |
56 | // // 减 1 获得目标年份 | 56 | // // 减 1 获得目标年份 |
57 | // const targetYear = String(Number(yearFromXValue) - 1); // "2024" | 57 | // const targetYear = String(Number(yearFromXValue) - 1); // "2024" |
58 | 58 | ||
@@ -62,7 +62,11 @@ const OrderDualAxes = ({ data, statisticMethod, onXValueClick }) => { | @@ -62,7 +62,11 @@ const OrderDualAxes = ({ data, statisticMethod, onXValueClick }) => { | ||
62 | // pointData?.name?.includes(targetYear) | 62 | // pointData?.name?.includes(targetYear) |
63 | // ) { | 63 | // ) { |
64 | // 调用父组件传递的回调 | 64 | // 调用父组件传递的回调 |
65 | - onXValueClick?.(xValue, pointData?.name); | 65 | + if (pointData?.name) { |
66 | + onXValueClick?.(xValue, pointData?.name); | ||
67 | + } else if (pointData?.type) { | ||
68 | + onXValueClick?.(xValue, pointData?.type); | ||
69 | + } | ||
66 | 70 | ||
67 | // // 合并两个数据源 | 71 | // // 合并两个数据源 |
68 | // const allData = [...targetData, ...orderData]; | 72 | // const allData = [...targetData, ...orderData]; |