Commit d3b643f3 authored by 水玉婷's avatar 水玉婷
Browse files

feat:思考结束不折叠思考过程+网络波动error

parent 79ac702a
......@@ -77,9 +77,9 @@
</template>
</div>
<!-- 失败状态重发按钮 -->
<div v-if="msg.status === -1" class="message-failed-wrapper">
<div v-if="msg.status === -1 && msg.messageType === 'sent'" class="message-failed-wrapper">
<div class="failed-indicator">
<span class="failed-text">发送失败</span>
<span class="failed-text">消息发送失败,系统检测到网络波动,您可以稍后重新发送。</span>
<a-button class="retry-button" @click="retrySendMessage(index)" title="重新发送">
<reload-outlined />
</a-button>
......@@ -478,14 +478,6 @@ const sendMessage = async (type: MessageType = 'text', params: MessageParams = {
if (messageData) {
messageData.status = -1;
}
const simulatedMessage = {
message: '消息发送失败,系统检测到网络波动,您可以稍后重新发送。',
status: -1, // 错误状态
type: 0 // 错误类型
};
// 调用handleSSEMessage处理模拟消息
return handleSSEMessage(simulatedMessage, true);
}
}
} catch (e) {
......
......@@ -314,9 +314,8 @@ li {
}
.retry-button {
background: @error-bg;
border: 1px solid @error-border;
color: @error-color;
border:none;
color: @gray-7;
padding: 4px;
border-radius: 4px;
cursor: pointer;
......@@ -325,11 +324,6 @@ li {
justify-content: center;
width: 24px;
height: 24px;
&:hover {
background: @error-color;
color: white;
}
}
}
}
......
......@@ -435,7 +435,8 @@ export class ContentTemplateService {
updatedResponse.contentBlocks[updatedBlockIndex].hasThinkBox = true;
// 思考结束后保持展开状态
updatedResponse.contentBlocks[updatedBlockIndex].thinkBoxExpanded = defaultThinkBoxExpanded;
// updatedResponse.contentBlocks[updatedBlockIndex].thinkBoxExpanded = defaultThinkBoxExpanded;
updatedResponse.contentBlocks[updatedBlockIndex].thinkBoxExpanded = true;
// 重置思考开始时间
this.thinkingStartTime = null;
......@@ -465,13 +466,13 @@ export class ContentTemplateService {
completionTokens = messageContent?.completionTokens || 0;
totalTokens = messageContent?.totalTokens || 0;
// 只有实时对话才在29时折叠思考框,历史数据不受影响
if (!isHistoryData && updatedResponse && updatedResponse.contentBlocks.length > 0) {
updatedResponse.contentBlocks.forEach((block) => {
if (block.hasThinkBox) {
block.thinkBoxExpanded = false;
}
});
}
// if (!isHistoryData && updatedResponse && updatedResponse.contentBlocks.length > 0) {
// updatedResponse.contentBlocks.forEach((block) => {
// if (block.hasThinkBox) {
// block.thinkBoxExpanded = false;
// }
// });
// }
updatedIsThinking = false;
updatedBlockIndex = -1;
break;
......
Supports Markdown
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