feat: 添加停止代理任务功能并优化样式

This commit is contained in:
rd
2025-09-12 15:38:09 +08:00
parent 5c640adc57
commit 5dcb381428

View File

@ -5,7 +5,7 @@ import SenderInput from './components/sender-input/index.vue';
import RightView from './components/right-view/index.vue'; import RightView from './components/right-view/index.vue';
import { useChatStore } from '@/stores/modules/chat'; import { useChatStore } from '@/stores/modules/chat';
import { getConversationList } from '@/api/all/chat'; import { getConversationList, stopAgentTask } from '@/api/all/chat';
import querySSE from '@/utils/querySSE'; import querySSE from '@/utils/querySSE';
import useChatHandler from './useChatHandler'; import useChatHandler from './useChatHandler';
import { QUESTION_ROLE, LOADING_ROLE } from './constants'; import { QUESTION_ROLE, LOADING_ROLE } from './constants';
@ -58,6 +58,7 @@ export default {
if (generateLoading.value) { if (generateLoading.value) {
bubbleListRef.value?.abortTypingByKey(generateTeamRunTaskId.value); bubbleListRef.value?.abortTypingByKey(generateTeamRunTaskId.value);
sseController.value?.abort?.(); sseController.value?.abort?.();
stopAgentTask({ run_id: generateTeamRunTaskId.value });
} }
if (showRightView.value) { if (showRightView.value) {
rightViewRef.value?.abortTyping?.(); rightViewRef.value?.abortTyping?.();
@ -165,7 +166,7 @@ export default {
<SenderInput <SenderInput
v-model={searchValue.value} v-model={searchValue.value}
ref={senderRef} ref={senderRef}
style={{ 'width': 'var(--max-content-width)' }} style={{ width: 'var(--max-content-width)' }}
placeholder="继续追问..." placeholder="继续追问..."
loading={generateLoading.value} loading={generateLoading.value}
onSubmit={handleSubmit} onSubmit={handleSubmit}