refactor: 移除暗色模式相关代码,使用固定浅色主题
- DeepAnalysisTab: 移除 useColorModeValue,使用固定颜色值 - NewsEventsTab: 移除 useColorModeValue,简化 hover 颜色 - FinancialPanorama: 移除 useColorMode/useColorModeValue - MarketDataView: 移除 dark 主题配置,简化颜色逻辑 - StockQuoteCard: 移除 useColorModeValue,使用固定颜色 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,6 @@ import {
|
|||||||
Tab,
|
Tab,
|
||||||
TabPanel,
|
TabPanel,
|
||||||
Button,
|
Button,
|
||||||
useColorModeValue,
|
|
||||||
Tag,
|
Tag,
|
||||||
TagLabel,
|
TagLabel,
|
||||||
Icon,
|
Icon,
|
||||||
@@ -194,7 +193,7 @@ const ScoreBar = ({ label, score, icon }) => {
|
|||||||
|
|
||||||
// 业务结构树形图组件
|
// 业务结构树形图组件
|
||||||
const BusinessTreeItem = ({ business, depth = 0 }) => {
|
const BusinessTreeItem = ({ business, depth = 0 }) => {
|
||||||
const bgColor = useColorModeValue("gray.50", "gray.700");
|
const bgColor = "gray.50";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -286,11 +285,8 @@ const ValueChainNodeCard = ({ node, isCompany = false, level = 0 }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const colorScheme = getColorScheme();
|
const colorScheme = getColorScheme();
|
||||||
const bgColor = useColorModeValue(`${colorScheme}.50`, `${colorScheme}.900`);
|
const bgColor = `${colorScheme}.50`;
|
||||||
const borderColor = useColorModeValue(
|
const borderColor = `${colorScheme}.200`;
|
||||||
`${colorScheme}.200`,
|
|
||||||
`${colorScheme}.600`
|
|
||||||
);
|
|
||||||
|
|
||||||
const getNodeTypeIcon = (type) => {
|
const getNodeTypeIcon = (type) => {
|
||||||
const icons = {
|
const icons = {
|
||||||
@@ -700,8 +696,8 @@ const KeyFactorCard = ({ factor }) => {
|
|||||||
mixed: "yellow",
|
mixed: "yellow",
|
||||||
}[factor.impact_direction] || "gray";
|
}[factor.impact_direction] || "gray";
|
||||||
|
|
||||||
const bgColor = useColorModeValue("white", "gray.800");
|
const bgColor = "white";
|
||||||
const borderColor = useColorModeValue("gray.200", "gray.600");
|
const borderColor = "gray.200";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card bg={bgColor} borderColor={borderColor} size="sm">
|
<Card bg={bgColor} borderColor={borderColor} size="sm">
|
||||||
@@ -769,9 +765,9 @@ const TimelineComponent = ({ events }) => {
|
|||||||
const [selectedEvent, setSelectedEvent] = useState(null);
|
const [selectedEvent, setSelectedEvent] = useState(null);
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
|
|
||||||
// 颜色模式值需要在组件顶层调用
|
// 背景颜色
|
||||||
const positiveBgColor = useColorModeValue("red.50", "red.900");
|
const positiveBgColor = "red.50";
|
||||||
const negativeBgColor = useColorModeValue("green.50", "green.900");
|
const negativeBgColor = "green.50";
|
||||||
|
|
||||||
const handleEventClick = (event) => {
|
const handleEventClick = (event) => {
|
||||||
setSelectedEvent(event);
|
setSelectedEvent(event);
|
||||||
@@ -1137,10 +1133,10 @@ const DeepAnalysisTab = ({
|
|||||||
expandedSegments,
|
expandedSegments,
|
||||||
onToggleSegment,
|
onToggleSegment,
|
||||||
}) => {
|
}) => {
|
||||||
const blueBg = useColorModeValue("blue.50", "blue.900");
|
const blueBg = "blue.50";
|
||||||
const greenBg = useColorModeValue("green.50", "green.900");
|
const greenBg = "green.50";
|
||||||
const purpleBg = useColorModeValue("purple.50", "purple.900");
|
const purpleBg = "purple.50";
|
||||||
const orangeBg = useColorModeValue("orange.50", "orange.900");
|
const orangeBg = "orange.50";
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import {
|
|||||||
Tag,
|
Tag,
|
||||||
Center,
|
Center,
|
||||||
Spinner,
|
Spinner,
|
||||||
useColorModeValue,
|
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { SearchIcon } from "@chakra-ui/icons";
|
import { SearchIcon } from "@chakra-ui/icons";
|
||||||
import {
|
import {
|
||||||
@@ -67,9 +66,6 @@ const NewsEventsTab = ({
|
|||||||
onPageChange,
|
onPageChange,
|
||||||
cardBg,
|
cardBg,
|
||||||
}) => {
|
}) => {
|
||||||
// 颜色模式值需要在组件顶层调用
|
|
||||||
const hoverBg = useColorModeValue("gray.50", "gray.700");
|
|
||||||
|
|
||||||
// 事件类型图标映射
|
// 事件类型图标映射
|
||||||
const getEventTypeIcon = (eventType) => {
|
const getEventTypeIcon = (eventType) => {
|
||||||
const iconMap = {
|
const iconMap = {
|
||||||
@@ -233,7 +229,7 @@ const NewsEventsTab = ({
|
|||||||
key={event.id || idx}
|
key={event.id || idx}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
_hover={{
|
_hover={{
|
||||||
bg: hoverBg,
|
bg: "gray.50",
|
||||||
shadow: "md",
|
shadow: "md",
|
||||||
borderColor: "blue.300",
|
borderColor: "blue.300",
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import {
|
|||||||
VStack,
|
VStack,
|
||||||
HStack,
|
HStack,
|
||||||
Divider,
|
Divider,
|
||||||
useColorModeValue,
|
|
||||||
Select,
|
Select,
|
||||||
Button,
|
Button,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
@@ -60,7 +59,6 @@ import {
|
|||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
Stack,
|
Stack,
|
||||||
Collapse,
|
Collapse,
|
||||||
useColorMode,
|
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import {
|
import {
|
||||||
ChevronDownIcon,
|
ChevronDownIcon,
|
||||||
@@ -101,14 +99,13 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
|||||||
const [modalContent, setModalContent] = useState(null);
|
const [modalContent, setModalContent] = useState(null);
|
||||||
const [expandedRows, setExpandedRows] = useState({});
|
const [expandedRows, setExpandedRows] = useState({});
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { colorMode } = useColorMode();
|
|
||||||
|
|
||||||
// 颜色配置(中国市场:红涨绿跌)
|
// 颜色配置(中国市场:红涨绿跌)
|
||||||
const bgColor = useColorModeValue('white', 'gray.800');
|
const bgColor = 'white';
|
||||||
const borderColor = useColorModeValue('gray.200', 'gray.600');
|
const borderColor = 'gray.200';
|
||||||
const hoverBg = useColorModeValue('gray.50', 'gray.700');
|
const hoverBg = 'gray.50';
|
||||||
const positiveColor = useColorModeValue('red.500', 'red.400'); // 红涨
|
const positiveColor = 'red.500'; // 红涨
|
||||||
const negativeColor = useColorModeValue('green.500', 'green.400'); // 绿跌
|
const negativeColor = 'green.500'; // 绿跌
|
||||||
|
|
||||||
// 加载所有财务数据
|
// 加载所有财务数据
|
||||||
const loadFinancialData = async () => {
|
const loadFinancialData = async () => {
|
||||||
@@ -492,7 +489,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
|||||||
<React.Fragment key={section.key}>
|
<React.Fragment key={section.key}>
|
||||||
{section.title !== '资产总计' && section.title !== '负债合计' && (
|
{section.title !== '资产总计' && section.title !== '负债合计' && (
|
||||||
<Tr
|
<Tr
|
||||||
bg={useColorModeValue('gray.50', 'gray.700')}
|
bg="gray.50"
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
onClick={() => toggleSection(section.key)}
|
onClick={() => toggleSection(section.key)}
|
||||||
>
|
>
|
||||||
@@ -515,7 +512,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
|||||||
key={metric.key}
|
key={metric.key}
|
||||||
_hover={{ bg: hoverBg, cursor: 'pointer' }}
|
_hover={{ bg: hoverBg, cursor: 'pointer' }}
|
||||||
onClick={() => showMetricChart(metric.name, metric.key, balanceSheet, metric.path)}
|
onClick={() => showMetricChart(metric.name, metric.key, balanceSheet, metric.path)}
|
||||||
bg={metric.isTotal ? useColorModeValue('blue.50', 'blue.900') : 'transparent'}
|
bg={metric.isTotal ? 'blue.50' : 'transparent'}
|
||||||
>
|
>
|
||||||
<Td position="sticky" left={0} bg={bgColor} zIndex={1}>
|
<Td position="sticky" left={0} bg={bgColor} zIndex={1}>
|
||||||
<HStack spacing={2}>
|
<HStack spacing={2}>
|
||||||
@@ -733,7 +730,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
|||||||
const renderSection = (section) => (
|
const renderSection = (section) => (
|
||||||
<React.Fragment key={section.key}>
|
<React.Fragment key={section.key}>
|
||||||
<Tr
|
<Tr
|
||||||
bg={useColorModeValue('gray.50', 'gray.700')}
|
bg="gray.50"
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
onClick={() => toggleSection(section.key)}
|
onClick={() => toggleSection(section.key)}
|
||||||
>
|
>
|
||||||
@@ -755,8 +752,8 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
|||||||
key={metric.key}
|
key={metric.key}
|
||||||
_hover={{ bg: hoverBg, cursor: 'pointer' }}
|
_hover={{ bg: hoverBg, cursor: 'pointer' }}
|
||||||
onClick={() => showMetricChart(metric.name, metric.key, incomeStatement, metric.path)}
|
onClick={() => showMetricChart(metric.name, metric.key, incomeStatement, metric.path)}
|
||||||
bg={metric.isTotal ? useColorModeValue('blue.50', 'blue.900') :
|
bg={metric.isTotal ? 'blue.50' :
|
||||||
metric.isSubtotal ? useColorModeValue('orange.50', 'orange.900') : 'transparent'}
|
metric.isSubtotal ? 'orange.50' : 'transparent'}
|
||||||
>
|
>
|
||||||
<Td position="sticky" left={0} bg={bgColor} zIndex={1}>
|
<Td position="sticky" left={0} bg={bgColor} zIndex={1}>
|
||||||
<HStack spacing={2}>
|
<HStack spacing={2}>
|
||||||
@@ -1268,7 +1265,7 @@ const FinancialPanorama = ({ stockCode: propStockCode }) => {
|
|||||||
{ label: '资产负债率', value: financialMetrics[0].solvency?.asset_liability_ratio, format: 'percent' },
|
{ label: '资产负债率', value: financialMetrics[0].solvency?.asset_liability_ratio, format: 'percent' },
|
||||||
{ label: '研发费用率', value: financialMetrics[0].expense_ratios?.rd_expense_ratio, format: 'percent' },
|
{ label: '研发费用率', value: financialMetrics[0].expense_ratios?.rd_expense_ratio, format: 'percent' },
|
||||||
].map((item, idx) => (
|
].map((item, idx) => (
|
||||||
<Box key={idx} p={3} borderRadius="md" bg={useColorModeValue('gray.50', 'gray.700')}>
|
<Box key={idx} p={3} borderRadius="md" bg="gray.50">
|
||||||
<Text fontSize="xs" color="gray.500">{item.label}</Text>
|
<Text fontSize="xs" color="gray.500">{item.label}</Text>
|
||||||
<Text fontSize="lg" fontWeight="bold">
|
<Text fontSize="lg" fontWeight="bold">
|
||||||
{item.format === 'percent' ?
|
{item.format === 'percent' ?
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ import {
|
|||||||
VStack,
|
VStack,
|
||||||
HStack,
|
HStack,
|
||||||
Divider,
|
Divider,
|
||||||
useColorModeValue,
|
|
||||||
Select,
|
Select,
|
||||||
Button,
|
Button,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
@@ -60,7 +59,6 @@ import {
|
|||||||
GridItem,
|
GridItem,
|
||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
Stack,
|
Stack,
|
||||||
useColorMode,
|
|
||||||
Icon,
|
Icon,
|
||||||
InputGroup,
|
InputGroup,
|
||||||
InputLeftElement,
|
InputLeftElement,
|
||||||
@@ -121,25 +119,6 @@ const themes = {
|
|||||||
border: '#CBD5E0',
|
border: '#CBD5E0',
|
||||||
chartBg: '#FFFFFF',
|
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服务
|
// API服务
|
||||||
@@ -236,9 +215,9 @@ const ThemedCard = ({ children, theme, ...props }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Markdown渲染组件
|
// Markdown渲染组件
|
||||||
const MarkdownRenderer = ({ children, theme, colorMode }) => {
|
const MarkdownRenderer = ({ children, theme }) => {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
color={theme.textPrimary}
|
color={theme.textPrimary}
|
||||||
sx={{
|
sx={{
|
||||||
'& h1, & h2, & h3, & h4, & h5, & h6': {
|
'& h1, & h2, & h3, & h4, & h5, & h6': {
|
||||||
@@ -269,7 +248,7 @@ const MarkdownRenderer = ({ children, theme, colorMode }) => {
|
|||||||
fontStyle: 'italic'
|
fontStyle: 'italic'
|
||||||
},
|
},
|
||||||
'& code': {
|
'& 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',
|
padding: '2px 4px',
|
||||||
borderRadius: '4px',
|
borderRadius: '4px',
|
||||||
fontSize: '0.9em'
|
fontSize: '0.9em'
|
||||||
@@ -290,13 +269,12 @@ const MarkdownRenderer = ({ children, theme, colorMode }) => {
|
|||||||
|
|
||||||
// 主组件
|
// 主组件
|
||||||
const MarketDataView = ({ stockCode: propStockCode }) => {
|
const MarketDataView = ({ stockCode: propStockCode }) => {
|
||||||
const { colorMode } = useColorMode();
|
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
const [modalContent, setModalContent] = useState(null);
|
const [modalContent, setModalContent] = useState(null);
|
||||||
|
|
||||||
// 获取当前主题
|
// 获取当前主题
|
||||||
const theme = colorMode === 'light' ? themes.light : themes.dark;
|
const theme = themes.light;
|
||||||
|
|
||||||
// 状态管理
|
// 状态管理
|
||||||
const [stockCode, setStockCode] = useState(propStockCode || '600000');
|
const [stockCode, setStockCode] = useState(propStockCode || '600000');
|
||||||
@@ -464,7 +442,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
opacity: 0.8
|
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,
|
borderColor: theme.primary,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
@@ -682,7 +660,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: { type: 'cross' },
|
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,
|
borderColor: theme.primary,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
@@ -889,7 +867,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
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,
|
borderColor: theme.primary,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
@@ -1022,7 +1000,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
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,
|
borderColor: theme.primary,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
@@ -1130,7 +1108,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<Heading size="xl" color={theme.textSecondary}>
|
<Heading size="xl" color={theme.textSecondary}>
|
||||||
{summary.stock_name}
|
{summary.stock_name}
|
||||||
</Heading>
|
</Heading>
|
||||||
<Badge colorScheme={colorMode === 'light' ? 'blue' : 'yellow'} fontSize="lg">
|
<Badge colorScheme={'blue'} fontSize="lg">
|
||||||
{summary.stock_code}
|
{summary.stock_code}
|
||||||
</Badge>
|
</Badge>
|
||||||
</HStack>
|
</HStack>
|
||||||
@@ -1236,7 +1214,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
) : (
|
) : (
|
||||||
<Tabs
|
<Tabs
|
||||||
variant="soft-rounded"
|
variant="soft-rounded"
|
||||||
colorScheme={colorMode === 'light' ? 'blue' : 'yellow'}
|
colorScheme={'blue'}
|
||||||
index={activeTab}
|
index={activeTab}
|
||||||
onChange={setActiveTab}
|
onChange={setActiveTab}
|
||||||
>
|
>
|
||||||
@@ -1249,31 +1227,31 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
>
|
>
|
||||||
<HStack justify="space-between" align="center" spacing={4}>
|
<HStack justify="space-between" align="center" spacing={4}>
|
||||||
<TabList overflowX="auto" border="none" flex="1">
|
<TabList overflowX="auto" border="none" flex="1">
|
||||||
<Tab color={theme.textMuted} _selected={{ color: colorMode === 'light' ? 'white' : theme.secondary, bg: theme.primary }} fontSize="sm" px={3}>
|
<Tab color={theme.textMuted} _selected={{ color: 'white', bg: theme.primary }} fontSize="sm" px={3}>
|
||||||
<HStack spacing={1}>
|
<HStack spacing={1}>
|
||||||
<Icon as={ChevronUpIcon} boxSize={4} />
|
<Icon as={ChevronUpIcon} boxSize={4} />
|
||||||
<Text>交易数据</Text>
|
<Text>交易数据</Text>
|
||||||
</HStack>
|
</HStack>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab color={theme.textMuted} _selected={{ color: colorMode === 'light' ? 'white' : theme.secondary, bg: theme.primary }} fontSize="sm" px={3}>
|
<Tab color={theme.textMuted} _selected={{ color: 'white', bg: theme.primary }} fontSize="sm" px={3}>
|
||||||
<HStack spacing={1}>
|
<HStack spacing={1}>
|
||||||
<Icon as={UnlockIcon} boxSize={4} />
|
<Icon as={UnlockIcon} boxSize={4} />
|
||||||
<Text>融资融券</Text>
|
<Text>融资融券</Text>
|
||||||
</HStack>
|
</HStack>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab color={theme.textMuted} _selected={{ color: colorMode === 'light' ? 'white' : theme.secondary, bg: theme.primary }} fontSize="sm" px={3}>
|
<Tab color={theme.textMuted} _selected={{ color: 'white', bg: theme.primary }} fontSize="sm" px={3}>
|
||||||
<HStack spacing={1}>
|
<HStack spacing={1}>
|
||||||
<Icon as={ArrowUpIcon} boxSize={4} />
|
<Icon as={ArrowUpIcon} boxSize={4} />
|
||||||
<Text>大宗交易</Text>
|
<Text>大宗交易</Text>
|
||||||
</HStack>
|
</HStack>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab color={theme.textMuted} _selected={{ color: colorMode === 'light' ? 'white' : theme.secondary, bg: theme.primary }} fontSize="sm" px={3}>
|
<Tab color={theme.textMuted} _selected={{ color: 'white', bg: theme.primary }} fontSize="sm" px={3}>
|
||||||
<HStack spacing={1}>
|
<HStack spacing={1}>
|
||||||
<Icon as={StarIcon} boxSize={4} />
|
<Icon as={StarIcon} boxSize={4} />
|
||||||
<Text>龙虎榜</Text>
|
<Text>龙虎榜</Text>
|
||||||
</HStack>
|
</HStack>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab color={theme.textMuted} _selected={{ color: colorMode === 'light' ? 'white' : theme.secondary, bg: theme.primary }} fontSize="sm" px={3}>
|
<Tab color={theme.textMuted} _selected={{ color: 'white', bg: theme.primary }} fontSize="sm" px={3}>
|
||||||
<HStack spacing={1}>
|
<HStack spacing={1}>
|
||||||
<Icon as={LockIcon} boxSize={4} />
|
<Icon as={LockIcon} boxSize={4} />
|
||||||
<Text>股权质押</Text>
|
<Text>股权质押</Text>
|
||||||
@@ -1301,7 +1279,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<Button
|
<Button
|
||||||
leftIcon={<RepeatIcon />}
|
leftIcon={<RepeatIcon />}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
colorScheme={colorMode === 'light' ? 'blue' : 'yellow'}
|
colorScheme={'blue'}
|
||||||
onClick={loadMarketData}
|
onClick={loadMarketData}
|
||||||
isLoading={loading}
|
isLoading={loading}
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -1323,7 +1301,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<ReactECharts
|
<ReactECharts
|
||||||
option={getKLineOption()}
|
option={getKLineOption()}
|
||||||
style={{ height: '100%', width: '100%' }}
|
style={{ height: '100%', width: '100%' }}
|
||||||
theme={colorMode === 'light' ? 'light' : 'dark'}
|
theme={'light'}
|
||||||
onEvents={{
|
onEvents={{
|
||||||
'click': (params) => {
|
'click': (params) => {
|
||||||
if (params.seriesName === '涨幅分析' && params.data) {
|
if (params.seriesName === '涨幅分析' && params.data) {
|
||||||
@@ -1343,7 +1321,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{analysis.main_business && (
|
{analysis.main_business && (
|
||||||
<Box p={4} bg={colorMode === 'light' ? 'gray.50' : 'gray.900'} borderRadius="md">
|
<Box p={4} bg={'gray.50'} borderRadius="md">
|
||||||
<Heading size="sm" mb={2} color={theme.primary}>主营业务</Heading>
|
<Heading size="sm" mb={2} color={theme.primary}>主营业务</Heading>
|
||||||
<Text color={theme.textPrimary}>{analysis.main_business}</Text>
|
<Text color={theme.textPrimary}>{analysis.main_business}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -1351,18 +1329,18 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
|
|
||||||
|
|
||||||
{analysis.rise_reason_detail && (
|
{analysis.rise_reason_detail && (
|
||||||
<Box p={4} bg={colorMode === 'light' ? 'purple.50' : 'purple.900'} borderRadius="md">
|
<Box p={4} bg={'purple.50'} borderRadius="md">
|
||||||
<Heading size="sm" mb={2} color={theme.primary}>详细分析</Heading>
|
<Heading size="sm" mb={2} color={theme.primary}>详细分析</Heading>
|
||||||
<MarkdownRenderer theme={theme} colorMode={colorMode}>
|
<MarkdownRenderer theme={theme}>
|
||||||
{analysis.rise_reason_detail}
|
{analysis.rise_reason_detail}
|
||||||
</MarkdownRenderer>
|
</MarkdownRenderer>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{analysis.announcements && analysis.announcements !== '[]' && (
|
{analysis.announcements && analysis.announcements !== '[]' && (
|
||||||
<Box p={4} bg={colorMode === 'light' ? 'orange.50' : 'orange.900'} borderRadius="md">
|
<Box p={4} bg={'orange.50'} borderRadius="md">
|
||||||
<Heading size="sm" mb={2} color={theme.primary}>相关公告</Heading>
|
<Heading size="sm" mb={2} color={theme.primary}>相关公告</Heading>
|
||||||
<MarkdownRenderer theme={theme} colorMode={colorMode}>
|
<MarkdownRenderer theme={theme}>
|
||||||
{analysis.announcements}
|
{analysis.announcements}
|
||||||
</MarkdownRenderer>
|
</MarkdownRenderer>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -1370,7 +1348,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
|
|
||||||
{/* 研报引用展示 */}
|
{/* 研报引用展示 */}
|
||||||
{analysis.verification_reports && analysis.verification_reports.length > 0 && (
|
{analysis.verification_reports && analysis.verification_reports.length > 0 && (
|
||||||
<Box p={4} bg={colorMode === 'light' ? 'blue.50' : 'blue.900'} borderRadius="md">
|
<Box p={4} bg={'blue.50'} borderRadius="md">
|
||||||
<Heading size="sm" mb={3} color={theme.primary}>
|
<Heading size="sm" mb={3} color={theme.primary}>
|
||||||
<HStack spacing={2}>
|
<HStack spacing={2}>
|
||||||
<Icon as={ExternalLinkIcon} />
|
<Icon as={ExternalLinkIcon} />
|
||||||
@@ -1382,7 +1360,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<Box
|
<Box
|
||||||
key={reportIdx}
|
key={reportIdx}
|
||||||
p={3}
|
p={3}
|
||||||
bg={colorMode === 'light' ? 'white' : 'gray.800'}
|
bg={'white'}
|
||||||
borderRadius="md"
|
borderRadius="md"
|
||||||
border="1px solid"
|
border="1px solid"
|
||||||
borderColor={theme.border}
|
borderColor={theme.border}
|
||||||
@@ -1428,7 +1406,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
{report.verification_item && (
|
{report.verification_item && (
|
||||||
<Box
|
<Box
|
||||||
p={2}
|
p={2}
|
||||||
bg={colorMode === 'light' ? 'yellow.50' : 'yellow.900'}
|
bg={'yellow.50'}
|
||||||
borderRadius="sm"
|
borderRadius="sm"
|
||||||
mb={2}
|
mb={2}
|
||||||
>
|
>
|
||||||
@@ -1479,7 +1457,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
当日分钟频数据
|
当日分钟频数据
|
||||||
</Heading>
|
</Heading>
|
||||||
{minuteData && minuteData.trade_date && (
|
{minuteData && minuteData.trade_date && (
|
||||||
<Badge colorScheme={colorMode === 'light' ? 'blue' : 'yellow'} fontSize="xs">
|
<Badge colorScheme={'blue'} fontSize="xs">
|
||||||
{minuteData.trade_date}
|
{minuteData.trade_date}
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
@@ -1488,7 +1466,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
leftIcon={<RepeatIcon />}
|
leftIcon={<RepeatIcon />}
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
colorScheme={colorMode === 'light' ? 'blue' : 'yellow'}
|
colorScheme={'blue'}
|
||||||
onClick={loadMinuteData}
|
onClick={loadMinuteData}
|
||||||
isLoading={minuteLoading}
|
isLoading={minuteLoading}
|
||||||
loadingText="获取中"
|
loadingText="获取中"
|
||||||
@@ -1520,7 +1498,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<ReactECharts
|
<ReactECharts
|
||||||
option={getMinuteKLineOption()}
|
option={getMinuteKLineOption()}
|
||||||
style={{ height: '100%', width: '100%' }}
|
style={{ height: '100%', width: '100%' }}
|
||||||
theme={colorMode === 'light' ? 'light' : 'dark'}
|
theme={'light'}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
@@ -1592,7 +1570,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
{/* 成交量分析 */}
|
{/* 成交量分析 */}
|
||||||
<Box
|
<Box
|
||||||
p={4}
|
p={4}
|
||||||
bg={colorMode === 'light' ? theme.bgDark : 'rgba(255, 215, 0, 0.05)'}
|
bg={theme.bgDark}
|
||||||
borderRadius="lg"
|
borderRadius="lg"
|
||||||
border="1px solid"
|
border="1px solid"
|
||||||
borderColor={theme.border}
|
borderColor={theme.border}
|
||||||
@@ -1687,7 +1665,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
</Thead>
|
</Thead>
|
||||||
<Tbody>
|
<Tbody>
|
||||||
{tradeData.slice(-10).reverse().map((item, idx) => (
|
{tradeData.slice(-10).reverse().map((item, idx) => (
|
||||||
<Tr key={idx} _hover={{ bg: colorMode === 'light' ? theme.bgDark : 'rgba(255, 215, 0, 0.1)' }}>
|
<Tr key={idx} _hover={{ bg: theme.bgDark }}>
|
||||||
<Td color={theme.textPrimary}>{item.date}</Td>
|
<Td color={theme.textPrimary}>{item.date}</Td>
|
||||||
<Td isNumeric color={theme.textPrimary}>{item.open}</Td>
|
<Td isNumeric color={theme.textPrimary}>{item.open}</Td>
|
||||||
<Td isNumeric color={theme.textPrimary}>{item.high}</Td>
|
<Td isNumeric color={theme.textPrimary}>{item.high}</Td>
|
||||||
@@ -1718,7 +1696,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<ReactECharts
|
<ReactECharts
|
||||||
option={getFundingOption()}
|
option={getFundingOption()}
|
||||||
style={{ height: '100%', width: '100%' }}
|
style={{ height: '100%', width: '100%' }}
|
||||||
theme={colorMode === 'light' ? 'light' : 'dark'}
|
theme={'light'}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
@@ -1735,7 +1713,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<CardBody>
|
<CardBody>
|
||||||
<VStack spacing={3} align="stretch">
|
<VStack spacing={3} align="stretch">
|
||||||
{fundingData.slice(-5).reverse().map((item, idx) => (
|
{fundingData.slice(-5).reverse().map((item, idx) => (
|
||||||
<Box key={idx} p={3} bg={colorMode === 'light' ? 'rgba(255, 68, 68, 0.05)' : 'rgba(255, 68, 68, 0.1)'} borderRadius="md">
|
<Box key={idx} p={3} bg={'rgba(255, 68, 68, 0.05)'} borderRadius="md">
|
||||||
<HStack justify="space-between">
|
<HStack justify="space-between">
|
||||||
<Text color={theme.textMuted}>{item.date}</Text>
|
<Text color={theme.textMuted}>{item.date}</Text>
|
||||||
<VStack align="end" spacing={0}>
|
<VStack align="end" spacing={0}>
|
||||||
@@ -1762,7 +1740,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<CardBody>
|
<CardBody>
|
||||||
<VStack spacing={3} align="stretch">
|
<VStack spacing={3} align="stretch">
|
||||||
{fundingData.slice(-5).reverse().map((item, idx) => (
|
{fundingData.slice(-5).reverse().map((item, idx) => (
|
||||||
<Box key={idx} p={3} bg={colorMode === 'light' ? 'rgba(0, 200, 81, 0.05)' : 'rgba(0, 200, 81, 0.1)'} borderRadius="md">
|
<Box key={idx} p={3} bg={'rgba(0, 200, 81, 0.05)'} borderRadius="md">
|
||||||
<HStack justify="space-between">
|
<HStack justify="space-between">
|
||||||
<Text color={theme.textMuted}>{item.date}</Text>
|
<Text color={theme.textMuted}>{item.date}</Text>
|
||||||
<VStack align="end" spacing={0}>
|
<VStack align="end" spacing={0}>
|
||||||
@@ -1798,7 +1776,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<Box
|
<Box
|
||||||
key={idx}
|
key={idx}
|
||||||
p={4}
|
p={4}
|
||||||
bg={colorMode === 'light' ? theme.bgDark : 'rgba(255, 215, 0, 0.05)'}
|
bg={theme.bgDark}
|
||||||
borderRadius="lg"
|
borderRadius="lg"
|
||||||
border="1px solid"
|
border="1px solid"
|
||||||
borderColor={theme.border}
|
borderColor={theme.border}
|
||||||
@@ -1808,7 +1786,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
{dayStats.date}
|
{dayStats.date}
|
||||||
</Text>
|
</Text>
|
||||||
<HStack spacing={4}>
|
<HStack spacing={4}>
|
||||||
<Badge colorScheme={colorMode === 'light' ? 'blue' : 'yellow'} fontSize="md">
|
<Badge colorScheme={'blue'} fontSize="md">
|
||||||
交易笔数: {dayStats.count}
|
交易笔数: {dayStats.count}
|
||||||
</Badge>
|
</Badge>
|
||||||
<Badge colorScheme="green" fontSize="md">
|
<Badge colorScheme="green" fontSize="md">
|
||||||
@@ -1838,7 +1816,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
</Thead>
|
</Thead>
|
||||||
<Tbody>
|
<Tbody>
|
||||||
{dayStats.deals.map((deal, i) => (
|
{dayStats.deals.map((deal, i) => (
|
||||||
<Tr key={i} _hover={{ bg: colorMode === 'light' ? 'rgba(43, 108, 176, 0.05)' : 'rgba(255, 215, 0, 0.1)' }}>
|
<Tr key={i} _hover={{ bg: 'rgba(43, 108, 176, 0.05)' }}>
|
||||||
<Td color={theme.textPrimary} fontSize="xs" maxW="200px" isTruncated>
|
<Td color={theme.textPrimary} fontSize="xs" maxW="200px" isTruncated>
|
||||||
<Tooltip label={deal.buyer_dept || '-'} placement="top">
|
<Tooltip label={deal.buyer_dept || '-'} placement="top">
|
||||||
<Text>{deal.buyer_dept || '-'}</Text>
|
<Text>{deal.buyer_dept || '-'}</Text>
|
||||||
@@ -1891,7 +1869,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<Box
|
<Box
|
||||||
key={idx}
|
key={idx}
|
||||||
p={4}
|
p={4}
|
||||||
bg={colorMode === 'light' ? theme.bgDark : 'rgba(255, 215, 0, 0.05)'}
|
bg={theme.bgDark}
|
||||||
borderRadius="lg"
|
borderRadius="lg"
|
||||||
border="1px solid"
|
border="1px solid"
|
||||||
borderColor={theme.border}
|
borderColor={theme.border}
|
||||||
@@ -1925,7 +1903,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
key={i}
|
key={i}
|
||||||
justify="space-between"
|
justify="space-between"
|
||||||
p={2}
|
p={2}
|
||||||
bg={colorMode === 'light' ? 'rgba(255, 68, 68, 0.05)' : 'rgba(255, 68, 68, 0.1)'}
|
bg={'rgba(255, 68, 68, 0.05)'}
|
||||||
borderRadius="md"
|
borderRadius="md"
|
||||||
>
|
>
|
||||||
<Text fontSize="sm" color={theme.textPrimary} isTruncated maxW="70%">
|
<Text fontSize="sm" color={theme.textPrimary} isTruncated maxW="70%">
|
||||||
@@ -1953,7 +1931,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
key={i}
|
key={i}
|
||||||
justify="space-between"
|
justify="space-between"
|
||||||
p={2}
|
p={2}
|
||||||
bg={colorMode === 'light' ? 'rgba(0, 200, 81, 0.05)' : 'rgba(0, 200, 81, 0.1)'}
|
bg={'rgba(0, 200, 81, 0.05)'}
|
||||||
borderRadius="md"
|
borderRadius="md"
|
||||||
>
|
>
|
||||||
<Text fontSize="sm" color={theme.textPrimary} isTruncated maxW="70%">
|
<Text fontSize="sm" color={theme.textPrimary} isTruncated maxW="70%">
|
||||||
@@ -1975,7 +1953,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<HStack mt={3} spacing={2}>
|
<HStack mt={3} spacing={2}>
|
||||||
<Text fontSize="sm" color={theme.textMuted}>类型:</Text>
|
<Text fontSize="sm" color={theme.textMuted}>类型:</Text>
|
||||||
{dayData.info_types && dayData.info_types.map((type, i) => (
|
{dayData.info_types && dayData.info_types.map((type, i) => (
|
||||||
<Badge key={i} colorScheme={colorMode === 'light' ? 'blue' : 'yellow'} fontSize="xs">
|
<Badge key={i} colorScheme={'blue'} fontSize="xs">
|
||||||
{type}
|
{type}
|
||||||
</Badge>
|
</Badge>
|
||||||
))}
|
))}
|
||||||
@@ -2002,7 +1980,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<ReactECharts
|
<ReactECharts
|
||||||
option={getPledgeOption()}
|
option={getPledgeOption()}
|
||||||
style={{ height: '100%', width: '100%' }}
|
style={{ height: '100%', width: '100%' }}
|
||||||
theme={colorMode === 'light' ? 'light' : 'dark'}
|
theme={'light'}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
@@ -2032,7 +2010,7 @@ const MarketDataView = ({ stockCode: propStockCode }) => {
|
|||||||
<Tbody>
|
<Tbody>
|
||||||
{Array.isArray(pledgeData) && pledgeData.length > 0 ? (
|
{Array.isArray(pledgeData) && pledgeData.length > 0 ? (
|
||||||
pledgeData.map((item, idx) => (
|
pledgeData.map((item, idx) => (
|
||||||
<Tr key={idx} _hover={{ bg: colorMode === 'light' ? theme.bgDark : 'rgba(255, 215, 0, 0.1)' }}>
|
<Tr key={idx} _hover={{ bg: theme.bgDark }}>
|
||||||
<Td color={theme.textPrimary}>{item.end_date}</Td>
|
<Td color={theme.textPrimary}>{item.end_date}</Td>
|
||||||
<Td isNumeric color={theme.textPrimary}>{formatUtils.formatNumber(item.unrestricted_pledge, 0)}</Td>
|
<Td isNumeric color={theme.textPrimary}>{formatUtils.formatNumber(item.unrestricted_pledge, 0)}</Td>
|
||||||
<Td isNumeric color={theme.textPrimary}>{formatUtils.formatNumber(item.restricted_pledge, 0)}</Td>
|
<Td isNumeric color={theme.textPrimary}>{formatUtils.formatNumber(item.restricted_pledge, 0)}</Td>
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import {
|
|||||||
Badge,
|
Badge,
|
||||||
Progress,
|
Progress,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
useColorModeValue,
|
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
|
|
||||||
import type { StockQuoteCardProps } from './types';
|
import type { StockQuoteCardProps } from './types';
|
||||||
@@ -53,11 +52,11 @@ const StockQuoteCard: React.FC<StockQuoteCardProps> = ({
|
|||||||
isLoading = false,
|
isLoading = false,
|
||||||
}) => {
|
}) => {
|
||||||
// 颜色配置
|
// 颜色配置
|
||||||
const cardBg = useColorModeValue('white', 'gray.800');
|
const cardBg = 'white';
|
||||||
const borderColor = useColorModeValue('gray.200', 'gray.700');
|
const borderColor = 'gray.200';
|
||||||
const labelColor = useColorModeValue('gray.500', 'gray.400');
|
const labelColor = 'gray.500';
|
||||||
const valueColor = useColorModeValue('gray.800', 'gray.100');
|
const valueColor = 'gray.800';
|
||||||
const sectionTitleColor = useColorModeValue('gray.600', 'gray.300');
|
const sectionTitleColor = 'gray.600';
|
||||||
|
|
||||||
// 涨跌颜色
|
// 涨跌颜色
|
||||||
const priceColor = data.changePercent >= 0 ? 'green.500' : 'red.500';
|
const priceColor = data.changePercent >= 0 ? 'green.500' : 'red.500';
|
||||||
|
|||||||
Reference in New Issue
Block a user