From 9a13bdffef589f0f36836f23a89f9c1d928b6fa0 Mon Sep 17 00:00:00 2001 From: zhangzhanwei Date: Mon, 1 Jun 2026 17:42:24 +0800 Subject: [PATCH] fix: User input params --- .../ai-chat/component/inline-params/index.vue | 4 ++-- ui/src/components/ai-chat/index.vue | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ui/src/components/ai-chat/component/inline-params/index.vue b/ui/src/components/ai-chat/component/inline-params/index.vue index 22da869d872..eda6bd5dab6 100644 --- a/ui/src/components/ai-chat/component/inline-params/index.vue +++ b/ui/src/components/ai-chat/component/inline-params/index.vue @@ -165,8 +165,8 @@ const exposedFields = computed(() => { }) const dialogFields = computed(() => { - if (setting.value.exposed_fields.length === 0) return fieldList.value - return fieldList.value.filter((f) => !setting.value.exposed_fields.includes(f.field)) + const inlineKeys = new Set(exposedFields.value.map((f) => f.field)) + return fieldList.value.filter((f) => !inlineKeys.has(f.field)) }) const visibilityMap = computed(() => computeVisibilityMap(fieldList.value, formValue.value)) diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 8008da97e88..c4150a84c73 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -14,10 +14,7 @@ @@ -263,6 +260,13 @@ const { application, common, chatUser } = useStore() const isMobile = computed(() => { return common.isMobile() || mode === 'embed' || mode === 'mobile' }) +const maxExposed = computed(() => (isMobile.value ? 1 : 3)) +const inlineExposedFields = computed(() => + ( + props.applicationDetails?.work_flow?.nodes?.find((v: any) => v.id === 'base-node') + ?.properties?.user_input_field_list_setting?.exposed_fields || [] + ).slice(0, maxExposed.value), +) const aiChatRef = ref() const scrollDiv = ref() const dialogScrollbar = ref()