Merge pull request #11138 from dataease/pr@dev-v2_st

fix(系统设置): 输出对话后输入框没有清空,且右侧字段字表留白过多,导致字段显示不全
This commit is contained in:
dataeaseShu 2024-07-24 11:16:58 +08:00 committed by GitHub
commit f0972886af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -151,20 +151,22 @@ const handleShowLeft = val => {
}
const copilotChatLoading = ref(false)
const inputRef = ref()
let time = null
const queryAnswer = () => {
const queryAnswer = (event?: KeyboardEvent) => {
if (event.keyCode === 13) {
event.preventDefault()
}
let copyAuestionInput = questionInput.value
if (!isActive.value || copilotChatLoading.value) return
clearTimeout(time)
time = setTimeout(() => {
questionInput.value = copyAuestionInput
inputRef.value.blur()
}, 0)
questionInput.value = ''
inputRef.value.blur()
nextTick(() => {
overHeight.value = false
})
historyArr.value.push({
msgType: 'user',
chart: {},
id: `${+new Date()}`,
question: questionInput.value,
question: copyAuestionInput,
chartData: {
data: {},
title: ''
@ -174,7 +176,7 @@ const queryAnswer = () => {
copilotChatLoading.value = true
copilotChat({
datasetGroupId: datasetId.value,
question: questionInput.value,
question: copyAuestionInput,
history: historyBack
})
.then(res => {
@ -185,9 +187,6 @@ const queryAnswer = () => {
copilotChatLoading.value = false
})
}
onBeforeUnmount(() => {
clearTimeout(time)
})
</script>
<template>
@ -498,7 +497,7 @@ onBeforeUnmount(() => {
.preview-field {
padding: 0 8px;
width: 100%;
height: calc(100% - 340px);
height: calc(100% - 100px);
position: relative;
overflow-y: auto;