Commit 062034d5 by Liu

fix:常见问题被压缩&&接口调用多次

parent f30979f3
...@@ -864,10 +864,12 @@ export const Chat: React.FC = () => { ...@@ -864,10 +864,12 @@ export const Chat: React.FC = () => {
if (isLoading !== undefined) { if (isLoading !== undefined) {
setIsLoading(isLoading) setIsLoading(isLoading)
} }
// 发送自定义事件到父组件 // 只在真正的工具切换时触发事件(有 conversationId 时),避免 loading 状态更新时重复触发
window.dispatchEvent(new CustomEvent('toolButtonClick', { if (conversationId) {
detail: { isToolBtn, toolId, toolName, shouldChangeStyle, conversationId }, window.dispatchEvent(new CustomEvent('toolButtonClick', {
})) detail: { isToolBtn, toolId, toolName, shouldChangeStyle, conversationId },
}))
}
}} }}
placeholders={[]} placeholders={[]}
/> />
......
...@@ -64,7 +64,7 @@ export const ChatAnswerBox: React.FC<ChatAnswerBoxProps> = ({ record, showIndex, ...@@ -64,7 +64,7 @@ export const ChatAnswerBox: React.FC<ChatAnswerBoxProps> = ({ record, showIndex,
/> />
<div <div
style={{ background: '#F7FAFD' }} style={{ background: '#F7FAFD' }}
className="rounded-[20px] box-border px-[16px] py-[12px] sm:px-[24px] sm:py-[20px] relative" className="rounded-[20px] box-border px-[16px] py-[12px] sm:px-[24px] sm:py-[20px] relative flex-1 min-w-0 sm:max-w-[700px] md:max-w-[900px] lg:max-w-[1200px]"
> >
{item.answer?.length || item.cardList?.length {item.answer?.length || item.cardList?.length
? ( ? (
......
...@@ -90,7 +90,7 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer ...@@ -90,7 +90,7 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
} }
}, []) }, [])
return ( return (
<div className="sm:pl-[62px] mt-[12px] flex flex-col"> <div className="sm:pl-[62px] mt-[12px] flex flex-col sm:max-w-[700px] md:max-w-[900px] lg:max-w-[1200px]">
{!loading && questionList.length !== 0 && questionList.length > 0 && ( {!loading && questionList.length !== 0 && questionList.length > 0 && (
<div className="flex flex-col gap-[8px]"> <div className="flex flex-col gap-[8px]">
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment