refactor(icons): 迁移公共模块图标到 lucide-react

- constants/importanceLevels.js: 重要性等级图标
- constants/notificationTypes.js: 通知类型图标
- contexts/NotificationContext.js: 通知上下文图标
- layouts/components/BackToTopButton.js: 返回顶部按钮
- utils/priceFormatters.js: 价格格式化图标
- variables/general.js: 通用变量图标

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-25 12:25:54 +08:00
parent c820cfa804
commit ccbef35cf3
6 changed files with 71 additions and 81 deletions

View File

@@ -2,11 +2,11 @@
// 事件重要性等级配置 // 事件重要性等级配置
import { import {
WarningIcon, AlertTriangle,
WarningTwoIcon, AlertCircle,
InfoIcon, Info,
CheckCircleIcon, CheckCircle,
} from '@chakra-ui/icons'; } from 'lucide-react';
/** /**
* 重要性等级配置 * 重要性等级配置
@@ -21,7 +21,7 @@ export const IMPORTANCE_LEVELS = {
colorScheme: 'red', colorScheme: 'red',
badgeBg: '#dc2626', // 圆形徽章背景色 - 红色 badgeBg: '#dc2626', // 圆形徽章背景色 - 红色
badgeColor: 'white', // 圆形徽章文字颜色 - 白色 badgeColor: 'white', // 圆形徽章文字颜色 - 白色
icon: WarningIcon, icon: AlertTriangle,
label: 'S级', label: 'S级',
stampText: 'S', // 印章文字 stampText: 'S', // 印章文字
stampFont: "'STKaiti', 'KaiTi', 'SimKai', serif", // 楷体 stampFont: "'STKaiti', 'KaiTi', 'SimKai', serif", // 楷体
@@ -37,7 +37,7 @@ export const IMPORTANCE_LEVELS = {
colorScheme: 'red', colorScheme: 'red',
badgeBg: '#ea580c', // 圆形徽章背景色 - 橙色 badgeBg: '#ea580c', // 圆形徽章背景色 - 橙色
badgeColor: 'white', // 圆形徽章文字颜色 - 白色 badgeColor: 'white', // 圆形徽章文字颜色 - 白色
icon: WarningTwoIcon, icon: AlertCircle,
label: 'A级', label: 'A级',
stampText: 'A', // 印章文字 stampText: 'A', // 印章文字
stampFont: "'STXingkai', 'FangSong', 'STFangsong', cursive", // 行楷/草书 stampFont: "'STXingkai', 'FangSong', 'STFangsong', cursive", // 行楷/草书
@@ -53,7 +53,7 @@ export const IMPORTANCE_LEVELS = {
colorScheme: 'red', colorScheme: 'red',
badgeBg: '#2563eb', // 圆形徽章背景色 - 蓝色 badgeBg: '#2563eb', // 圆形徽章背景色 - 蓝色
badgeColor: 'white', // 圆形徽章文字颜色 - 白色 badgeColor: 'white', // 圆形徽章文字颜色 - 白色
icon: InfoIcon, icon: Info,
label: 'B级', label: 'B级',
stampText: 'B', // 印章文字 stampText: 'B', // 印章文字
stampFont: "'STKaiti', 'KaiTi', 'SimKai', serif", // 楷体 stampFont: "'STKaiti', 'KaiTi', 'SimKai', serif", // 楷体
@@ -69,7 +69,7 @@ export const IMPORTANCE_LEVELS = {
colorScheme: 'red', colorScheme: 'red',
badgeBg: '#10b981', // 圆形徽章背景色 - 青绿色(替代灰色) badgeBg: '#10b981', // 圆形徽章背景色 - 青绿色(替代灰色)
badgeColor: 'white', // 圆形徽章文字颜色 - 白色 badgeColor: 'white', // 圆形徽章文字颜色 - 白色
icon: CheckCircleIcon, icon: CheckCircle,
label: 'C级', label: 'C级',
stampText: 'C', // 印章文字 stampText: 'C', // 印章文字
stampFont: "'STKaiti', 'KaiTi', 'SimKai', serif", // 楷体 stampFont: "'STKaiti', 'KaiTi', 'SimKai', serif", // 楷体

View File

@@ -3,7 +3,7 @@
* 金融资讯通知系统 - 类型定义和常量 * 金融资讯通知系统 - 类型定义和常量
*/ */
import { MdCampaign, MdTrendingUp, MdTrendingDown, MdArticle, MdAssessment } from 'react-icons/md'; import { Megaphone, TrendingUp, TrendingDown, FileText, BarChart2 } from 'lucide-react';
// 通知类型 // 通知类型
export const NOTIFICATION_TYPES = { export const NOTIFICATION_TYPES = {
@@ -106,7 +106,7 @@ export const getPriorityBorderWidth = (priority) => {
export const NOTIFICATION_TYPE_CONFIGS = { export const NOTIFICATION_TYPE_CONFIGS = {
[NOTIFICATION_TYPES.ANNOUNCEMENT]: { [NOTIFICATION_TYPES.ANNOUNCEMENT]: {
name: '公告通知', name: '公告通知',
icon: MdCampaign, icon: Megaphone,
colorScheme: 'blue', colorScheme: 'blue',
// 亮色模式 // 亮色模式
bg: 'blue.50', bg: 'blue.50',
@@ -123,8 +123,8 @@ export const NOTIFICATION_TYPE_CONFIGS = {
name: '股票动向', name: '股票动向',
// 图标根据涨跌动态设置 // 图标根据涨跌动态设置
getIcon: (priceChange) => { getIcon: (priceChange) => {
if (!priceChange) return MdTrendingUp; if (!priceChange) return TrendingUp;
return priceChange.startsWith('+') ? MdTrendingUp : MdTrendingDown; return priceChange.startsWith('+') ? TrendingUp : TrendingDown;
}, },
// 颜色根据涨跌动态设置 // 颜色根据涨跌动态设置
getColorScheme: (priceChange) => { getColorScheme: (priceChange) => {
@@ -173,7 +173,7 @@ export const NOTIFICATION_TYPE_CONFIGS = {
}, },
[NOTIFICATION_TYPES.EVENT_ALERT]: { [NOTIFICATION_TYPES.EVENT_ALERT]: {
name: '事件动向', name: '事件动向',
icon: MdArticle, icon: FileText,
colorScheme: 'orange', colorScheme: 'orange',
// 亮色模式 // 亮色模式
bg: 'orange.50', bg: 'orange.50',
@@ -188,7 +188,7 @@ export const NOTIFICATION_TYPE_CONFIGS = {
}, },
[NOTIFICATION_TYPES.ANALYSIS_REPORT]: { [NOTIFICATION_TYPES.ANALYSIS_REPORT]: {
name: '分析报告', name: '分析报告',
icon: MdAssessment, icon: BarChart2,
colorScheme: 'purple', colorScheme: 'purple',
// 亮色模式 // 亮色模式
bg: 'purple.50', bg: 'purple.50',

View File

@@ -7,8 +7,8 @@
*/ */
import React, { createContext, useContext, useState, useEffect, useCallback, useRef } from 'react'; import React, { createContext, useContext, useState, useEffect, useCallback, useRef } from 'react';
import { useToast, Box, HStack, Text, Button, CloseButton, VStack, Icon } from '@chakra-ui/react'; import { useToast, Box, HStack, Text, Button, CloseButton, VStack } from '@chakra-ui/react';
import { BellIcon } from '@chakra-ui/icons'; import { Bell } from 'lucide-react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { selectIsMobile } from '@/store/slices/deviceSlice'; import { selectIsMobile } from '@/store/slices/deviceSlice';
import { logger } from '../utils/logger'; import { logger } from '../utils/logger';
@@ -282,7 +282,7 @@ export const NotificationProvider = ({ children }) => {
<VStack spacing={3} align="stretch"> <VStack spacing={3} align="stretch">
{icon && ( {icon && (
<HStack spacing={2}> <HStack spacing={2}>
<Icon as={BellIcon} boxSize={5} /> <Bell size={20} />
<Text fontWeight="bold" fontSize="md"> <Text fontWeight="bold" fontSize="md">
{title} {title}
</Text> </Text>
@@ -592,7 +592,7 @@ export const NotificationProvider = ({ children }) => {
> >
<VStack spacing={3} align="stretch"> <VStack spacing={3} align="stretch">
<HStack spacing={2}> <HStack spacing={2}>
<Icon as={BellIcon} boxSize={5} /> <Bell size={20} />
<Text fontWeight="bold" fontSize="md"> <Text fontWeight="bold" fontSize="md">
浏览器通知已被拒绝 浏览器通知已被拒绝
</Text> </Text>

View File

@@ -1,7 +1,7 @@
// src/layouts/components/BackToTopButton.js // src/layouts/components/BackToTopButton.js
import React, { useState, useEffect, useCallback, useRef, memo } from 'react'; import React, { useState, useEffect, useCallback, useRef, memo } from 'react';
import { IconButton } from '@chakra-ui/react'; import { IconButton } from '@chakra-ui/react';
import { FiArrowUp } from 'react-icons/fi'; import { ArrowUp } from 'lucide-react';
/** /**
* 返回顶部按钮组件 * 返回顶部按钮组件
@@ -69,7 +69,7 @@ const BackToTopButton = memo(({
return ( return (
<IconButton <IconButton
icon={<FiArrowUp />} icon={<ArrowUp size={20} />}
position="fixed" position="fixed"
bottom={position.bottom} bottom={position.bottom}
right={position.right} right={position.right}

View File

@@ -2,7 +2,7 @@
// 价格相关的工具函数 - 中国A股配色红涨绿跌 // 价格相关的工具函数 - 中国A股配色红涨绿跌
import React from 'react'; import React from 'react';
import { TriangleUpIcon, TriangleDownIcon } from '@chakra-ui/icons'; import { ChevronUp, ChevronDown } from 'lucide-react';
/** /**
* 获取价格变化的文字颜色 * 获取价格变化的文字颜色
@@ -98,10 +98,10 @@ export const formatPriceChange = (value, decimals = 2) => {
export const PriceArrow = ({ value }) => { export const PriceArrow = ({ value }) => {
if (value === null || value === undefined) return null; if (value === null || value === undefined) return null;
const Icon = value > 0 ? TriangleUpIcon : TriangleDownIcon; const Icon = value > 0 ? ChevronUp : ChevronDown;
const color = value > 0 ? 'red.500' : 'green.500'; const color = value > 0 ? '#e53e3e' : '#38a169'; // red.500 : green.500
return <Icon color={color} boxSize="16px" />; return <Icon color={color} size={16} />;
}; };
// ==================== 货币/数值格式化 ==================== // ==================== 货币/数值格式化 ====================

View File

@@ -34,17 +34,7 @@ import {
SlackLogo, SlackLogo,
SpotifyLogo, SpotifyLogo,
} from "components/Icons/Icons.js"; } from "components/Icons/Icons.js";
import { AiOutlineExclamation } from "react-icons/ai"; import { AlertCircle, ArrowDown, ArrowUp, Bell, CreditCard, FileText, Code, ShoppingCart, Box } from "lucide-react";
import {
FaArrowDown,
FaArrowUp,
FaBell,
FaCreditCard,
FaFilePdf,
FaHtml5,
FaShoppingCart,
} from "react-icons/fa";
import { SiDropbox } from "react-icons/si";
export const dashboardTableData = [ export const dashboardTableData = [
{ {
@@ -93,31 +83,31 @@ export const dashboardTableData = [
export const timelineData = [ export const timelineData = [
{ {
logo: FaBell, logo: Bell,
title: "$2400, Design changes", title: "$2400, Design changes",
date: "22 DEC 7:20 PM", date: "22 DEC 7:20 PM",
color: "blue.500", color: "blue.500",
}, },
{ {
logo: FaHtml5, logo: Code,
title: "New order #4219423", title: "New order #4219423",
date: "21 DEC 11:21 PM", date: "21 DEC 11:21 PM",
color: "orange", color: "orange",
}, },
{ {
logo: FaShoppingCart, logo: ShoppingCart,
title: "Server Payments for April", title: "Server Payments for April",
date: "21 DEC 9:28 PM", date: "21 DEC 9:28 PM",
color: "blue.400", color: "blue.400",
}, },
{ {
logo: FaCreditCard, logo: CreditCard,
title: "New card added for order #3210145", title: "New card added for order #3210145",
date: "20 DEC 3:52 PM", date: "20 DEC 3:52 PM",
color: "orange.300", color: "orange.300",
}, },
{ {
logo: SiDropbox, logo: Box,
title: "Unlock packages for Development", title: "Unlock packages for Development",
date: "19 DEC 11:35 PM", date: "19 DEC 11:35 PM",
color: "purple", color: "purple",
@@ -131,13 +121,13 @@ export const timelineData = [
export const timelineProjectsData = [ export const timelineProjectsData = [
{ {
logo: FaBell, logo: Bell,
title: "$2400, Design changes", title: "$2400, Design changes",
titleColor: "#fff", titleColor: "#fff",
date: "22 DEC 7:20 PM", date: "22 DEC 7:20 PM",
color: "blue.500", color: "blue.500",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "blue.500", bgTag: "blue.500",
@@ -146,13 +136,13 @@ export const timelineProjectsData = [
], ],
}, },
{ {
logo: FaHtml5, logo: Code,
title: "New order #4219423", title: "New order #4219423",
titleColor: "#fff", titleColor: "#fff",
date: "21 DEC 11:21 PM", date: "21 DEC 11:21 PM",
color: "red.500", color: "red.500",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "red.500", bgTag: "red.500",
@@ -165,13 +155,13 @@ export const timelineProjectsData = [
], ],
}, },
{ {
logo: FaShoppingCart, logo: ShoppingCart,
title: "Server Payments for April", title: "Server Payments for April",
titleColor: "#fff", titleColor: "#fff",
date: "21 DEC 9:28 PM", date: "21 DEC 9:28 PM",
color: "green.400", color: "green.400",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "green.400", bgTag: "green.400",
@@ -184,13 +174,13 @@ export const timelineProjectsData = [
], ],
}, },
{ {
logo: FaCreditCard, logo: CreditCard,
title: "New card added for order #3210145", title: "New card added for order #3210145",
titleColor: "#fff", titleColor: "#fff",
date: "20 DEC 3:52 PM", date: "20 DEC 3:52 PM",
color: "orange.300", color: "orange.300",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "orange.300", bgTag: "orange.300",
@@ -207,13 +197,13 @@ export const timelineProjectsData = [
], ],
}, },
{ {
logo: SiDropbox, logo: Box,
title: "Unlock packages for Development", title: "Unlock packages for Development",
titleColor: "#fff", titleColor: "#fff",
date: "19 DEC 11:35 PM", date: "19 DEC 11:35 PM",
color: "purple.400", color: "purple.400",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "purple.400", bgTag: "purple.400",
@@ -222,13 +212,13 @@ export const timelineProjectsData = [
], ],
}, },
{ {
logo: FaBell, logo: Bell,
title: "$2400, Design changes", title: "$2400, Design changes",
titleColor: "#fff", titleColor: "#fff",
date: "22 DEC 7:20 PM", date: "22 DEC 7:20 PM",
color: "green.400", color: "green.400",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "green.400", bgTag: "green.400",
@@ -237,13 +227,13 @@ export const timelineProjectsData = [
], ],
}, },
{ {
logo: FaHtml5, logo: Code,
title: "New order #4219423", title: "New order #4219423",
titleColor: "#fff", titleColor: "#fff",
date: "21 DEC 11:21 PM", date: "21 DEC 11:21 PM",
color: "orange", color: "orange",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "red.500", bgTag: "red.500",
@@ -256,13 +246,13 @@ export const timelineProjectsData = [
], ],
}, },
{ {
logo: FaShoppingCart, logo: ShoppingCart,
title: "Server Payments for April", title: "Server Payments for April",
titleColor: "#fff", titleColor: "#fff",
date: "21 DEC 9:28 PM", date: "21 DEC 9:28 PM",
color: "blue.400", color: "blue.400",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "blue.400", bgTag: "blue.400",
@@ -275,13 +265,13 @@ export const timelineProjectsData = [
], ],
}, },
{ {
logo: FaCreditCard, logo: CreditCard,
title: "New card added for order #3210145", title: "New card added for order #3210145",
titleColor: "#fff", titleColor: "#fff",
date: "20 DEC 3:52 PM", date: "20 DEC 3:52 PM",
color: "orange.300", color: "orange.300",
description: description:
"People care about how you see the world, how you think, what motivates you, what youre struggling with or afraid of.", "People care about how you see the world, how you think, what motivates you, what you're struggling with or afraid of.",
tags: [ tags: [
{ {
bgTag: "orange.300", bgTag: "orange.300",
@@ -346,31 +336,31 @@ export const rtlDashboardTableData = [
export const rtlTimelineData = [ export const rtlTimelineData = [
{ {
logo: FaBell, logo: Bell,
title: "$2400, تغييرات في التصميم", title: "$2400, تغييرات في التصميم",
date: "22 DEC 7:20 PM", date: "22 DEC 7:20 PM",
color: "blue.500", color: "blue.500",
}, },
{ {
logo: FaHtml5, logo: Code,
title: "طلب جديد #4219423", title: "طلب جديد #4219423",
date: "21 DEC 11:21 PM", date: "21 DEC 11:21 PM",
color: "orange", color: "orange",
}, },
{ {
logo: FaShoppingCart, logo: ShoppingCart,
title: "مدفوعات الخادم لشهر أبريل", title: "مدفوعات الخادم لشهر أبريل",
date: "21 DEC 9:28 PM", date: "21 DEC 9:28 PM",
color: "blue.400", color: "blue.400",
}, },
{ {
logo: FaCreditCard, logo: CreditCard,
title: "تمت إضافة بطاقة جديدة للطلب #3210145", title: "تمت إضافة بطاقة جديدة للطلب #3210145",
date: "20 DEC 3:52 PM", date: "20 DEC 3:52 PM",
color: "orange.300", color: "orange.300",
}, },
{ {
logo: SiDropbox, logo: Box,
title: "فتح الحزم من أجل التنمية", title: "فتح الحزم من أجل التنمية",
date: "19 DEC 11:35 PM", date: "19 DEC 11:35 PM",
color: "purple", color: "purple",
@@ -482,35 +472,35 @@ export const invoicesData = [
date: "March, 01, 2020", date: "March, 01, 2020",
code: "#MS-415646", code: "#MS-415646",
price: "$180", price: "$180",
logo: FaFilePdf, logo: FileText,
format: "PDF", format: "PDF",
}, },
{ {
date: "February, 10, 2020", date: "February, 10, 2020",
code: "#RV-126749", code: "#RV-126749",
price: "$250", price: "$250",
logo: FaFilePdf, logo: FileText,
format: "PDF", format: "PDF",
}, },
{ {
date: "April, 05, 2020", date: "April, 05, 2020",
code: "#FB-212562", code: "#FB-212562",
price: "$560", price: "$560",
logo: FaFilePdf, logo: FileText,
format: "PDF", format: "PDF",
}, },
{ {
date: "June, 25, 2019", date: "June, 25, 2019",
code: "#QW-103578", code: "#QW-103578",
price: "$120", price: "$120",
logo: FaFilePdf, logo: FileText,
format: "PDF", format: "PDF",
}, },
{ {
date: "March, 01, 2019", date: "March, 01, 2019",
code: "#AR-803481", code: "#AR-803481",
price: "$300", price: "$300",
logo: FaFilePdf, logo: FileText,
format: "PDF", format: "PDF",
}, },
]; ];
@@ -541,13 +531,13 @@ export const newestTransactions = [
name: "Netflix", name: "Netflix",
date: "27 March 2022, at 12:30 PM", date: "27 March 2022, at 12:30 PM",
price: "- $2,500", price: "- $2,500",
logo: FaArrowDown, logo: ArrowDown,
}, },
{ {
name: "Apple", name: "Apple",
date: "27 March 2022, at 12:30 PM", date: "27 March 2022, at 12:30 PM",
price: "+ $2,500", price: "+ $2,500",
logo: FaArrowUp, logo: ArrowUp,
}, },
]; ];
@@ -556,25 +546,25 @@ export const olderTransactions = [
name: "Stripe", name: "Stripe",
date: "26 March 2022, at 13:45 PM", date: "26 March 2022, at 13:45 PM",
price: "+ $800", price: "+ $800",
logo: FaArrowUp, logo: ArrowUp,
}, },
{ {
name: "HubSpot", name: "HubSpot",
date: "26 March 2022, at 12:30 PM", date: "26 March 2022, at 12:30 PM",
price: "+ $1,700", price: "+ $1,700",
logo: FaArrowUp, logo: ArrowUp,
}, },
{ {
name: "Webflow", name: "Webflow",
date: "26 March 2022, at 05:00 PM", date: "26 March 2022, at 05:00 PM",
price: "Pending", price: "Pending",
logo: AiOutlineExclamation, logo: AlertCircle,
}, },
{ {
name: "Microsoft", name: "Microsoft",
date: "25 March 2022, at 16:30 PM", date: "25 March 2022, at 16:30 PM",
price: "- $987", price: "- $987",
logo: FaArrowDown, logo: ArrowDown,
}, },
]; ];
@@ -583,19 +573,19 @@ export const transactionsCRM = [
name: "Netflix", name: "Netflix",
date: "26 March 2022, at 13:45 PM", date: "26 March 2022, at 13:45 PM",
price: "- $2500", price: "- $2500",
logo: FaArrowDown, logo: ArrowDown,
}, },
{ {
name: "Apple", name: "Apple",
date: "26 March 2022, at 12:30 PM", date: "26 March 2022, at 12:30 PM",
price: "+ $2500", price: "+ $2500",
logo: FaArrowUp, logo: ArrowUp,
}, },
{ {
name: "Stripe", name: "Stripe",
date: "26 March 2022, at 05:00 PM", date: "26 March 2022, at 05:00 PM",
price: "+ $9900", price: "+ $9900",
logo: FaArrowUp, logo: ArrowUp,
}, },
]; ];
@@ -604,19 +594,19 @@ export const revenueCRM = [
name: "via Paypal", name: "via Paypal",
date: "27 March 2022, at 12:30 PM", date: "27 March 2022, at 12:30 PM",
price: "+ $8700", price: "+ $8700",
logo: FaArrowUp, logo: ArrowUp,
}, },
{ {
name: "Partner #01424", name: "Partner #01424",
date: "27 March 2022, at 12:30 PM", date: "27 March 2022, at 12:30 PM",
price: "+ $12000", price: "+ $12000",
logo: FaArrowUp, logo: ArrowUp,
}, },
{ {
name: "Services", name: "Services",
date: "26 March 2022, at 10:10 PM", date: "26 March 2022, at 10:10 PM",
price: "- $1900", price: "- $1900",
logo: FaArrowDown, logo: ArrowDown,
}, },
]; ];