From b60583008b733546788576e2e56b12363377df86 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Fri, 29 May 2026 18:07:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E8=8A=82=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=95=B4=E4=BD=93=E8=BE=93=E5=87=BA=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E7=9A=84=E6=B7=BB=E5=8A=A0=E5=92=8C=E5=BC=95=E7=94=A8=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E5=9B=9E=E6=98=BE=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20HTTP=20=E8=AF=B7=E6=B1=82=E4=BD=93=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/settings/creation/index.vue | 53 ++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/src/views/settings/creation/index.vue b/src/views/settings/creation/index.vue index 0285e82..f9e6424 100644 --- a/src/views/settings/creation/index.vue +++ b/src/views/settings/creation/index.vue @@ -1093,6 +1093,12 @@ const availableParentParams = computed(() => { // 如果是判断节点,跳过不添加其字段 if (isJudge) return; + // 首先添加节点的整体输出选项 + params.push({ + label: `${parentNodeName}【整体输出】`, + value: `\${${parentId}}`, + }); + // 只添加可引用字段(HTTP节点仅允许结果返回结构;其他节点维持原逻辑) if (parentProps.formConfig && Array.isArray(parentProps.formConfig)) { if (nodeCode === 'http') { @@ -1184,15 +1190,24 @@ const workflowDsl = computed(() => ({ const rawValue = item.value; let normalizedValue: any = rawValue; if (typeof rawValue === 'string') { - const matched = rawValue.match(/^\$\{([^\.}]+)\.([^}]+)\}$/); - if (matched) { - normalizedValue = { - field: matched[2], - nodeId: matched[1], - quoteOutput: false, - }; - } - } + const matched = rawValue.match(/^\$\{([^\.}]+)\.([^}]+)\}$/); + if (matched) { + normalizedValue = { + field: matched[2], + nodeId: matched[1], + quoteOutput: false, + }; + } else { + const nodeOutputMatched = rawValue.match(/^\$\{([^}]+)\}$/); + if (nodeOutputMatched) { + normalizedValue = { + field: 'nodeOutputResult', + nodeId: nodeOutputMatched[1], + quoteOutput: false, + }; + } + } + } const normalizedItem: any = { key: realKey, @@ -2550,6 +2565,14 @@ const getHttpBodyData = (field: string) => { rawItem.fieldConstraint = rawItem.fieldConstraint && typeof rawItem.fieldConstraint === 'object' ? rawItem.fieldConstraint : {}; } else { rawItem.showInForm = false; + // 回显上级节点引用:对象结构转回选择器可识别的字符串 + 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) { + rawItem.value = refField === 'nodeOutputResult' ? `\${${refNodeId}}` : refField ? `\${${refNodeId}.${refField}}` : rawItem.value; + } + } } }); return obj; @@ -2736,7 +2759,7 @@ const confirmHttpBodyConfig = () => { const rawValue = item?.value; let normalizedValue: any = rawValue; - // 如果 value 选择了上级参数(形如 ${nodeId.field}),转成对象结构传给后端 + // 如果 value 选择了上级参数(形如 ${nodeId.field})或上级节点整体输出(形如 ${nodeId}),转成对象结构传给后端 if (typeof rawValue === 'string') { const matched = rawValue.match(/^\$\{([^\.}]+)\.([^}]+)\}$/); if (matched) { @@ -2745,6 +2768,15 @@ const confirmHttpBodyConfig = () => { nodeId: matched[1], quoteOutput: false, }; + } else { + const nodeOutputMatched = rawValue.match(/^\$\{([^}]+)\}$/); + if (nodeOutputMatched) { + normalizedValue = { + field: 'nodeOutputResult', + nodeId: nodeOutputMatched[1], + quoteOutput: false, + }; + } } } @@ -5622,3 +5654,4 @@ onBeforeUnmount(() => { justify-content: center; } +