diff --git a/src/views/Company/components/CompanyOverview/DeepAnalysisTab.js b/src/views/Company/components/CompanyOverview/DeepAnalysisTab.js index e39f4c4e..d686af03 100644 --- a/src/views/Company/components/CompanyOverview/DeepAnalysisTab.js +++ b/src/views/Company/components/CompanyOverview/DeepAnalysisTab.js @@ -20,7 +20,6 @@ import { Tab, TabPanel, Button, - useColorModeValue, Tag, TagLabel, Icon, @@ -194,7 +193,7 @@ const ScoreBar = ({ label, score, icon }) => { // 业务结构树形图组件 const BusinessTreeItem = ({ business, depth = 0 }) => { - const bgColor = useColorModeValue("gray.50", "gray.700"); + const bgColor = "gray.50"; return ( { }; const colorScheme = getColorScheme(); - const bgColor = useColorModeValue(`${colorScheme}.50`, `${colorScheme}.900`); - const borderColor = useColorModeValue( - `${colorScheme}.200`, - `${colorScheme}.600` - ); + const bgColor = `${colorScheme}.50`; + const borderColor = `${colorScheme}.200`; const getNodeTypeIcon = (type) => { const icons = { @@ -700,8 +696,8 @@ const KeyFactorCard = ({ factor }) => { mixed: "yellow", }[factor.impact_direction] || "gray"; - const bgColor = useColorModeValue("white", "gray.800"); - const borderColor = useColorModeValue("gray.200", "gray.600"); + const bgColor = "white"; + const borderColor = "gray.200"; return ( @@ -769,9 +765,9 @@ const TimelineComponent = ({ events }) => { const [selectedEvent, setSelectedEvent] = useState(null); const { isOpen, onOpen, onClose } = useDisclosure(); - // 颜色模式值需要在组件顶层调用 - const positiveBgColor = useColorModeValue("red.50", "red.900"); - const negativeBgColor = useColorModeValue("green.50", "green.900"); + // 背景颜色 + const positiveBgColor = "red.50"; + const negativeBgColor = "green.50"; const handleEventClick = (event) => { setSelectedEvent(event); @@ -1137,10 +1133,10 @@ const DeepAnalysisTab = ({ expandedSegments, onToggleSegment, }) => { - const blueBg = useColorModeValue("blue.50", "blue.900"); - const greenBg = useColorModeValue("green.50", "green.900"); - const purpleBg = useColorModeValue("purple.50", "purple.900"); - const orangeBg = useColorModeValue("orange.50", "orange.900"); + const blueBg = "blue.50"; + const greenBg = "green.50"; + const purpleBg = "purple.50"; + const orangeBg = "orange.50"; if (loading) { return ( diff --git a/src/views/Company/components/CompanyOverview/NewsEventsTab.js b/src/views/Company/components/CompanyOverview/NewsEventsTab.js index 52bb4b5f..a4122a7d 100644 --- a/src/views/Company/components/CompanyOverview/NewsEventsTab.js +++ b/src/views/Company/components/CompanyOverview/NewsEventsTab.js @@ -18,7 +18,6 @@ import { Tag, Center, Spinner, - useColorModeValue, } from "@chakra-ui/react"; import { SearchIcon } from "@chakra-ui/icons"; import { @@ -67,9 +66,6 @@ const NewsEventsTab = ({ onPageChange, cardBg, }) => { - // 颜色模式值需要在组件顶层调用 - const hoverBg = useColorModeValue("gray.50", "gray.700"); - // 事件类型图标映射 const getEventTypeIcon = (eventType) => { const iconMap = { @@ -233,7 +229,7 @@ const NewsEventsTab = ({ key={event.id || idx} variant="outline" _hover={{ - bg: hoverBg, + bg: "gray.50", shadow: "md", borderColor: "blue.300", }} diff --git a/src/views/Company/components/FinancialPanorama/index.js b/src/views/Company/components/FinancialPanorama/index.js index 0b3568e7..9e85945a 100644 --- a/src/views/Company/components/FinancialPanorama/index.js +++ b/src/views/Company/components/FinancialPanorama/index.js @@ -35,7 +35,6 @@ import { VStack, HStack, Divider, - useColorModeValue, Select, Button, Tooltip, @@ -60,7 +59,6 @@ import { ButtonGroup, Stack, Collapse, - useColorMode, } from '@chakra-ui/react'; import { ChevronDownIcon, @@ -101,14 +99,13 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => { const [modalContent, setModalContent] = useState(null); const [expandedRows, setExpandedRows] = useState({}); const toast = useToast(); - const { colorMode } = useColorMode(); - + // 颜色配置(中国市场:红涨绿跌) - const bgColor = useColorModeValue('white', 'gray.800'); - const borderColor = useColorModeValue('gray.200', 'gray.600'); - const hoverBg = useColorModeValue('gray.50', 'gray.700'); - const positiveColor = useColorModeValue('red.500', 'red.400'); // 红涨 - const negativeColor = useColorModeValue('green.500', 'green.400'); // 绿跌 + const bgColor = 'white'; + const borderColor = 'gray.200'; + const hoverBg = 'gray.50'; + const positiveColor = 'red.500'; // 红涨 + const negativeColor = 'green.500'; // 绿跌 // 加载所有财务数据 const loadFinancialData = async () => { @@ -492,7 +489,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => { {section.title !== '资产总计' && section.title !== '负债合计' && ( toggleSection(section.key)} > @@ -515,7 +512,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => { key={metric.key} _hover={{ bg: hoverBg, cursor: 'pointer' }} onClick={() => showMetricChart(metric.name, metric.key, balanceSheet, metric.path)} - bg={metric.isTotal ? useColorModeValue('blue.50', 'blue.900') : 'transparent'} + bg={metric.isTotal ? 'blue.50' : 'transparent'} > @@ -733,7 +730,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => { const renderSection = (section) => ( toggleSection(section.key)} > @@ -755,8 +752,8 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => { key={metric.key} _hover={{ bg: hoverBg, cursor: 'pointer' }} onClick={() => showMetricChart(metric.name, metric.key, incomeStatement, metric.path)} - bg={metric.isTotal ? useColorModeValue('blue.50', 'blue.900') : - metric.isSubtotal ? useColorModeValue('orange.50', 'orange.900') : 'transparent'} + bg={metric.isTotal ? 'blue.50' : + metric.isSubtotal ? 'orange.50' : 'transparent'} > @@ -1268,7 +1265,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => { { label: '资产负债率', value: financialMetrics[0].solvency?.asset_liability_ratio, format: 'percent' }, { label: '研发费用率', value: financialMetrics[0].expense_ratios?.rd_expense_ratio, format: 'percent' }, ].map((item, idx) => ( - + {item.label} {item.format === 'percent' ? diff --git a/src/views/Company/components/MarketDataView/index.js b/src/views/Company/components/MarketDataView/index.js index 783ef235..f3902d60 100644 --- a/src/views/Company/components/MarketDataView/index.js +++ b/src/views/Company/components/MarketDataView/index.js @@ -36,7 +36,6 @@ import { VStack, HStack, Divider, - useColorModeValue, Select, Button, Tooltip, @@ -60,7 +59,6 @@ import { GridItem, ButtonGroup, Stack, - useColorMode, Icon, InputGroup, InputLeftElement, @@ -121,25 +119,6 @@ const themes = { border: '#CBD5E0', chartBg: '#FFFFFF', }, - dark: { - // 夜间模式 - 黑+金 - primary: '#FFD700', - primaryDark: '#FFA500', - secondary: '#1A1A1A', - secondaryDark: '#000000', - success: '#FF4444', // 涨 - 红色 - danger: '#00C851', // 跌 - 绿色 - warning: '#FFA500', - info: '#00BFFF', - bgMain: '#0A0A0A', - bgCard: '#141414', - bgDark: '#000000', - textPrimary: '#FFFFFF', - textSecondary: '#FFD700', - textMuted: '#999999', - border: '#333333', - chartBg: '#141414', - } }; // API服务 @@ -236,9 +215,9 @@ const ThemedCard = ({ children, theme, ...props }) => { }; // Markdown渲染组件 -const MarkdownRenderer = ({ children, theme, colorMode }) => { +const MarkdownRenderer = ({ children, theme }) => { return ( - { fontStyle: 'italic' }, '& code': { - backgroundColor: colorMode === 'light' ? 'rgba(0,0,0,0.05)' : 'rgba(255,255,255,0.1)', + backgroundColor: 'rgba(0,0,0,0.05)', padding: '2px 4px', borderRadius: '4px', fontSize: '0.9em' @@ -290,13 +269,12 @@ const MarkdownRenderer = ({ children, theme, colorMode }) => { // 主组件 const MarketDataView = ({ stockCode: propStockCode }) => { - const { colorMode } = useColorMode(); const toast = useToast(); const { isOpen, onOpen, onClose } = useDisclosure(); const [modalContent, setModalContent] = useState(null); - + // 获取当前主题 - const theme = colorMode === 'light' ? themes.light : themes.dark; + const theme = themes.light; // 状态管理 const [stockCode, setStockCode] = useState(propStockCode || '600000'); @@ -464,7 +442,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => { opacity: 0.8 } }, - backgroundColor: colorMode === 'light' ? 'rgba(255,255,255,0.9)' : 'rgba(0,0,0,0.8)', + backgroundColor: 'rgba(255,255,255,0.9)', borderColor: theme.primary, borderWidth: 1, textStyle: { @@ -682,7 +660,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => { tooltip: { trigger: 'axis', axisPointer: { type: 'cross' }, - backgroundColor: colorMode === 'light' ? 'rgba(255,255,255,0.95)' : 'rgba(0,0,0,0.85)', + backgroundColor: 'rgba(255,255,255,0.95)', borderColor: theme.primary, borderWidth: 1, textStyle: { @@ -889,7 +867,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => { }, tooltip: { trigger: 'axis', - backgroundColor: colorMode === 'light' ? 'rgba(255,255,255,0.9)' : 'rgba(0,0,0,0.8)', + backgroundColor: 'rgba(255,255,255,0.9)', borderColor: theme.primary, borderWidth: 1, textStyle: { @@ -1022,7 +1000,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => { }, tooltip: { trigger: 'axis', - backgroundColor: colorMode === 'light' ? 'rgba(255,255,255,0.9)' : 'rgba(0,0,0,0.8)', + backgroundColor: 'rgba(255,255,255,0.9)', borderColor: theme.primary, borderWidth: 1, textStyle: { @@ -1130,7 +1108,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => { {summary.stock_name} - + {summary.stock_code} @@ -1236,7 +1214,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => { ) : ( @@ -1249,31 +1227,31 @@ const MarketDataView = ({ stockCode: propStockCode }) => { > - + 交易数据 - + 融资融券 - + 大宗交易 - + 龙虎榜 - + 股权质押 @@ -1301,7 +1279,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {