Commit b71d5d1f authored by nick zheng's avatar nick zheng

fix: 移动端应用切换后台再进入追问一直loading问题

parent a564e5ad
...@@ -55,6 +55,7 @@ const { uploadFileList, handleLimitUpload, handleUpload, handleRemoveFile } = us ...@@ -55,6 +55,7 @@ const { uploadFileList, handleLimitUpload, handleUpload, handleRemoveFile } = us
const { uploadImageList, handleLimitUploadImage, handleUploadImage, handleRemoveUploadImage } = useUploadImage() const { uploadImageList, handleLimitUploadImage, handleUploadImage, handleRemoveUploadImage } = useUploadImage()
const isAnswerResponseWait = defineModel<boolean>('isAnswerResponseLoading', { required: true }) const isAnswerResponseWait = defineModel<boolean>('isAnswerResponseLoading', { required: true })
const isAnswerResponseInterrupt = defineModel<boolean>('isAnswerResponseInterrupt', { required: true })
const emitter = inject<Emitter<MittEvents>>('emitter') const emitter = inject<Emitter<MittEvents>>('emitter')
...@@ -202,6 +203,7 @@ function handleMessageSend(lastQuestionContent?: string) { ...@@ -202,6 +203,7 @@ function handleMessageSend(lastQuestionContent?: string) {
let replyTextContent = '' let replyTextContent = ''
let reasoningContent = '' let reasoningContent = ''
isAnswerResponseWait.value = true isAnswerResponseWait.value = true
isAnswerResponseInterrupt.value = false
currentReplyContentSentenceExtractIndex.value = 0 currentReplyContentSentenceExtractIndex.value = 0
sentenceFragmentSerialNo.value = 0 sentenceFragmentSerialNo.value = 0
sentenceExtractCheckEnabled.value = false sentenceExtractCheckEnabled.value = false
......
...@@ -15,7 +15,7 @@ interface Props { ...@@ -15,7 +15,7 @@ interface Props {
continuousQuestionList: string[] continuousQuestionList: string[]
isAnswerResponseLoading: boolean isAnswerResponseLoading: boolean
createContinueQuestionsException: boolean createContinueQuestionsException: boolean
lastQuestionContent?: string isAnswerResponseInterrupt?: boolean
} }
const props = defineProps<Props>() const props = defineProps<Props>()
...@@ -39,7 +39,7 @@ const isShowContinueQuestion = computed(() => { ...@@ -39,7 +39,7 @@ const isShowContinueQuestion = computed(() => {
props.messageList.size > 1 && props.messageList.size > 1 &&
!props.isAnswerResponseLoading && !props.isAnswerResponseLoading &&
!props.createContinueQuestionsException && !props.createContinueQuestionsException &&
!props.lastQuestionContent !props.isAnswerResponseInterrupt
) )
}) })
......
...@@ -77,6 +77,7 @@ const isSoundCtlCreated = ref(false) ...@@ -77,6 +77,7 @@ const isSoundCtlCreated = ref(false)
const isAnswerResponseLoading = ref(false) const isAnswerResponseLoading = ref(false)
const createContinueQuestionsException = ref(false) const createContinueQuestionsException = ref(false)
const lastQuestionContent = ref('') // 上一次提问内容 const lastQuestionContent = ref('') // 上一次提问内容
const isAnswerResponseInterrupt = ref(false) // 回答响应被中断
const isEnableDocumentParse = computed(() => { const isEnableDocumentParse = computed(() => {
return agentApplicationConfig.value.knowledgeConfig.isDocumentParsing === 'Y' return agentApplicationConfig.value.knowledgeConfig.isDocumentParsing === 'Y'
...@@ -350,6 +351,7 @@ function handleExitPage() { ...@@ -350,6 +351,7 @@ function handleExitPage() {
lastQuestionContent.value = messageListArr[messageListArr.length - 2]?.textContent || '' lastQuestionContent.value = messageListArr[messageListArr.length - 2]?.textContent || ''
} }
isAnswerResponseInterrupt.value = true
footerInputRef.value?.errorMessageResponse() footerInputRef.value?.errorMessageResponse()
} }
} }
...@@ -388,7 +390,7 @@ function handleExitPage() { ...@@ -388,7 +390,7 @@ function handleExitPage() {
:continuous-question-list="continueQuestionList" :continuous-question-list="continueQuestionList"
:is-answer-response-loading="isAnswerResponseLoading" :is-answer-response-loading="isAnswerResponseLoading"
:create-continue-questions-exception="createContinueQuestionsException" :create-continue-questions-exception="createContinueQuestionsException"
:last-question-content="lastQuestionContent" :is-answer-response-interrupt="isAnswerResponseInterrupt"
@audio-play="handleAudioPlay" @audio-play="handleAudioPlay"
@audio-pause="handleAudioPause" @audio-pause="handleAudioPause"
/> />
...@@ -399,6 +401,7 @@ function handleExitPage() { ...@@ -399,6 +401,7 @@ function handleExitPage() {
<FooterInput <FooterInput
ref="footerInputRef" ref="footerInputRef"
v-model:is-answer-response-loading="isAnswerResponseLoading" v-model:is-answer-response-loading="isAnswerResponseLoading"
v-model:is-answer-response-interrupt="isAnswerResponseInterrupt"
:message-list="messageList" :message-list="messageList"
:dialogs-id="dialogsId" :dialogs-id="dialogsId"
:agent-id="agentApplicationConfig.baseInfo.agentId" :agent-id="agentApplicationConfig.baseInfo.agentId"
......
...@@ -54,6 +54,7 @@ const currentSoundCtl = shallowRef<Howl | null>(null) ...@@ -54,6 +54,7 @@ const currentSoundCtl = shallowRef<Howl | null>(null)
const isSoundCtlCreated = ref(false) const isSoundCtlCreated = ref(false)
const isAnswerResponseLoading = ref(false) const isAnswerResponseLoading = ref(false)
const createContinueQuestionsException = ref(false) const createContinueQuestionsException = ref(false)
const isAnswerResponseInterrupt = ref(false) // 回答响应被中断
const isEnableDocumentParse = computed(() => { const isEnableDocumentParse = computed(() => {
return agentApplicationConfig.value.knowledgeConfig.isDocumentParsing === 'Y' return agentApplicationConfig.value.knowledgeConfig.isDocumentParsing === 'Y'
...@@ -364,6 +365,7 @@ function handleAudioPause(isClearMessageList = false) { ...@@ -364,6 +365,7 @@ function handleAudioPause(isClearMessageList = false) {
<FooterInput <FooterInput
ref="footerInputRef" ref="footerInputRef"
v-model:is-answer-response-loading="isAnswerResponseLoading" v-model:is-answer-response-loading="isAnswerResponseLoading"
v-model:is-answer-response-interrupt="isAnswerResponseInterrupt"
:message-list="messageList" :message-list="messageList"
:dialogs-id="dialogsId" :dialogs-id="dialogsId"
:agent-id="agentApplicationConfig.baseInfo.agentId" :agent-id="agentApplicationConfig.baseInfo.agentId"
......
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