From 0526feb278bcaa2403117728fb9723b66487bc61 Mon Sep 17 00:00:00 2001 From: Lxy Date: Thu, 19 Feb 2026 00:03:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/dashboard/Dashboard.css | 13 ++- src/pages/dashboard/Dashboard.jsx | 158 +++++++++++++++++++++++++++++- src/pages/watchlist/Watchlist.css | 14 ++- src/pages/watchlist/Watchlist.jsx | 158 +++++++++++++++++++++++++++++- 4 files changed, 337 insertions(+), 6 deletions(-) diff --git a/src/pages/dashboard/Dashboard.css b/src/pages/dashboard/Dashboard.css index bfa7ab3..5176a06 100644 --- a/src/pages/dashboard/Dashboard.css +++ b/src/pages/dashboard/Dashboard.css @@ -274,6 +274,7 @@ /* 查看详细分析按钮 */ .detail-button-new { flex: 1; + min-width: 100px; border-radius: 4px; font-size: 14px; padding: 10px; @@ -281,6 +282,15 @@ .watchlist-button-new { flex: 1; + min-width: 100px; + border-radius: 4px; + font-size: 14px; + padding: 10px; +} + +.push-button-new { + flex: 1; + min-width: 100px; border-radius: 4px; font-size: 14px; padding: 10px; @@ -288,8 +298,9 @@ .future-actions-new { display: flex; - gap: 12px; + gap: 8px; margin-top: 16px; + flex-wrap: wrap; } diff --git a/src/pages/dashboard/Dashboard.jsx b/src/pages/dashboard/Dashboard.jsx index e79f45f..67ae8fc 100644 --- a/src/pages/dashboard/Dashboard.jsx +++ b/src/pages/dashboard/Dashboard.jsx @@ -1,12 +1,13 @@ import React, { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { Card, Row, Col, Statistic, Button, Select, Tag, message, Spin, Alert } from 'antd'; -import { ReloadOutlined, ArrowUpOutlined, ArrowDownOutlined, FireOutlined, AlertOutlined, RobotOutlined } from '@ant-design/icons'; +import { Card, Row, Col, Statistic, Button, Select, Tag, message, Spin, Alert, Modal, Form, InputNumber, Switch, Checkbox } from 'antd'; +import { ReloadOutlined, ArrowUpOutlined, ArrowDownOutlined, FireOutlined, AlertOutlined, RobotOutlined, BellOutlined } from '@ant-design/icons'; import { fetchFuturesOverview, fetchRiskAlerts, fetchAIMarketAnalysis, toggleWatchlist } from '../../store/futuresSlice'; import { useNavigate } from 'react-router-dom'; import './Dashboard.css'; const { Option } = Select; +const { Item } = Form; const Dashboard = () => { const dispatch = useDispatch(); @@ -14,6 +15,9 @@ const Dashboard = () => { const { overview, riskAlerts, aiAnalysis, loading } = useSelector(state => state.futures); const [filterType, setFilterType] = useState('all'); const [sortBy, setSortBy] = useState('winRate'); + const [pushModalVisible, setPushModalVisible] = useState(false); + const [currentFuture, setCurrentFuture] = useState(null); + const [pushForm] = Form.useForm(); useEffect(() => { dispatch(fetchFuturesOverview()); @@ -38,6 +42,19 @@ const Dashboard = () => { message.success(future.isInWatchlist ? '已从自选移除' : '已添加到自选'); }; + const openPushConfig = (future, e) => { + e.stopPropagation(); + setCurrentFuture(future); + setPushModalVisible(true); + }; + + const savePushConfig = (values) => { + console.log('消息推送配置保存:', values); + // 模拟保存操作 + setPushModalVisible(false); + message.success('消息推送配置已保存'); + }; + const getChangeColor = (changePercent) => { return changePercent >= 0 ? '#52c41a' : '#ff4d4f'; }; @@ -310,11 +327,148 @@ const Dashboard = () => { > {item.isInWatchlist ? '已添加' : '添加自选'} + ))} + + {/* 消息推送配置模态框 */} + setPushModalVisible(false)} + width={800} + footer={[ + , + + ]} + > +
+ {/* 推送方式 */} + + + + + + + + + + + + + + + + + + + + + {/* 提醒时机 */} + + + + + + + + + + + + + + + + + + + + + {/* 推送内容 */} + + + + + + + + + + + + + + + + + + + + + + + + + + {/* 高级配置 */} + + + + + + + + + + + + + + +
+
); }; diff --git a/src/pages/watchlist/Watchlist.css b/src/pages/watchlist/Watchlist.css index 169bf5b..d5928cd 100644 --- a/src/pages/watchlist/Watchlist.css +++ b/src/pages/watchlist/Watchlist.css @@ -208,11 +208,14 @@ /* 操作按钮 */ .future-actions-new { display: flex; - gap: 12px; + gap: 8px; + flex-wrap: wrap; + margin-top: 16px; } .detail-button-new { flex: 1; + min-width: 100px; border-radius: 4px; font-size: 14px; padding: 10px; @@ -220,6 +223,15 @@ .watchlist-button-new { flex: 1; + min-width: 100px; + border-radius: 4px; + font-size: 14px; + padding: 10px; +} + +.push-button-new { + flex: 1; + min-width: 100px; border-radius: 4px; font-size: 14px; padding: 10px; diff --git a/src/pages/watchlist/Watchlist.jsx b/src/pages/watchlist/Watchlist.jsx index d6d4b83..bda1797 100644 --- a/src/pages/watchlist/Watchlist.jsx +++ b/src/pages/watchlist/Watchlist.jsx @@ -1,18 +1,22 @@ import React, { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { Card, Row, Col, Button, Select, Tag, message, Spin } from 'antd'; -import { ReloadOutlined, ArrowUpOutlined, ArrowDownOutlined, StarOutlined, DeleteOutlined } from '@ant-design/icons'; +import { Card, Row, Col, Button, Select, Tag, message, Spin, Modal, Form, InputNumber, Switch } from 'antd'; +import { ReloadOutlined, ArrowUpOutlined, ArrowDownOutlined, StarOutlined, DeleteOutlined, BellOutlined } from '@ant-design/icons'; import { fetchFuturesOverview, toggleWatchlist } from '../../store/futuresSlice'; import { useNavigate } from 'react-router-dom'; import './Watchlist.css'; const { Option } = Select; +const { Item } = Form; const Watchlist = () => { const dispatch = useDispatch(); const navigate = useNavigate(); const { overview, watchlist, loading } = useSelector(state => state.futures); const [filterType, setFilterType] = useState('all'); + const [pushModalVisible, setPushModalVisible] = useState(false); + const [currentFuture, setCurrentFuture] = useState(null); + const [pushForm] = Form.useForm(); useEffect(() => { dispatch(fetchFuturesOverview()); @@ -32,6 +36,19 @@ const Watchlist = () => { message.success(future.isInWatchlist ? '已从自选移除' : '已添加到自选'); }; + const openPushConfig = (future, e) => { + e.stopPropagation(); + setCurrentFuture(future); + setPushModalVisible(true); + }; + + const savePushConfig = (values) => { + console.log('消息推送配置保存:', values); + // 模拟保存操作 + setPushModalVisible(false); + message.success('消息推送配置已保存'); + }; + const getChangeColor = (changePercent) => { return changePercent >= 0 ? '#52c41a' : '#ff4d4f'; }; @@ -190,6 +207,14 @@ const Watchlist = () => { > 删除自选 + @@ -197,6 +222,135 @@ const Watchlist = () => { )} + + {/* 消息推送配置模态框 */} + setPushModalVisible(false)} + width={800} + footer={[ + , + + ]} + > +
+ {/* 推送方式 */} + + + + + + + + + + + + + + + + + + + + + {/* 提醒时机 */} + + + + + + + + + + + + + + + + + + + + + {/* 推送内容 */} + + + + + + + + + + + + + + + + + + + + + + + + + + {/* 高级配置 */} + + + + + + + + + + + + + + +
+
); };