From 068d59634b9c23c40b72829b271c55c168d41e21 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Tue, 23 Dec 2025 17:44:06 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B8=85=E7=90=86=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6=E5=92=8C=E6=A0=B7=E5=BC=8F=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Calendars/EventCalendar.js | 40 - .../Center/components/InvestmentCalendar.less | 236 ------ src/views/Pages/Widgets.js | 767 ------------------ .../components/atoms/MarketSummaryCard.js | 160 ---- .../MarketDashboard/components/atoms/index.js | 5 +- 5 files changed, 1 insertion(+), 1207 deletions(-) delete mode 100755 src/components/Calendars/EventCalendar.js delete mode 100644 src/views/Center/components/InvestmentCalendar.less delete mode 100755 src/views/Pages/Widgets.js delete mode 100644 src/views/Profile/components/MarketDashboard/components/atoms/MarketSummaryCard.js diff --git a/src/components/Calendars/EventCalendar.js b/src/components/Calendars/EventCalendar.js deleted file mode 100755 index 7758076a..00000000 --- a/src/components/Calendars/EventCalendar.js +++ /dev/null @@ -1,40 +0,0 @@ -/*! - -========================================================= -* Argon Dashboard Chakra PRO - v1.0.0 -========================================================= - -* Product Page: https://www.creative-tim.com/product/argon-dashboard-chakra-pro -* Copyright 2022 Creative Tim (https://www.creative-tim.com/) - -* Designed and Coded by Simmmple & Creative Tim - -========================================================= - -* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -*/ - -import React from 'react'; -import FullCalendar from '@fullcalendar/react'; // must go before plugins -import dayGridPlugin from '@fullcalendar/daygrid'; // a plugin! -import interactionPlugin from '@fullcalendar/interaction'; // needed for dayClick - -function EventCalendar(props) { - const { calendarData, initialDate } = props; - - return ( - - ); -} - -export default EventCalendar; diff --git a/src/views/Center/components/InvestmentCalendar.less b/src/views/Center/components/InvestmentCalendar.less deleted file mode 100644 index 069e4a84..00000000 --- a/src/views/Center/components/InvestmentCalendar.less +++ /dev/null @@ -1,236 +0,0 @@ -// src/views/Center/components/InvestmentCalendar.less -// 黑金主题日历样式 - -// ==================== 颜色变量 ==================== -// 黑金主题主色 -@gold-400: #D4AF37; -@gold-500: #B8960C; -@gold-gradient: linear-gradient(135deg, #D4AF37 0%, #F5E6A3 100%); - -// 背景色 -@bg-deep: #0A0A14; -@bg-primary: #0F0F1A; -@bg-elevated: #1A1A2E; -@bg-surface: #252540; - -// 边框色 -@line-subtle: rgba(212, 175, 55, 0.1); -@line-default: rgba(212, 175, 55, 0.2); -@line-emphasis: rgba(212, 175, 55, 0.4); - -// 文字色 -@text-primary: rgba(255, 255, 255, 0.95); -@text-secondary: rgba(255, 255, 255, 0.6); -@text-muted: rgba(255, 255, 255, 0.4); - -// 今天高亮背景 -@today-bg: rgba(212, 175, 55, 0.1); - -// ==================== FullCalendar CSS Variables 覆盖 ==================== -// FullCalendar v6 使用 CSS-in-JS,必须通过 CSS Variables 覆盖默认样式 -.fc { - // 按钮颜色 - --fc-button-text-color: @bg-deep; - --fc-button-bg-color: @gold-400; - --fc-button-border-color: @gold-400; - --fc-button-hover-bg-color: @gold-500; - --fc-button-hover-border-color: @gold-500; - --fc-button-active-bg-color: @gold-500; - --fc-button-active-border-color: @gold-500; - - // 今天高亮 - --fc-today-bg-color: @today-bg; - - // 边框和背景 - --fc-border-color: @line-default; - --fc-page-bg-color: transparent; - --fc-neutral-bg-color: rgba(212, 175, 55, 0.05); - - // 事件颜色(可选) - --fc-event-bg-color: @gold-400; - --fc-event-border-color: @gold-400; - --fc-event-text-color: @bg-deep; - - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; -} - -// 工具栏布局 -.fc .fc-toolbar.fc-header-toolbar { - justify-content: flex-start !important; - gap: 8px !important; -} - -.fc .fc-toolbar-chunk:first-child { - display: flex !important; - gap: 4px !important; -} - -// 标题金色渐变 -.fc .fc-toolbar-title { - background: @gold-gradient; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - background-clip: text; - font-weight: 700; -} - -// 表格边框 -.fc-theme-standard { - td, th { - border-color: @line-default; - } -} - -// 导航按钮样式 -.fc .fc-toolbar .fc-button-group .fc-button, -.fc .fc-button-primary { - background-color: @gold-400 !important; - border-color: @gold-400 !important; - color: @bg-deep !important; - font-weight: 600 !important; - transition: all 0.3s ease; - - &:hover { - background-color: @gold-500 !important; - border-color: @gold-500 !important; - transform: translateY(-1px); - } - - &:not(:disabled):active, - &:not(:disabled).fc-button-active { - background-color: @gold-500 !important; - border-color: @gold-500 !important; - } -} - -// 今天按钮样式 -.fc .fc-toolbar .fc-today-button { - background-color: @gold-400 !important; - border-color: @gold-400 !important; - color: @bg-deep !important; - font-weight: 600 !important; - - &:hover { - background-color: @gold-500 !important; - border-color: @gold-500 !important; - } - - // 选中状态(disabled 表示当前视图包含今天) - &:disabled { - background-color: @gold-500 !important; - border-color: @gold-500 !important; - opacity: 1 !important; - color: @bg-deep !important; - } -} - -// 星期头(周日、周一等) -.fc-col-header-cell-cushion { - color: @gold-400 !important; - font-weight: 600 !important; - font-size: 14px; -} - -// 日期数字(1日、2日等)- 增强可见性 -.fc-daygrid-day-number { - color: rgba(255, 255, 255, 0.9) !important; - font-weight: 600 !important; - font-size: 14px !important; - padding: 4px 8px !important; -} - -// 当前月份的日期更亮 -.fc-day.fc-day-future .fc-daygrid-day-number, -.fc-day.fc-day-past .fc-daygrid-day-number { - color: rgba(255, 255, 255, 0.85) !important; -} - -// 非当前月份的日期(灰色) -.fc-day-other .fc-daygrid-day-number { - color: rgba(255, 255, 255, 0.35) !important; -} - -// 今天高亮 -.fc-daygrid-day.fc-day-today { - background-color: @today-bg !important; - border: 2px solid @gold-400 !important; - - .fc-daygrid-day-number { - color: @gold-400 !important; - font-weight: 700 !important; - } -} - -// 事件样式 -.fc-event { - border: none; - padding: 2px 6px; - font-size: 12px; - font-weight: 500; - border-radius: 4px; - transition: all 0.2s ease; - - &:hover { - transform: scale(1.02); - box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3); - } -} - -.fc-daygrid-event-dot { - display: none; -} - -.fc-daygrid-day-events { - margin-top: 2px; -} - -// 更多事件链接 -.fc-daygrid-more-link { - color: @gold-400; - font-weight: 500; - - &:hover { - color: @gold-500; - } -} - -// 弹出层样式 -.fc-popover { - background: @bg-elevated; - border: 1px solid @line-default; - border-radius: 8px; - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); - - .fc-popover-header { - background: rgba(212, 175, 55, 0.1); - color: @gold-400; - font-weight: 600; - } - - .fc-popover-body { - background: @bg-elevated; - } -} - -// ==================== 暗色模式支持 ==================== -// 由于整体设计已是暗色,这里主要是对比度微调 -@media (prefers-color-scheme: dark) { - .fc-theme-standard { - td, th { - border-color: @line-default; - } - } - - .fc-daygrid-day-number { - color: @text-primary; - } - - .fc-daygrid-day.fc-day-today { - background-color: @today-bg !important; - } - - .fc-col-header-cell-cushion, - .fc-daygrid-day-number { - color: @text-primary; - } -} diff --git a/src/views/Pages/Widgets.js b/src/views/Pages/Widgets.js deleted file mode 100755 index 46e663ca..00000000 --- a/src/views/Pages/Widgets.js +++ /dev/null @@ -1,767 +0,0 @@ -/*! - -========================================================= -* Argon Dashboard Chakra PRO - v1.0.0 -========================================================= - -* Product Page: https://www.creative-tim.com/product/argon-dashboard-chakra-pro -* Copyright 2022 Creative Tim (https://www.creative-tim.com/) - -* Designed and Coded by Simmmple & Creative Tim - -========================================================= - -* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -*/ - -// Chakra imports -import { - Badge, - Box, - Button, - Flex, - Grid, - Icon, - Progress, - Spacer, - Stack, - Stat, - StatHelpText, - StatLabel, - StatNumber, - Switch, - Text, - useColorMode, - useColorModeValue, -} from '@chakra-ui/react'; -// Assets -import BackgroundCard1 from 'assets/img/BackgroundCard1.png'; -import BgMusicCard from 'assets/img/BgMusicCard.png'; -import BgMusicCardDark from 'assets/img/bgMusicCardDark.png'; -import { - ClockIcon, - DocumentIcon, - RocketIcon, - SettingsIcon, - WalletIcon, -} from 'components/Icons/Icons'; -import { AiFillBackward, AiFillForward } from 'react-icons/ai'; -import { BsBatteryCharging, BsMusicNoteBeamed } from 'react-icons/bs'; -// Custom components -import EventCalendar from 'components/Calendars/EventCalendar'; -import Card from 'components/Card/Card'; -import CardHeader from 'components/Card/CardHeader'; -import LineChart from 'components/Charts/LineChart'; -import IconBox from 'components/Icons/IconBox'; -import { HSeparator } from 'components/Separator/Separator'; -import TimelineRow from 'components/Tables/TimelineRow'; -import React, { useState } from 'react'; -import { - FaCheckCircle, - FaLightbulb, - FaPaypal, - FaPlay, - FaRegLightbulb, - FaShare, - FaUser, - FaWallet, -} from 'react-icons/fa'; -import { RiArrowDropRightLine, RiMastercardFill } from 'react-icons/ri'; -import { calendarDataWidgets } from 'variables/calendar'; -import { - lineChartDataWidgets1, - lineChartDataWidgets2, - lineChartDataWidgets3, - lineChartOptionsWidgets1, - lineChartOptionsWidgets2, - lineChartOptionsWidgets3, -} from 'variables/charts'; -import { timelineData } from 'variables/general'; - -function Widgets() { - const [toggleSwitch, setToggleSwitch] = useState(false); - const { colorMode } = useColorMode(); - - const textColor = useColorModeValue('gray.700', 'white'); - const iconBlue = useColorModeValue('blue.500', 'white'); - const secondaryIconBlue = useColorModeValue('gray.100', 'blue.500'); - const iconBoxInside = useColorModeValue('white', 'blue.500'); - const bgCard = useColorModeValue( - 'linear-gradient(81.62deg, #313860 2.25%, #151928 79.87%)', - 'navy.800' - ); - const iconBoxColor = useColorModeValue( - 'linear-gradient(81.62deg, #313860 2.25%, #151928 79.87%)', - 'blue.500' - ); - - return ( - - - - - - - - Battery Health - - - 99% - - - - - - - - - - - - Music Volume - - - 15/100 - - - - - - - - - - - - - Income - - - - $130,912 - - - +90% - - - - - - - - - - - - - - - - - - - Tasks - - - 480 - - - - - - 60% - - - - - - - - - - - - - - - - - Upcoming events - - - Joined - - - - - - - - - - - - Cyber Week - - - 27 March 2020, at 12:30 PM - - - - - - - - - - Meeting with Marry - - - 24 March 2020, at 10:00 PM - - - - - - - - - - - - - - Salary - - - Belong Interactive - - - - - +$2000 - - - - - - - - - - - Paypal - - - Freelance Payment - - - - - $455.00 - - - - - - - - Argon x Chakra UI - - - - - - - 7812 2139 0823 XXXX - - - - - VALID THRU - - 05/24 - - - - CVV - - 09X - - - - - - - - - - - - - Full Body - - - MODERATE - - - - - - What matters is the people who are sparked by it. And the people who - are liked. - - - - - - - {toggleSwitch ? 'ON' : 'OFF'} - - setToggleSwitch(!toggleSwitch)} - /> - - - - - - - Lights - - - - - - - - Calories - - - - 187 - - - +5% - - - - - - - - - - - - - - - - - 754 - - m - - - - New York City - - - - - - - - STEPS - - - - - - 11.4K - - - +4.3% - - - - - - - - - - Calendar - - - Wednesday, 2022 - - - - - - - - - - - Categories - - - - - - - - - - - Devices - - - 250 in stock,{' '} - - 346+ sold - - - - - - - - - - - - - - - Tickets - - - 123 closed,{' '} - - 15 open - - - - - - - - - - - - - - - Error logs - - - 1 is active,{' '} - - 40 closed - - - - - - - - - - - - - - - Happy Users - - - - +430 - - - - - - - - - - - - - Some Kind of Blues - - - Deftones - - - - - - - - - - - - - - - Orders overview - - - - +30% - {' '} - this month. - - - - - {timelineData.map((row, index, arr) => { - return ( - - ); - })} - - - - - ); -} - -export default Widgets; diff --git a/src/views/Profile/components/MarketDashboard/components/atoms/MarketSummaryCard.js b/src/views/Profile/components/MarketDashboard/components/atoms/MarketSummaryCard.js deleted file mode 100644 index 2bc62f39..00000000 --- a/src/views/Profile/components/MarketDashboard/components/atoms/MarketSummaryCard.js +++ /dev/null @@ -1,160 +0,0 @@ -// 市场概况卡片 - 紧凑版(上证/深证/总市值/成交额) -import React, { useEffect, useState } from 'react'; -import { Box, Text, VStack, HStack, SimpleGrid } from '@chakra-ui/react'; -import { THEME } from '../../constants'; -import { getApiBase } from '@/utils/apiConfig'; - -/** - * 格式化大数字(万亿/亿) - */ -const formatLargeNumber = (num) => { - if (!num && num !== 0) return '--'; - const trillion = 1000000000000; // 万亿 - const billion = 100000000; // 亿 - - if (num >= trillion) { - return `${(num / trillion).toFixed(1)}万亿`; - } else if (num >= billion) { - return `${(num / billion).toFixed(1)}亿`; - } - return num.toLocaleString(); -}; - -/** - * 单个指数/统计项 - */ -const SummaryItem = ({ label, value, change, changeAmount, subValue, isIndex = true }) => { - const isUp = change > 0; - const isFlat = change === 0; - const changeColor = isFlat - ? 'rgba(255, 255, 255, 0.6)' - : isUp ? THEME.status.up : THEME.status.down; - - return ( - - {/* 标签 */} - - {label} - - - {/* 主数值 */} - - {typeof value === 'number' ? value.toFixed(2) : value} - - - {/* 涨跌信息(仅指数显示) */} - {isIndex && change !== undefined ? ( - - {changeAmount !== undefined && ( - - {isUp ? '+' : ''}{typeof changeAmount === 'number' ? changeAmount.toFixed(2) : changeAmount} - - )} - {isUp ? '+' : ''}{change.toFixed(2)}% - - ) : ( - // 非指数项显示副标签 - - {subValue || label} - - )} - - ); -}; - -/** - * 市场概况卡片 - */ -const MarketSummaryCard = () => { - const [marketData, setMarketData] = useState({ - shanghai: { value: 3391.88, change: 0.52, changeAmount: 17.55 }, - shenzhen: { value: 10723.49, change: 0.68, changeAmount: 72.38 }, - totalMarketCap: 105.6 * 1000000000000, // 105.6万亿 - turnover: 1.0 * 1000000000000, // 1.0万亿 - }); - - // 获取实时数据 - useEffect(() => { - const fetchMarketData = async () => { - try { - const base = getApiBase(); - const response = await fetch(`${base}/api/market/summary`, { - credentials: 'include', - }); - if (response.ok) { - const data = await response.json(); - if (data.success && data.data) { - setMarketData(prev => ({ - ...prev, - ...data.data, - })); - } - } - } catch (error) { - // 使用默认数据 - console.debug('Using default market data'); - } - }; - - fetchMarketData(); - // 每分钟更新一次 - const interval = setInterval(fetchMarketData, 60000); - return () => clearInterval(interval); - }, []); - - return ( - - - {/* 上证 */} - - - {/* 深证 */} - - - {/* 总市值 */} - - - {/* 成交额 */} - - - - ); -}; - -export default MarketSummaryCard; diff --git a/src/views/Profile/components/MarketDashboard/components/atoms/index.js b/src/views/Profile/components/MarketDashboard/components/atoms/index.js index 17acab67..ff937899 100644 --- a/src/views/Profile/components/MarketDashboard/components/atoms/index.js +++ b/src/views/Profile/components/MarketDashboard/components/atoms/index.js @@ -8,10 +8,7 @@ export { default as StatItem } from './StatItem'; export { default as RiseFallChart } from './RiseFallChart'; export { default as HotSectorsRanking } from './HotSectorsRanking'; -// 新增:K线指数卡片和涨跌分布进度条 +// K线指数卡片和涨跌分布进度条 export { default as IndexKLineCard } from './IndexKLineCard'; export { default as RiseFallProgressBar } from './RiseFallProgressBar'; export { default as GemIndexCard } from './GemIndexCard'; - -// 市场概况卡片(上证/深证/总市值/成交额) -export { default as MarketSummaryCard } from './MarketSummaryCard';