From 012807c2dabf74a828206545b50cd49520cb3a9f Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Thu, 5 Feb 2026 10:12:47 +0800 Subject: [PATCH] update pay promo --- app.py | 13 +-- src/components/ChatBot/MarkdownWithCharts.js | 25 +++-- .../AgentChat/components/ChatArea/index.js | 4 +- .../AgentChat/components/LeftSidebar/index.js | 102 +++++++++++------- 4 files changed, 91 insertions(+), 53 deletions(-) diff --git a/app.py b/app.py index 02b0f79d..42f59db2 100755 --- a/app.py +++ b/app.py @@ -10230,27 +10230,28 @@ def get_stock_quote_detail(stock_code): trade_date = row.get('TRADEDATE') - # 获取正确的昨收价:查询当前数据交易日之前的最后一个交易日的收盘价 - # 不使用 F002N,因为如果今天数据未入库,会返回昨天数据的 F002N(即前天收盘价) + # 获取正确的昨收价:始终用今天的日期查询今天之前最后一个交易日的收盘价 + # 不能用查询到的数据日期,因为如果今天数据未入库,查询到的是昨天数据 + # 那样会导致用昨天的日期查询,得到前天的收盘价,涨跌幅计算错误 yesterday_close = 0 prev_close_query = text(""" SELECT F007N as close_price FROM ea_trade WHERE SECCODE = :stock_code - AND TRADEDATE < :current_trade_date + AND TRADEDATE < CURDATE() ORDER BY TRADEDATE DESC LIMIT 1 """) prev_close_result = conn.execute(prev_close_query, { - 'stock_code': base_code, - 'current_trade_date': trade_date + 'stock_code': base_code }).fetchone() if prev_close_result: yesterday_close = float(prev_close_result[0]) if prev_close_result[0] else 0 result_data['yesterday_close'] = yesterday_close - # 用当前价和昨收价重新计算涨跌幅 + # 涨跌幅:前端会用实时价格和这个昨收价重新计算 + # 这里也计算一个作为备用(当没有实时数据时使用) if yesterday_close > 0: result_data['change_percent'] = ((current_price - yesterday_close) / yesterday_close) * 100 else: diff --git a/src/components/ChatBot/MarkdownWithCharts.js b/src/components/ChatBot/MarkdownWithCharts.js index d34f7387..e9d694e8 100644 --- a/src/components/ChatBot/MarkdownWithCharts.js +++ b/src/components/ChatBot/MarkdownWithCharts.js @@ -278,14 +278,15 @@ export const MarkdownWithCharts = ({ content, variant = 'auto' }) => { {children} ), - // 表格渲染 + // 表格渲染 - 提高深色模式下的对比度 table: ({ children }) => ( {children} @@ -293,7 +294,7 @@ export const MarkdownWithCharts = ({ content, variant = 'auto' }) => { ), thead: ({ children }) => ( - + {children} ), @@ -301,7 +302,10 @@ export const MarkdownWithCharts = ({ content, variant = 'auto' }) => { tr: ({ children }) => ( {children} @@ -310,9 +314,12 @@ export const MarkdownWithCharts = ({ content, variant = 'auto' }) => { th: ({ children }) => ( @@ -320,9 +327,9 @@ export const MarkdownWithCharts = ({ content, variant = 'auto' }) => { td: ({ children }) => ( diff --git a/src/views/AgentChat/components/ChatArea/index.js b/src/views/AgentChat/components/ChatArea/index.js index 13a0a38c..813e169d 100644 --- a/src/views/AgentChat/components/ChatArea/index.js +++ b/src/views/AgentChat/components/ChatArea/index.js @@ -234,7 +234,7 @@ const ChatArea = ({ /> ) : ( - + {/* 已上传文件预览 */} {uploadedFiles.length > 0 && ( diff --git a/src/views/AgentChat/components/LeftSidebar/index.js b/src/views/AgentChat/components/LeftSidebar/index.js index 6d11fc06..2a0aa7fd 100644 --- a/src/views/AgentChat/components/LeftSidebar/index.js +++ b/src/views/AgentChat/components/LeftSidebar/index.js @@ -17,10 +17,9 @@ import { Flex, Button, } from '@chakra-ui/react'; -import { MessageSquare, Plus, Search, ChevronLeft, ChevronDown, MoreHorizontal } from 'lucide-react'; +import { MessageSquare, Plus, Search, ChevronLeft, MoreHorizontal } from 'lucide-react'; import { animations } from '../../constants/animations'; import { groupSessionsByDate } from '../../utils/sessionUtils'; -import DateGroup from './DateGroup'; import { GLASS_BLUR } from '@/constants/glassConfig'; /** @@ -83,14 +82,14 @@ const LeftSidebar = ({ {isOpen && ( - {/* 按日期分组显示会话 */} + {/* 按日期分组显示会话 - 简化版 */} {visibleGroups.map((group, index) => ( - + + {/* 简洁的日期标题 */} + + {group.label} + + {/* 会话列表 */} + + {group.sessions.slice(0, index === 0 ? 10 : 5).map((session) => ( + onSessionSwitch(session.session_id)} + transition="all 0.15s" + > + + {session.title || '新对话'} + + + ))} + + ))} {/* 查看更多按钮 */} @@ -315,33 +350,28 @@ const LeftSidebar = ({ )} - {/* 用户信息卡片 */} - - + {/* 底部信息简化 */} + + - - - {user?.nickname || '未登录'} - - - {user?.subscription_type || 'free'} - - + + {user?.nickname || '未登录'} + + + {user?.subscription_type || 'free'} +
{children} {children}