From 4ff1944b60ab746aceb84c239a68d81f3b8f4f4c Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:39:44 +0800 Subject: [PATCH] fix: User input parameter occupancy issue (#2976) --- ui/src/components/ai-chat/index.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 781f558b5..44b68beab 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -153,8 +153,9 @@ const form_data = ref({}) const api_form_data = ref({}) const userFormRef = ref>() // 用户输入 -const firsUserInput = ref(true) +const firsUserInput = ref(false) const showUserInput = ref(false) + // 初始表单数据(用于恢复) const initialFormData = ref({}) const initialApiFormData = ref({}) @@ -184,10 +185,14 @@ watch( firsUserInput.value = false } else { chartOpenId.value = '' - firsUserInput.value = true + if (isUserInput.value) { + firsUserInput.value = true + } else if (props.type == 'debug-ai-chat' && isAPIInput.value) { + firsUserInput.value = true + } } }, - { deep: true } + { deep: true, immediate: true } ) watch(