From 367cd98018e058e72ea9b5780a9fd41740c474b0 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Sat, 6 Jun 2026 10:10:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E6=98=BE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/settings/creation/index.vue | 39 +++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/views/settings/creation/index.vue b/src/views/settings/creation/index.vue index 80656c9..4b9f31f 100644 --- a/src/views/settings/creation/index.vue +++ b/src/views/settings/creation/index.vue @@ -734,10 +734,15 @@ allow-create default-first-option clearable - placeholder="值(可手动输入或选择上级参数)" + placeholder="值(可手动输入或选择上级字段)" class="w100" > - + @@ -1183,6 +1188,32 @@ const availableParentParams = computed(() => { return params; }); +const availableParentFieldParams = computed(() => + availableParentParams.value.filter((item) => { + const value = String(item.value || '').trim(); + const label = String(item.label || '').trim(); + return value !== '${}' && !value.endsWith('.nodeOutputResult}') && !label.endsWith('.输出结果'); + }) +); +const getReferenceDisplayLabel = (value: string) => { + const formatted = formatParamReference(value); + return formatted === value ? value : formatted; +}; +const getHttpBodyReferenceOptions = (currentValue?: string) => { + const options = [...availableParentFieldParams.value]; + const normalizedValue = String(currentValue || '').trim(); + if (!normalizedValue) return options; + if (options.some((item) => item.value === normalizedValue)) return options; + const isReferenceValue = /^\$\{[^.}]+\.[^}]+\}$/.test(normalizedValue); + if (!isReferenceValue) return options; + return [ + ...options, + { + label: getReferenceDisplayLabel(normalizedValue), + value: normalizedValue, + }, + ]; +}; const treeProps = { children: 'children', label: 'label' }; const apiBaseUrl = (import.meta.env.VITE_API_URL || '').replace(/\/$/, ''); const nodeLibraryGroups = ref([]); @@ -2649,11 +2680,9 @@ const getHttpBodyData = (field: string) => { if (rawItem.value && typeof rawItem.value === 'object' && !Array.isArray(rawItem.value)) { const refNodeId = String(rawItem.value.nodeId || '').trim(); const refField = String(rawItem.value.field || '').trim(); - if (refNodeId) { - if (refField) { + if (refNodeId && refField) { rawItem.value = `\${${refNodeId}.${refField}}`; } - } } } });