mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
fix: query selector set sys value problem
This commit is contained in:
@ -88,7 +88,7 @@ const VarReferencePicker: FC<Props> = ({
|
|||||||
|
|
||||||
return getNodeInfoById(availableNodes, outputVarNodeId)?.data
|
return getNodeInfoById(availableNodes, outputVarNodeId)?.data
|
||||||
})()
|
})()
|
||||||
const varName = hasValue ? value[value.length - 1] : ''
|
const varName = hasValue ? `${isSystemVar(value as ValueSelector) ? 'sys.' : ''}${value[value.length - 1]}` : ''
|
||||||
|
|
||||||
const getVarType = () => {
|
const getVarType = () => {
|
||||||
if (isConstant)
|
if (isConstant)
|
||||||
|
|||||||
@ -76,7 +76,12 @@ const Item: FC<ItemProps> = ({
|
|||||||
}, [isHovering])
|
}, [isHovering])
|
||||||
const handleChosen = (e: React.MouseEvent) => {
|
const handleChosen = (e: React.MouseEvent) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
onChange([nodeId, ...objPath, itemData.variable], itemData)
|
if (itemData.variable.startsWith('sys.')) { // system variable
|
||||||
|
onChange([...objPath, ...itemData.variable.split('.')], itemData)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
onChange([nodeId, ...objPath, itemData.variable], itemData)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<PortalToFollowElem
|
<PortalToFollowElem
|
||||||
|
|||||||
Reference in New Issue
Block a user