From 0e862d82a06d3182a895e774b65fa0f536747c09 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Tue, 9 Dec 2025 15:36:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8A=95=E8=B5=84?= =?UTF-8?q?=E6=97=A5=E5=8E=86=E5=88=87=E6=8D=A2=E6=9C=88=E4=BB=BD=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=89=93=E5=BC=80=E4=BA=8B=E4=BB=B6=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 利用 Ant Design Calendar onSelect 的 info.source 参数区分选择来源 - 只有点击日期单元格 (source='date') 时才打开弹窗 - 切换月份/年份时不再触发弹窗 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/InvestmentCalendar/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/InvestmentCalendar/index.js b/src/components/InvestmentCalendar/index.js index a24a16e9..9d5366fc 100644 --- a/src/components/InvestmentCalendar/index.js +++ b/src/components/InvestmentCalendar/index.js @@ -220,7 +220,12 @@ const InvestmentCalendar = () => { }; // 处理日期选择 - const handleDateSelect = (value) => { + // info.source 区分选择来源:'date' = 点击日期,'month'/'year' = 切换月份/年份 + const handleDateSelect = (value, info) => { + // 只有点击日期单元格时才打开弹窗,切换月份/年份时不打开 + if (info?.source !== 'date') { + return; + } setSelectedDate(value); loadDateEvents(value); setModalVisible(true);