mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
fix: add judge to update variable node input (#1369)
This commit is contained in:
@@ -95,14 +95,24 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
const renderTypeData = menuList.find((item) => item.renderType === updateItem.renderType);
|
const renderTypeData = menuList.find((item) => item.renderType === updateItem.renderType);
|
||||||
const handleUpdate = (newValue: any) => {
|
const handleUpdate = (newValue: ReferenceValueProps | string) => {
|
||||||
onUpdateList(
|
if (Array.isArray(newValue)) {
|
||||||
updateList.map((update, i) => (i === index ? { ...update, value: newValue } : update))
|
onUpdateList(
|
||||||
);
|
updateList.map((update, i) =>
|
||||||
|
i === index ? { ...update, value: newValue } : update
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
onUpdateList(
|
||||||
|
updateList.map((update, i) =>
|
||||||
|
i === index ? { ...update, value: ['', newValue] } : update
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Flex key={index}>
|
<Flex key={index}>
|
||||||
<Container mt={4}>
|
<Container mt={4} w={'full'}>
|
||||||
<Flex alignItems={'center'}>
|
<Flex alignItems={'center'}>
|
||||||
<Flex w={'60px'}>{t('core.workflow.variable')}</Flex>
|
<Flex w={'60px'}>{t('core.workflow.variable')}</Flex>
|
||||||
<Reference
|
<Reference
|
||||||
@@ -139,7 +149,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
|||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex mt={2} w={'full'} alignItems={'center'} className="nodrag">
|
<Flex mt={2} w={'full'} alignItems={'center'} className="nodrag">
|
||||||
<Flex w={'60px'} flex={0}>
|
<Flex w={'60px'}>
|
||||||
<Box>{t('core.workflow.value')}</Box>
|
<Box>{t('core.workflow.value')}</Box>
|
||||||
<MyTooltip
|
<MyTooltip
|
||||||
label={
|
label={
|
||||||
|
Reference in New Issue
Block a user