fix: History record error in dialogue basic mode (#2844)
This commit is contained in:
parent
0213aff12a
commit
e5738f3b31
@ -9,7 +9,7 @@
|
|||||||
class="content"
|
class="content"
|
||||||
@mouseup="openControl"
|
@mouseup="openControl"
|
||||||
:style="{
|
:style="{
|
||||||
'padding-right': showAvatar ? 'var(--padding-left)' : '0'
|
'padding-right': showUserAvatar ? 'var(--padding-left)' : '0'
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<el-card shadow="always" class="mb-8 border-r-8" style="--el-card-padding: 6px 16px">
|
<el-card shadow="always" class="mb-8 border-r-8" style="--el-card-padding: 6px 16px">
|
||||||
@ -52,7 +52,7 @@
|
|||||||
class="content"
|
class="content"
|
||||||
:style="{
|
:style="{
|
||||||
'padding-left': showAvatar ? 'var(--padding-left)' : '0',
|
'padding-left': showAvatar ? 'var(--padding-left)' : '0',
|
||||||
'padding-right': showAvatar ? 'var(--padding-left)' : '0'
|
'padding-right': showUserAvatar ? 'var(--padding-left)' : '0'
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<OperationButton
|
<OperationButton
|
||||||
@ -92,7 +92,9 @@ const emit = defineEmits(['update:chatRecord'])
|
|||||||
const showAvatar = computed(() => {
|
const showAvatar = computed(() => {
|
||||||
return user.isEnterprise() ? props.application.show_avatar : true
|
return user.isEnterprise() ? props.application.show_avatar : true
|
||||||
})
|
})
|
||||||
|
const showUserAvatar = computed(() => {
|
||||||
|
return user.isEnterprise() ? props.application.show_user_avatar : true
|
||||||
|
})
|
||||||
const chatMessage = (question: string, type: 'old' | 'new', other_params_data?: any) => {
|
const chatMessage = (question: string, type: 'old' | 'new', other_params_data?: any) => {
|
||||||
if (type === 'old') {
|
if (type === 'old') {
|
||||||
add_answer_text_list(props.chatRecord.answer_text_list)
|
add_answer_text_list(props.chatRecord.answer_text_list)
|
||||||
|
|||||||
@ -93,6 +93,7 @@ const { user } = useStore()
|
|||||||
const showAvatar = computed(() => {
|
const showAvatar = computed(() => {
|
||||||
return user.isEnterprise() ? props.application.show_user_avatar : true
|
return user.isEnterprise() ? props.application.show_user_avatar : true
|
||||||
})
|
})
|
||||||
|
|
||||||
const document_list = computed(() => {
|
const document_list = computed(() => {
|
||||||
if (props.chatRecord?.upload_meta) {
|
if (props.chatRecord?.upload_meta) {
|
||||||
return props.chatRecord.upload_meta?.document_list || []
|
return props.chatRecord.upload_meta?.document_list || []
|
||||||
|
|||||||
@ -30,6 +30,8 @@
|
|||||||
:available="applicationAvailable"
|
:available="applicationAvailable"
|
||||||
:appId="applicationDetail?.id"
|
:appId="applicationDetail?.id"
|
||||||
:record="recordList"
|
:record="recordList"
|
||||||
|
:chatId="currentChatId"
|
||||||
|
@refresh="refresh"
|
||||||
>
|
>
|
||||||
<template #operateBefore>
|
<template #operateBefore>
|
||||||
<div>
|
<div>
|
||||||
@ -67,10 +69,15 @@ const applicationDetail = computed({
|
|||||||
set: (v) => {}
|
set: (v) => {}
|
||||||
})
|
})
|
||||||
const recordList = ref([])
|
const recordList = ref([])
|
||||||
|
const currentChatId = ref('')
|
||||||
|
|
||||||
function newChat() {
|
function newChat() {
|
||||||
|
currentChatId.value = 'new'
|
||||||
recordList.value = []
|
recordList.value = []
|
||||||
}
|
}
|
||||||
|
function refresh(id: string) {
|
||||||
|
currentChatId.value = id
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.chat {
|
.chat {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user