fix: 修复投资日历切换月份时自动打开事件弹窗的问题

- 利用 Ant Design Calendar onSelect 的 info.source 参数区分选择来源
- 只有点击日期单元格 (source='date') 时才打开弹窗
- 切换月份/年份时不再触发弹窗

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-09 15:36:17 +08:00
parent 27fff4e60b
commit 0e862d82a0

View File

@@ -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); setSelectedDate(value);
loadDateEvents(value); loadDateEvents(value);
setModalVisible(true); setModalVisible(true);