diff --git a/ui/src/components/ai-chat/component/inline-params/InlineFormItem.vue b/ui/src/components/ai-chat/component/inline-params/InlineFormItem.vue index 5ba1c356b18..eff4bc450a3 100644 --- a/ui/src/components/ai-chat/component/inline-params/InlineFormItem.vue +++ b/ui/src/components/ai-chat/component/inline-params/InlineFormItem.vue @@ -94,7 +94,7 @@ const itemValue = computed({ const attrs = computed(() => { const base = props.formfield.attrs || {} - if (props.formfield.input_type === 'MultiSelect') { + if (props.formfield.input_type === 'MultiSelect' || props.formfield.input_type === 'Knowledge') { return { ...base, 'collapse-tags': true, diff --git a/ui/src/components/ai-chat/component/user-form/index.vue b/ui/src/components/ai-chat/component/user-form/index.vue index a2487c1e49f..68a1b9b5089 100644 --- a/ui/src/components/ai-chat/component/user-form/index.vue +++ b/ui/src/components/ai-chat/component/user-form/index.vue @@ -99,12 +99,9 @@ const form_data_context = computed({ }, }) -watch( - () => props.application, - (data) => { - handleInputFieldList() - }, -) +watch([() => props.application, () => props.excludeFields], () => { + handleInputFieldList() +}) function handleInputFieldList() { dynamicsFormRefresh.value++ diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index c4150a84c73..1ad7a068b0e 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -186,6 +186,7 @@ import { ChatManagement, type chatType } from '@/api/type/application' import { randomId } from '@/utils/common' import useStore from '@/stores' import { debounce } from 'lodash' +import { useElementSize } from '@vueuse/core' import AnswerContent from '@/components/ai-chat/component/answer-content/index.vue' import QuestionContent from '@/components/ai-chat/component/question-content/index.vue' import TransitionContent from '@/components/ai-chat/component/transition-content/index.vue' @@ -257,17 +258,24 @@ const emit = defineEmits([ 'update:selection', ]) const { application, common, chatUser } = useStore() + +const aiChatRef = ref() +const { width: rootWidth } = useElementSize(aiChatRef) + const isMobile = computed(() => { return common.isMobile() || mode === 'embed' || mode === 'mobile' }) -const maxExposed = computed(() => (isMobile.value ? 1 : 3)) + +const isNarrow = computed(() => rootWidth.value > 0 && rootWidth.value < 1040) + +const maxExposed = computed(() => (isNarrow.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 || [] + 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() const loading = ref(false) diff --git a/ui/src/components/dynamics-form/items/knowledge/Knowledge.vue b/ui/src/components/dynamics-form/items/knowledge/Knowledge.vue index 5434c271ebc..4903ddd48d4 100644 --- a/ui/src/components/dynamics-form/items/knowledge/Knowledge.vue +++ b/ui/src/components/dynamics-form/items/knowledge/Knowledge.vue @@ -3,6 +3,7 @@ @@ -42,6 +43,8 @@ const props = withDefaults( { modelValue: () => [] }, ) +defineOptions({ inheritAttrs: false }) + const emit = defineEmits(['update:modelValue', 'change']) const model_value = computed({ diff --git a/ui/src/locales/lang/en-US/ai-chat.ts b/ui/src/locales/lang/en-US/ai-chat.ts index 9c957a90ead..cffe1baaaf3 100644 --- a/ui/src/locales/lang/en-US/ai-chat.ts +++ b/ui/src/locales/lang/en-US/ai-chat.ts @@ -148,4 +148,5 @@ export default { executing: 'Executing', userInputSettingTip: 'Only Model, Knowledge, Switch, Date, TreeSelect, Single Select, and Multi Select component types are supported', + remainingParamsMenuTitle: 'Menu Title for Remaining Parameters', } diff --git a/ui/src/locales/lang/zh-CN/ai-chat.ts b/ui/src/locales/lang/zh-CN/ai-chat.ts index 32d2c867668..afa0a32a900 100644 --- a/ui/src/locales/lang/zh-CN/ai-chat.ts +++ b/ui/src/locales/lang/zh-CN/ai-chat.ts @@ -145,4 +145,5 @@ export default { userInputSetting: '外置参数设置(最多可显示3个)', executing: '正在执行', userInputSettingTip: '仅支持模型、知识库、开关、日期、树形选项卡、单选框、多选框组件类型', + remainingParamsMenuTitle: '其他参数收纳菜单标题', } diff --git a/ui/src/locales/lang/zh-Hant/ai-chat.ts b/ui/src/locales/lang/zh-Hant/ai-chat.ts index ad11e585bcf..9731cf2f238 100644 --- a/ui/src/locales/lang/zh-Hant/ai-chat.ts +++ b/ui/src/locales/lang/zh-Hant/ai-chat.ts @@ -145,4 +145,5 @@ export default { userInputSetting: '外置參數設定(最多可顯示3個)', executing: '正在執行', userInputSettingTip: '僅支援模型、知識庫、開關、日期、樹形選項卡、單選框、多選框元件類型', + remainingParamsMenuTitle: '其他參數收納選單標題', } diff --git a/ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue b/ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue index d0ab7f66055..c78f8fc46a0 100644 --- a/ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue +++ b/ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue @@ -38,7 +38,7 @@ /> - +