File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
ui/src/components/ai-chat Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -268,15 +268,17 @@ const props = withDefaults(
268268 isMobile: boolean
269269 appId? : string
270270 chatId: string
271+ showUserInput? : boolean
271272 sendMessage: (question : string , other_params_data ? : any , chat ? : chatType ) => void
272273 openChatId: () => Promise <string >
274+ checkInputParam: () => boolean
273275 }>(),
274276 {
275277 applicationDetails : () => ({}),
276278 available: true
277279 }
278280)
279- const emit = defineEmits ([' update:chatId' , ' update:loading' ])
281+ const emit = defineEmits ([' update:chatId' , ' update:loading' , ' update:showUserInput ' ])
280282const chartOpenId = ref <string >()
281283const chatId_context = computed ({
282284 get : () => {
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ const inputFieldConfig = ref({ title: t('chat.userInput') })
8383const showUserInput = ref (true )
8484const firstMounted = ref (false )
8585
86+ const dynamicsFormRef = ref <InstanceType <typeof DynamicsForm >>()
87+ const dynamicsFormRef2 = ref <InstanceType <typeof DynamicsForm >>()
88+
8689const emit = defineEmits ([' update:api_form_data' , ' update:form_data' , ' confirm' , ' cancel' ])
8790
8891const api_form_data_context = computed ({
@@ -365,7 +368,18 @@ const confirmHandle = () => {
365368const cancelHandle = () => {
366369 emit (' cancel' )
367370}
368- defineExpose ({ checkInputParam })
371+ const render = (data : any ) => {
372+ if (dynamicsFormRef .value ) {
373+ dynamicsFormRef .value ?.render (inputFieldList .value , data )
374+ }
375+ }
376+
377+ const renderDebugAiChat = (data : any ) => {
378+ if (dynamicsFormRef2 .value ) {
379+ dynamicsFormRef2 .value ?.render (apiInputFieldList .value , data )
380+ }
381+ }
382+ defineExpose ({ checkInputParam , render , renderDebugAiChat })
369383onMounted (() => {
370384 firstMounted .value = true
371385 handleInputFieldList ()
Original file line number Diff line number Diff line change 55 :class =" type"
66 :style =" { height: firsUserInput ? '100%' : undefined }"
77 >
8- <div v-show =" showUserInputContent" :class =" firsUserInput ? 'firstUserInput' : 'popperUserInput'" >
8+ <div
9+ v-show =" showUserInputContent"
10+ :class =" firsUserInput ? 'firstUserInput' : 'popperUserInput'"
11+ >
912 <UserForm
1013 v-model:api_form_data =" api_form_data"
1114 v-model:form_data =" form_data"
6063 :type =" type"
6164 :send-message =" sendMessage"
6265 :open-chat-id =" openChatId"
66+ :check-input-param =" checkInputParam"
6367 :chat-management =" ChatManagement"
6468 v-model:chat-id =" chartOpenId"
6569 v-model:loading =" loading"
70+ v-model:show-user-input =" showUserInput"
6671 v-if =" type !== 'log'"
6772 >
6873 <template #operateBefore >
@@ -210,6 +215,9 @@ function UserFormCancel() {
210215 // api_form_data.value = JSON.parse(JSON.stringify(initialApiFormData.value))
211216 showUserInput .value = false
212217}
218+ const checkInputParam = () => {
219+ userFormRef .value ?.checkInputParam ()
220+ }
213221
214222function sendMessage(val : string , other_params_data ? : any , chat ? : chatType ) {
215223 if (! userFormRef .value ?.checkInputParam ()) {
You can’t perform that action at this time.
0 commit comments