修复回显问题
This commit is contained in:
@@ -734,10 +734,15 @@
|
||||
allow-create
|
||||
default-first-option
|
||||
clearable
|
||||
placeholder="值(可手动输入或选择上级参数)"
|
||||
placeholder="值(可手动输入或选择上级字段)"
|
||||
class="w100"
|
||||
>
|
||||
<el-option v-for="param in availableParentParams" :key="param.value" :label="param.label" :value="param.value" />
|
||||
<el-option
|
||||
v-for="param in getHttpBodyReferenceOptions(fieldValue.value)"
|
||||
:key="param.value"
|
||||
:label="param.label"
|
||||
:value="param.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
@@ -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<NodeLibraryGroup[]>([]);
|
||||
@@ -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}}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user