Commit 5b8ffb5a authored by tyyin lan's avatar tyyin lan

fix(首页): 切换对话后参考文件信息未清空

parent 4cc157d3
......@@ -97,6 +97,7 @@ function handleCreateNewSession() {
isAgentResponding.value = false
emit('createNewSession')
handleFileUploadCancel()
/* 延时,避免页面刷新后,历史记录列表未刷新 */
setTimeout(() => {
......@@ -111,6 +112,7 @@ function handleCreateNewSession() {
}
emit('createNewSession')
handleFileUploadCancel()
}
}
......@@ -283,6 +285,10 @@ function handleFileUploadCancel() {
function handleFileUploadReplace() {
handleFileUploadPopup()
}
defineExpose({
clearSessionReferenceFile: handleFileUploadCancel,
})
</script>
<template>
......
......@@ -19,6 +19,7 @@ const emit = defineEmits<{
getMessageRecordList: [recordId: string]
createNewSession: []
historyRecordListUpdate: []
clearSessionReferenceFile: []
}>()
const isShowHistoryMenu = defineModel<boolean>({ default: true })
......@@ -143,6 +144,7 @@ function handleRecordItemApply(dialogsId: string) {
isAgentResponding.value = false
emit('getMessageRecordList', dialogsId)
emit('clearSessionReferenceFile')
/* 延时,避免页面刷新后,历史记录列表未刷新 */
setTimeout(() => {
......@@ -155,6 +157,7 @@ function handleRecordItemApply(dialogsId: string) {
// })
emit('getMessageRecordList', dialogsId)
emit('clearSessionReferenceFile')
}
}
......
......@@ -17,6 +17,7 @@ const { t } = useI18n()
const homeContainerRef = useTemplateRef<HTMLDivElement>('homeContainerRef')
const messageListRef = useTemplateRef<InstanceType<typeof MessageList>>('messageListRef')
const historyMenuSidebarRef = useTemplateRef<InstanceType<typeof HistoryMenuSidebar>>('historyMenuSidebarRef')
const footerOperationRef = useTemplateRef<InstanceType<typeof FooterOperation>>('footerOperationRef')
const { width: homeContainerWidth } = useElementSize(homeContainerRef)
......@@ -195,6 +196,10 @@ function onGetMessageRecordList(recordId: string) {
loadingCtl.destroy()
})
}
function onClearSessionReferenceFile() {
footerOperationRef.value && footerOperationRef.value.clearSessionReferenceFile()
}
</script>
<template>
......@@ -213,6 +218,7 @@ function onGetMessageRecordList(recordId: string) {
<MessageList v-show="isShowMessageList" ref="messageListRef" :message-list="messageList" />
<FooterOperation
ref="footerOperationRef"
v-model:current-agent-application="currentAgentApplication"
v-model:is-agent-responding="isAgentResponding"
v-model:question-content="questionContent"
......@@ -237,6 +243,7 @@ function onGetMessageRecordList(recordId: string) {
@get-message-record-list="onGetMessageRecordList"
@create-new-session="onCreateNewSession"
@history-record-list-update="onHistoryRecordListUpdate"
@clear-session-reference-file="onClearSessionReferenceFile"
/>
</div>
......
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