From 9990d95e2836aa366a68d9e389f74177e58fbd53 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Mon, 15 Dec 2025 16:09:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(Community):=20=E4=BC=98=E5=8C=96=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=92=8C=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89=E4=BA=A4?= =?UTF-8?q?=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 搜索框添加清空按钮(allowClear) - 自定义时间范围限制不能超过当前时间(精确到分钟) - 相关概念移除"相关度"显示 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../SearchFilters/CompactSearchBox.js | 3 ++ .../SearchFilters/TradingTimeFilter.js | 42 ++++++++++++++++++- .../EventDetail/components/RelatedConcepts.js | 12 ------ 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/src/views/Community/components/SearchFilters/CompactSearchBox.js b/src/views/Community/components/SearchFilters/CompactSearchBox.js index aae2a674..d61ca138 100644 --- a/src/views/Community/components/SearchFilters/CompactSearchBox.js +++ b/src/views/Community/components/SearchFilters/CompactSearchBox.js @@ -493,6 +493,9 @@ const CompactSearchBox = ({ }} style={{ flex: 1, minWidth: isMobile ? 100 : 200 }} className="gold-placeholder" + allowClear={{ + clearIcon: + }} > } diff --git a/src/views/Community/components/SearchFilters/TradingTimeFilter.js b/src/views/Community/components/SearchFilters/TradingTimeFilter.js index f1ee1749..c4b6e4fc 100644 --- a/src/views/Community/components/SearchFilters/TradingTimeFilter.js +++ b/src/views/Community/components/SearchFilters/TradingTimeFilter.js @@ -340,6 +340,44 @@ const TradingTimeFilter = ({ value, onChange, compact = false, mobile = false }) } }; + // 禁用未来日期 + const disabledDate = (current) => { + return current && current > dayjs().endOf('day'); + }; + + // 禁用未来时间(精确到分钟) + const disabledTime = (current) => { + if (!current) return {}; + + const now = dayjs(); + const isToday = current.isSame(now, 'day'); + + if (!isToday) return {}; + + const currentHour = now.hour(); + const currentMinute = now.minute(); + + return { + disabledHours: () => { + const hours = []; + for (let i = currentHour + 1; i < 24; i++) { + hours.push(i); + } + return hours; + }, + disabledMinutes: (selectedHour) => { + if (selectedHour === currentHour) { + const minutes = []; + for (let i = currentMinute + 1; i < 60; i++) { + minutes.push(i); + } + return minutes; + } + return []; + } + }; + }; + // "更多时间" 按钮内容 const customRangeContent = (
@@ -350,10 +388,12 @@ const TradingTimeFilter = ({ value, onChange, compact = false, mobile = false }) placeholder={['开始时间', '结束时间']} onChange={handleCustomRangeOk} value={customRange} + disabledDate={disabledDate} + disabledTime={disabledTime} style={{ marginBottom: 8 }} />
- 支持精确到分钟的时间范围选择 + 支持精确到分钟的时间范围选择(不能超过当前时间)
); diff --git a/src/views/EventDetail/components/RelatedConcepts.js b/src/views/EventDetail/components/RelatedConcepts.js index eb4c4fe4..9a246045 100644 --- a/src/views/EventDetail/components/RelatedConcepts.js +++ b/src/views/EventDetail/components/RelatedConcepts.js @@ -86,15 +86,6 @@ const ConceptCard = ({ concept, tradingDate, onViewDetails }) => { {concept.concept} - - 相关度: {concept.score.toFixed(2)} - {selectedConcept?.concept} - - 相关度: {selectedConcept?.score?.toFixed(2)} - {selectedConcept?.stock_count} 只股票