From 22415d3f25690f49c8a2997d7940a780c10ec660 Mon Sep 17 00:00:00 2001 From: fish Date: Mon, 6 Jul 2026 14:42:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A6=82=E5=BF=B5/=E8=A1=8C=E4=B8=9A=E5=88=86?= =?UTF-8?q?=E6=9E=90=E7=A7=BB=E9=99=A4=E9=85=8D=E7=BD=AE=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E5=8F=8A=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- serve/frontend/src/pages/ConceptAnalysis.tsx | 35 +++------------- serve/frontend/src/pages/IndustryAnalysis.tsx | 41 +++---------------- 2 files changed, 11 insertions(+), 65 deletions(-) diff --git a/serve/frontend/src/pages/ConceptAnalysis.tsx b/serve/frontend/src/pages/ConceptAnalysis.tsx index 2772151..8d64997 100644 --- a/serve/frontend/src/pages/ConceptAnalysis.tsx +++ b/serve/frontend/src/pages/ConceptAnalysis.tsx @@ -8,13 +8,12 @@ import { RefreshCw, Repeat, Search, - Settings2, TrendingDown, TrendingUp, } from 'lucide-react' import { PageHeader } from '@/components/PageHeader' import { EmptyState } from '@/components/EmptyState' -import { AnalysisConfigDialog, type AnalysisFieldConfig } from '@/components/analysis-shared' +import { type AnalysisFieldConfig } from '@/components/analysis-shared' import { StockPreviewDialog } from '@/components/StockPreviewDialog' import { RpsRotationDialog } from '@/components/RpsRotationDialog' import { api, type MarketSnapshotRow } from '@/lib/api' @@ -68,9 +67,7 @@ function loadConfig(): AnalysisFieldConfig { return storage.conceptAnalysisConfig.get({}) as AnalysisFieldConfig } -function saveConfig(c: AnalysisFieldConfig) { - storage.conceptAnalysisConfig.set(c) -} + function pickBestConfig( configs: { id: string; label: string; description?: string; fields: { name: string; label: string }[] }[], @@ -234,8 +231,7 @@ function statSort(mode: SortMode) { } export function ConceptAnalysis() { - const [fieldConfig, setFieldConfig] = useState(loadConfig) - const [showConfig, setShowConfig] = useState(false) + const [fieldConfig] = useState(loadConfig) const [search, setSearch] = useState('') const [selectedKey, setSelectedKey] = useState(null) const [sortMode, setSortMode] = useState('heat') @@ -301,12 +297,6 @@ export function ConceptAnalysis() { return set.size }, [stats]) - const handleSaveConfig = (c: AnalysisFieldConfig) => { - setFieldConfig(c) - saveConfig(c) - setSelectedKey(null) - } - if (configsQuery.isLoading) { return
} @@ -316,19 +306,9 @@ export function ConceptAnalysis() { return ( <>
- setShowConfig(true)} className="p-1.5 text-muted hover:bg-surface hover:text-accent" title="配置数据源"> - - - } - /> +
- - {showConfig && setShowConfig(false)} />} - ) } @@ -348,9 +328,6 @@ export function ConceptAnalysis() { > 涨幅RPS轮动分析 - } /> @@ -388,9 +365,7 @@ export function ConceptAnalysis() { - - {showConfig && setShowConfig(false)} />} - + {previewSymbol && ( (loadConfig) - const [showConfig, setShowConfig] = useState(false) + const [fieldConfig] = useState(loadConfig) const [search, setSearch] = useState('') const [selectedKey, setSelectedKey] = useState(null) const [sortMode, setSortMode] = useState('heat') @@ -349,12 +344,6 @@ export function IndustryAnalysis() { return map }, [marketMap]) - const handleSaveConfig = (c: AnalysisFieldConfig) => { - setFieldConfig(c) - saveConfig(c) - setSelectedKey(null) - } - if (configsQuery.isLoading) { return
} @@ -364,19 +353,10 @@ export function IndustryAnalysis() { return ( <>
- setShowConfig(true)} className="p-1.5 text-muted hover:bg-surface hover:text-accent" title="配置数据源"> - - - } - /> +
- - {showConfig && setShowConfig(false)} showHierarchyLevel />} - + ) } @@ -388,13 +368,6 @@ export function IndustryAnalysis() { - - - } />
@@ -441,9 +414,7 @@ export function IndustryAnalysis() {
- - {showConfig && setShowConfig(false)} showHierarchyLevel />} - + {previewSymbol && (