Skip to content

Commit e5738f3

Browse files
fix: History record error in dialogue basic mode (#2844)
1 parent 0213aff commit e5738f3

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

ui/src/components/ai-chat/component/answer-content/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class="content"
1010
@mouseup="openControl"
1111
:style="{
12-
'padding-right': showAvatar ? 'var(--padding-left)' : '0'
12+
'padding-right': showUserAvatar ? 'var(--padding-left)' : '0'
1313
}"
1414
>
1515
<el-card shadow="always" class="mb-8 border-r-8" style="--el-card-padding: 6px 16px">
@@ -52,7 +52,7 @@
5252
class="content"
5353
:style="{
5454
'padding-left': showAvatar ? 'var(--padding-left)' : '0',
55-
'padding-right': showAvatar ? 'var(--padding-left)' : '0'
55+
'padding-right': showUserAvatar ? 'var(--padding-left)' : '0'
5656
}"
5757
>
5858
<OperationButton
@@ -92,7 +92,9 @@ const emit = defineEmits(['update:chatRecord'])
9292
const showAvatar = computed(() => {
9393
return user.isEnterprise() ? props.application.show_avatar : true
9494
})
95-
95+
const showUserAvatar = computed(() => {
96+
return user.isEnterprise() ? props.application.show_user_avatar : true
97+
})
9698
const chatMessage = (question: string, type: 'old' | 'new', other_params_data?: any) => {
9799
if (type === 'old') {
98100
add_answer_text_list(props.chatRecord.answer_text_list)

ui/src/components/ai-chat/component/question-content/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const { user } = useStore()
9393
const showAvatar = computed(() => {
9494
return user.isEnterprise() ? props.application.show_user_avatar : true
9595
})
96+
9697
const document_list = computed(() => {
9798
if (props.chatRecord?.upload_meta) {
9899
return props.chatRecord.upload_meta?.document_list || []

ui/src/views/chat/base/index.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
:available="applicationAvailable"
3131
:appId="applicationDetail?.id"
3232
:record="recordList"
33+
:chatId="currentChatId"
34+
@refresh="refresh"
3335
>
3436
<template #operateBefore>
3537
<div>
@@ -67,10 +69,15 @@ const applicationDetail = computed({
6769
set: (v) => {}
6870
})
6971
const recordList = ref([])
72+
const currentChatId = ref('')
7073
7174
function newChat() {
75+
currentChatId.value = 'new'
7276
recordList.value = []
7377
}
78+
function refresh(id: string) {
79+
currentChatId.value = id
80+
}
7481
</script>
7582
<style lang="scss">
7683
.chat {

0 commit comments

Comments
 (0)