diff --git a/src/components/dialoguePanel/DialoguePanel.vue b/src/components/dialoguePanel/DialoguePanel.vue index 8882ae3e078d0ef5e0f189106c14074afe403b41..9678d156405d4c06de4fb3f5b65c843028cc71bb 100644 --- a/src/components/dialoguePanel/DialoguePanel.vue +++ b/src/components/dialoguePanel/DialoguePanel.vue @@ -126,10 +126,10 @@ const handlePauseAndReGenerate = (cid?: number) => { if (!cid) { return; } - emits("clearSuggestion", props.key); if (props.isFinish) { // 重新生成 + thoughtContent.value = ""; reGenerateAnswer(cid, user_selected_plugins.value); } else { // 停止生成 @@ -265,6 +265,7 @@ const contentAfterMark = computed(() => { const prePageHandle = (cid: number) => { + thoughtContent.value = ""; prePage(cid); if (index.value === 0) { index.value = 0; @@ -275,6 +276,7 @@ const prePageHandle = (cid: number) => { }; const nextPageHandle = (cid: number) => { + thoughtContent.value = ""; nextPage(cid); if (index.value === (props.isLikeList as number[]).length - 1) { index.value = (props.isLikeList as number[]).length - 1; @@ -306,6 +308,7 @@ const handleIsLike = () => { }; onMounted(() => { + thoughtContent.value = ""; isLike.value = props.isLikeList; setTimeout(() => { handleIsLike(); diff --git a/src/store/conversation.ts b/src/store/conversation.ts index 53677fbbf95f2cc97248113a8df438e15eb2e4eb..23478ad3933028c15593cbe765f7740730206745 100644 --- a/src/store/conversation.ts +++ b/src/store/conversation.ts @@ -537,6 +537,10 @@ export const useSessionStore = defineStore('conversation', () => { const answerIndex = conversationList.value.findIndex((val) => val.cid === cid) !== -1 ? conversationList.value.findIndex((val) => val.cid === cid) : conversationList.value.length - 1; isPaused.value = true; (conversationList.value[answerIndex] as RobotConversationItem).isFinish = true; + const conversationItem = conversationList.value[answerIndex] as RobotConversationItem; + if(!conversationItem.message[conversationItem.currentInd]){ + conversationItem.message[conversationItem.currentInd] += "暂停成功" + } cancel(); await api.stopGeneration(); }; diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index e725d1989d3906ace35b597ab57fe523a1a446ba..83166608c9907fd5d46b18bfb6ff8be4774dc33b 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -28,7 +28,7 @@ enum SupportMap { against = 0, } // const dialogueRef = ref(); -const { pausedStream, reGenerateAnswer, prePage, nextPage } = useSessionStore(); +const { pausedStream } = useSessionStore(); const themeStore = useChangeThemeStore(); const modeOptions = ref(props.modeOptions); const questions = [ @@ -585,6 +585,17 @@ watch( } ); +/** + * 暂停和重新生成问答 + */ + const handlePauseAndReGenerate = (cid?: number) => { + if (!cid) { + return; + } + pausedStream(cid); +}; + + watch(selectMode, (newValue, oldValue) => { user_selected_plugins.value = []; if (selectMode.value !== 'auto') {