diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue index d632ad977..22ea18cf2 100644 --- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue +++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue @@ -268,15 +268,17 @@ const props = withDefaults( isMobile: boolean appId?: string chatId: string + showUserInput?: boolean sendMessage: (question: string, other_params_data?: any, chat?: chatType) => void openChatId: () => Promise + checkInputParam: () => boolean }>(), { applicationDetails: () => ({}), available: true } ) -const emit = defineEmits(['update:chatId', 'update:loading']) +const emit = defineEmits(['update:chatId', 'update:loading', 'update:showUserInput']) const chartOpenId = ref() const chatId_context = computed({ get: () => { 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 2276d014b..c25e87f5d 100644 --- a/ui/src/components/ai-chat/component/user-form/index.vue +++ b/ui/src/components/ai-chat/component/user-form/index.vue @@ -83,6 +83,9 @@ const inputFieldConfig = ref({ title: t('chat.userInput') }) const showUserInput = ref(true) const firstMounted = ref(false) +const dynamicsFormRef = ref>() +const dynamicsFormRef2 = ref>() + const emit = defineEmits(['update:api_form_data', 'update:form_data', 'confirm', 'cancel']) const api_form_data_context = computed({ @@ -365,7 +368,18 @@ const confirmHandle = () => { const cancelHandle = () => { emit('cancel') } -defineExpose({ checkInputParam }) +const render = (data: any) => { + if (dynamicsFormRef.value) { + dynamicsFormRef.value?.render(inputFieldList.value, data) + } +} + +const renderDebugAiChat = (data: any) => { + if (dynamicsFormRef2.value) { + dynamicsFormRef2.value?.render(apiInputFieldList.value, data) + } +} +defineExpose({ checkInputParam, render, renderDebugAiChat }) onMounted(() => { firstMounted.value = true handleInputFieldList() diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index fe608e132..4f98839e3 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -5,7 +5,10 @@ :class="type" :style="{ height: firsUserInput ? '100%' : undefined }" > -
+