From 15f5c445c501e99d22470f6b1f96880927e57651 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Tue, 9 Dec 2025 13:16:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20Community=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E9=87=8D=E7=BB=84=20+=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=B7=AF=E5=BE=84=20+=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20Mock=20=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 目录重构 - DynamicNewsCard/ → DynamicNews/(含 layouts/, hooks/ 子目录) - EventCard 原子组件 → EventCard/atoms/ - EventDetailModal 独立目录化 - HotEvents 独立目录化(含 CSS) - SearchFilters 独立目录化(CompactSearchBox, TradingTimeFilter) ## 导入路径修复 - EventCard/*.js: 统一使用 @constants/, @utils/, @components/ 别名 - atoms/*.js: 修复移动后的相对路径问题 - DynamicNewsCard.js: 更新 contexts, store, constants 导入 - EventHeaderInfo.js, CompactMetaBar.js: 修复 EventFollowButton 导入 ## Mock Handler 添加 - /api/events/:eventId/expectation-score - 事件超预期得分 - /api/index/:indexCode/realtime - 指数实时行情 ## 警告修复 - CitationMark.js: overlayInnerStyle → styles (Antd 5.x) - CitedContent.js: 移除不支持的 jsx 属性 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/Citation/CitationMark.js | 2 +- src/components/Citation/CitedContent.js | 2 +- .../EventDetailPanel/CompactMetaBar.js | 2 +- .../EventDetailPanel/EventHeaderInfo.js | 2 +- src/mocks/handlers/event.js | 39 ++++ src/mocks/handlers/market.js | 47 +++++ src/views/Community/README.md | 184 ++++++++++++++++++ .../{ => DynamicNews}/DynamicNewsCard.js | 22 +-- .../EventDetailScrollPanel.js | 2 +- .../EventScrollList.js | 6 +- .../ModeToggleButtons.js | 2 +- .../PaginationControl.js | 2 +- .../constants.js | 2 +- .../components/DynamicNews/hooks/index.js | 4 + .../hooks/usePagination.js | 6 +- .../Community/components/DynamicNews/index.js | 21 ++ .../layouts}/VerticalModeLayout.js | 10 +- .../layouts}/VirtualizedFourRowGrid.js | 4 +- .../components/DynamicNews/layouts/index.js | 5 + .../components/EventCard/CompactEventCard.js | 12 +- .../components/EventCard/DetailedEventCard.js | 16 +- .../EventCard/DynamicNewsEventCard.js | 8 +- .../HorizontalDynamicNewsEventCard.js | 16 +- .../EventCard/{ => atoms}/EventDescription.js | 0 .../{ => atoms}/EventFollowButton.js | 2 +- .../EventCard/{ => atoms}/EventHeader.js | 0 .../{ => atoms}/EventImportanceBadge.js | 4 +- .../{ => atoms}/EventPriceDisplay.js | 4 +- .../EventCard/{ => atoms}/EventStats.js | 0 .../EventCard/{ => atoms}/EventTimeline.js | 0 .../EventCard/{ => atoms}/ImportanceBadge.js | 4 +- .../EventCard/{ => atoms}/ImportanceStamp.js | 4 +- .../EventCard/{ => atoms}/KeywordsCarousel.js | 4 +- .../components/EventCard/atoms/index.js | 13 ++ .../EventDetailModal.less | 0 .../EventDetailModal.tsx | 0 .../components/EventDetailModal/index.ts | 4 + src/views/Community/components/HeroPanel.js | 4 +- .../components/{ => HotEvents}/HotEvents.css | 0 .../components/{ => HotEvents}/HotEvents.js | 6 +- .../{ => HotEvents}/HotEventsSection.js | 4 +- .../Community/components/HotEvents/index.js | 5 + .../{ => SearchFilters}/CompactSearchBox.css | 0 .../{ => SearchFilters}/CompactSearchBox.js | 2 +- .../{ => SearchFilters}/TradingTimeFilter.js | 0 .../components/SearchFilters/index.js | 5 + src/views/Community/index.js | 4 +- 47 files changed, 409 insertions(+), 76 deletions(-) create mode 100644 src/views/Community/README.md rename src/views/Community/components/{ => DynamicNews}/DynamicNewsCard.js (97%) rename src/views/Community/components/{DynamicNewsCard => DynamicNews}/EventDetailScrollPanel.js (96%) rename src/views/Community/components/{DynamicNewsCard => DynamicNews}/EventScrollList.js (96%) rename src/views/Community/components/{DynamicNewsCard => DynamicNews}/ModeToggleButtons.js (92%) rename src/views/Community/components/{DynamicNewsCard => DynamicNews}/PaginationControl.js (98%) rename src/views/Community/components/{DynamicNewsCard => DynamicNews}/constants.js (97%) create mode 100644 src/views/Community/components/DynamicNews/hooks/index.js rename src/views/Community/components/{DynamicNewsCard => DynamicNews}/hooks/usePagination.js (98%) create mode 100644 src/views/Community/components/DynamicNews/index.js rename src/views/Community/components/{DynamicNewsCard => DynamicNews/layouts}/VerticalModeLayout.js (94%) rename src/views/Community/components/{DynamicNewsCard => DynamicNews/layouts}/VirtualizedFourRowGrid.js (98%) create mode 100644 src/views/Community/components/DynamicNews/layouts/index.js rename src/views/Community/components/EventCard/{ => atoms}/EventDescription.js (100%) rename src/views/Community/components/EventCard/{ => atoms}/EventFollowButton.js (96%) rename src/views/Community/components/EventCard/{ => atoms}/EventHeader.js (100%) rename src/views/Community/components/EventCard/{ => atoms}/EventImportanceBadge.js (95%) rename src/views/Community/components/EventCard/{ => atoms}/EventPriceDisplay.js (98%) rename src/views/Community/components/EventCard/{ => atoms}/EventStats.js (100%) rename src/views/Community/components/EventCard/{ => atoms}/EventTimeline.js (100%) rename src/views/Community/components/EventCard/{ => atoms}/ImportanceBadge.js (95%) rename src/views/Community/components/EventCard/{ => atoms}/ImportanceStamp.js (94%) rename src/views/Community/components/EventCard/{ => atoms}/KeywordsCarousel.js (94%) create mode 100644 src/views/Community/components/EventCard/atoms/index.js rename src/views/Community/components/{ => EventDetailModal}/EventDetailModal.less (100%) rename src/views/Community/components/{ => EventDetailModal}/EventDetailModal.tsx (100%) create mode 100644 src/views/Community/components/EventDetailModal/index.ts rename src/views/Community/components/{ => HotEvents}/HotEvents.css (100%) rename src/views/Community/components/{ => HotEvents}/HotEvents.js (97%) rename src/views/Community/components/{ => HotEvents}/HotEventsSection.js (95%) create mode 100644 src/views/Community/components/HotEvents/index.js rename src/views/Community/components/{ => SearchFilters}/CompactSearchBox.css (100%) rename src/views/Community/components/{ => SearchFilters}/CompactSearchBox.js (99%) rename src/views/Community/components/{ => SearchFilters}/TradingTimeFilter.js (100%) create mode 100644 src/views/Community/components/SearchFilters/index.js diff --git a/src/components/Citation/CitationMark.js b/src/components/Citation/CitationMark.js index bedcaa13..46b0929a 100644 --- a/src/components/Citation/CitationMark.js +++ b/src/components/Citation/CitationMark.js @@ -121,7 +121,7 @@ const CitationMark = ({ citationId, citation }) => { title={`引用来源 [${citationId}]`} trigger={triggerType} placement="top" - overlayInnerStyle={{ maxWidth: 340, padding: '8px' }} + styles={{ body: { maxWidth: 340, padding: '8px' } }} open={popoverVisible} onOpenChange={setPopoverVisible} zIndex={2000} diff --git a/src/components/Citation/CitedContent.js b/src/components/Citation/CitedContent.js index 2e36591a..45de9573 100644 --- a/src/components/Citation/CitedContent.js +++ b/src/components/Citation/CitedContent.js @@ -146,7 +146,7 @@ const CitedContent = ({ {/* 响应式样式 */} -