From c962b3a550639f6d01ad5a1447d837834e4a2f47 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Tue, 16 Dec 2025 13:10:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(Concept):=20=E4=BC=98=E5=8C=96=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E9=80=89=E6=8B=A9=E5=99=A8=E5=B8=83=E5=B1=80=E5=92=8C?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E6=96=B9=E5=BC=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 日期选择器布局调整: - TradeDatePicker 新增 showLatestTradeDateTip prop 控制是否显示最新日期提示 - 快捷按钮(今天/昨天/一周前/一月前)移到日期输入框后 - 「数据更新至」提示移到最右侧,样式更低调避免误认为按钮 排序方式条件显示: - 排序方式下拉框仅在列表视图(viewMode='list')显示 - 其他视图(3D图/层级图)隐藏排序方式,视图切换按钮自动靠右 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/TradeDatePicker/index.tsx | 25 ++--- src/views/Concept/index.js | 118 ++++++++++++++--------- 2 files changed, 85 insertions(+), 58 deletions(-) diff --git a/src/components/TradeDatePicker/index.tsx b/src/components/TradeDatePicker/index.tsx index a3df510e..65835426 100644 --- a/src/components/TradeDatePicker/index.tsx +++ b/src/components/TradeDatePicker/index.tsx @@ -31,6 +31,8 @@ export interface TradeDatePickerProps { showIcon?: boolean; /** 是否使用深色模式(强制覆盖 Chakra 颜色模式) */ isDarkMode?: boolean; + /** 是否显示最新交易日期提示,默认 true */ + showLatestTradeDateTip?: boolean; } /** @@ -50,6 +52,7 @@ const TradeDatePicker: React.FC = ({ inputWidth = { base: '100%', lg: '200px' }, showIcon = true, isDarkMode = false, + showLatestTradeDateTip = true, }) => { // 颜色主题 - 支持 isDarkMode 强制覆盖 const defaultLabelColor = useColorModeValue('purple.700', 'purple.300'); @@ -142,21 +145,21 @@ const TradeDatePicker: React.FC = ({ } : undefined} /> - {/* 最新交易日期提示 */} - {latestTradeDate && ( + {/* 最新交易日期提示 - 靠右显示,样式更低调避免误认为按钮 */} + {showLatestTradeDateTip && latestTradeDate && ( - - 最新: {latestTradeDate.toLocaleDateString('zh-CN')} + + 数据更新至 {latestTradeDate.toLocaleDateString('zh-CN')} diff --git a/src/views/Concept/index.js b/src/views/Concept/index.js index a7e61fa9..9ce1b7b5 100644 --- a/src/views/Concept/index.js +++ b/src/views/Concept/index.js @@ -1417,7 +1417,7 @@ const ConceptCenter = () => { align={{ base: 'stretch', lg: 'center' }} gap={4} > - {/* 使用通用日期选择器组件 */} + {/* 使用通用日期选择器组件 - 不显示最新日期提示,由下方单独渲染 */} { @@ -1432,9 +1432,10 @@ const ConceptCenter = () => { latestTradeDate={latestTradeDate} label="交易日期" isDarkMode={true} + showLatestTradeDateTip={false} /> - {/* 快捷按钮 - 深色主题,更有区分度 */} + {/* 快捷按钮 - 紧跟日期选择器 */} + + {/* 最新交易日期提示 - 靠右显示 */} + {latestTradeDate && ( + + + + + 数据更新至 {latestTradeDate.toLocaleDateString('zh-CN')} + + + + )} ); @@ -1752,52 +1773,55 @@ const ConceptCenter = () => { align={{ base: 'stretch', md: 'center' }} gap={4} > - - - 排序方式: - - {searchQuery && sortBy === '_score' && ( - - - - - 智能排序 - - - - )} - + {/* 排序方式 - 仅在列表视图显示 */} + {viewMode === 'list' && ( + + + 排序方式: + + {searchQuery && sortBy === '_score' && ( + + + + + 智能排序 + + + + )} + + )} - + }