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