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 ? '已添加' : '添加自选'}
+ }
+ onClick={(e) => openPushConfig(item, e)}
+ >
+ 消息推送
+
))}
+
+ {/* 消息推送配置模态框 */}
+ 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 = () => {
>
删除自选
+ }
+ onClick={(e) => openPushConfig(item, e)}
+ >
+ 消息推送
+
@@ -197,6 +222,135 @@ const Watchlist = () => {
>
)}
+
+ {/* 消息推送配置模态框 */}
+ setPushModalVisible(false)}
+ width={800}
+ footer={[
+ ,
+
+ ]}
+ >
+
+
);
};