diff --git a/src/views/Community/components/DynamicNewsCard.js b/src/views/Community/components/DynamicNewsCard.js index 085ed926..e6149235 100644 --- a/src/views/Community/components/DynamicNewsCard.js +++ b/src/views/Community/components/DynamicNewsCard.js @@ -261,6 +261,7 @@ const [currentMode, setCurrentMode] = useState('vertical'); filters.end_date, // 时间筛选参数:结束时间 filters.recent_days, // 时间筛选参数:近N天 filters.industry_code, + filters._forceRefresh, // 强制刷新标志(用于重置按钮) mode, // 添加 mode 到依赖 pageSize, // 添加 pageSize 到依赖 dispatch diff --git a/src/views/Community/components/UnifiedSearchBox.js b/src/views/Community/components/UnifiedSearchBox.js index a8a57221..a611e08f 100644 --- a/src/views/Community/components/UnifiedSearchBox.js +++ b/src/views/Community/components/UnifiedSearchBox.js @@ -503,6 +503,8 @@ const UnifiedSearchBox = ({ // ✅ 重置筛选 - 清空所有筛选器并触发搜索 const handleReset = () => { + console.log('%c🔄 [重置] 开始重置筛选条件', 'color: #FF4D4F; font-weight: bold;'); + // 重置所有筛选器状态 setInputValue(''); // 清空输入框 setStockOptions([]); @@ -520,11 +522,17 @@ const UnifiedSearchBox = ({ start_date: '', end_date: '', recent_days: '', - page: 1 + page: 1, + _forceRefresh: Date.now() // 添加强制刷新标志,确保每次重置都触发更新 }; + console.log('%c🔄 [重置] 重置参数', 'color: #FF4D4F;', resetParams); logger.debug('UnifiedSearchBox', '重置筛选', resetParams); + + console.log('%c🔄 [重置] 调用 onSearch', 'color: #FF4D4F;', typeof onSearch); onSearch(resetParams); + + console.log('%c✅ [重置] 重置完成', 'color: #52C41A; font-weight: bold;'); }; // 生成已选条件标签(包含所有筛选条件) - 从 filters 和本地状态读取