From 9febff2200cc6cb0415e1452e703e90d62e58551 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Tue, 27 Aug 2024 11:58:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2=E6=B8=85=E7=A9=BA=20AI=20?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/application/ApplicationSetting.vue | 8 ++++++-- ui/src/workflow/nodes/ai-chat-node/index.vue | 8 ++++++-- ui/src/workflow/nodes/question-node/index.vue | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ui/src/views/application/ApplicationSetting.vue b/ui/src/views/application/ApplicationSetting.vue index f202cf59f..7880ee4ca 100644 --- a/ui/src/views/application/ApplicationSetting.vue +++ b/ui/src/views/application/ApplicationSetting.vue @@ -451,8 +451,12 @@ const submit = async (formEl: FormInstance | undefined) => { } }) } -const model_change = (model_id: string) => { - AIModeParamSettingDialogRef.value?.reset_default(model_id) +const model_change = (model_id?: string) => { + if (model_id) { + AIModeParamSettingDialogRef.value?.reset_default(model_id) + } else { + refreshForm({}) + } } const openAIParamSettingDialog = () => { const model_id = applicationForm.value.model_id diff --git a/ui/src/workflow/nodes/ai-chat-node/index.vue b/ui/src/workflow/nodes/ai-chat-node/index.vue index 04b279988..87737459c 100644 --- a/ui/src/workflow/nodes/ai-chat-node/index.vue +++ b/ui/src/workflow/nodes/ai-chat-node/index.vue @@ -239,8 +239,12 @@ function submitDialog() { set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value) dialogVisible.value = false } -const model_change = (model_id: string) => { - AIModeParamSettingDialogRef.value?.reset_default(model_id) +const model_change = (model_id?: string) => { + if (model_id) { + AIModeParamSettingDialogRef.value?.reset_default(model_id) + } else { + refreshParam({}) + } } const { params: { id } diff --git a/ui/src/workflow/nodes/question-node/index.vue b/ui/src/workflow/nodes/question-node/index.vue index b2cdc0d02..adfb34b8d 100644 --- a/ui/src/workflow/nodes/question-node/index.vue +++ b/ui/src/workflow/nodes/question-node/index.vue @@ -232,8 +232,12 @@ function openDialog() { cloneContent.value = form_data.value.prompt dialogVisible.value = true } -const model_change = (model_id: string) => { - AIModeParamSettingDialogRef.value?.reset_default(model_id) +const model_change = (model_id?: string) => { + if (model_id) { + AIModeParamSettingDialogRef.value?.reset_default(model_id) + } else { + refreshParam({}) + } } function submitDialog() { set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value)