From 91391b03542b0a1a6b7f35c741e52685329a954a Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 18 Sep 2024 16:02:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B2=A1=E6=9C=89=E5=B1=95=E7=A4=BA=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1046515 --user=刘瑞斌 【应用】查看历史对话,默认没有带变量值,点击重新生成答案会报错 https://www.tapd.cn/57709429/s/1579777 --- ui/src/components/ai-chat/index.vue | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 8edcebc69..84482de39 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -15,6 +15,7 @@
{ + pre[next.key] = next.value + return pre + }, default_value) + } props.data.work_flow?.nodes ?.filter((v: any) => v.id === 'base-node') .map((v: any) => { @@ -361,6 +374,7 @@ function handleInputFieldList() { field: v.variable, input_type: 'TextInput', label: v.name, + default_value: default_value[v.variable], required: v.is_required } case 'select': @@ -368,6 +382,7 @@ function handleInputFieldList() { field: v.variable, input_type: 'SingleSelect', label: v.name, + default_value: default_value[v.variable], required: v.is_required, option_list: v.optionList.map((o: any) => { return { key: o, value: o } @@ -378,6 +393,7 @@ function handleInputFieldList() { field: v.variable, input_type: 'DatePicker', label: v.name, + default_value: default_value[v.variable], required: v.is_required, attrs: { format: 'YYYY-MM-DD HH:mm:ss', @@ -400,6 +416,7 @@ function handleInputFieldList() { field: v.variable, input_type: 'TextInput', label: v.name, + default_value: default_value[v.variable], required: v.is_required } case 'select': @@ -407,6 +424,7 @@ function handleInputFieldList() { field: v.variable, input_type: 'SingleSelect', label: v.name, + default_value: default_value[v.variable], required: v.is_required, option_list: v.optionList.map((o: any) => { return { key: o, value: o } @@ -417,6 +435,7 @@ function handleInputFieldList() { field: v.variable, input_type: 'DatePicker', label: v.name, + default_value: default_value[v.variable], required: v.is_required, attrs: { format: 'YYYY-MM-DD HH:mm:ss', @@ -445,6 +464,7 @@ watch( () => props.record, (value) => { chatList.value = value + handleInputFieldList() }, { immediate: true