Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
5bb9c550
authored
May 06, 2024
by
heheer
Committed by
GitHub
May 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: add judge to update variable node input (#1369)
parent
db1c27cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
projects/app/src/components/core/workflow/Flow/nodes/NodeVariableUpdate.tsx
+16
-6
No files found.
projects/app/src/components/core/workflow/Flow/nodes/NodeVariableUpdate.tsx
View file @
5bb9c550
...
...
@@ -95,14 +95,24 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
})();
const
renderTypeData
=
menuList
.
find
((
item
)
=>
item
.
renderType
===
updateItem
.
renderType
);
const
handleUpdate
=
(
newValue
:
any
)
=>
{
onUpdateList
(
updateList
.
map
((
update
,
i
)
=>
(
i
===
index
?
{
...
update
,
value
:
newValue
}
:
update
))
);
const
handleUpdate
=
(
newValue
:
ReferenceValueProps
|
string
)
=>
{
if
(
Array
.
isArray
(
newValue
))
{
onUpdateList
(
updateList
.
map
((
update
,
i
)
=>
i
===
index
?
{
...
update
,
value
:
newValue
}
:
update
)
);
}
else
{
onUpdateList
(
updateList
.
map
((
update
,
i
)
=>
i
===
index
?
{
...
update
,
value
:
[
''
,
newValue
]
}
:
update
)
);
}
};
return
(
<
Flex
key=
{
index
}
>
<
Container
mt=
{
4
}
>
<
Container
mt=
{
4
}
w=
{
'full'
}
>
<
Flex
alignItems=
{
'center'
}
>
<
Flex
w=
{
'60px'
}
>
{
t
(
'core.workflow.variable'
)
}
</
Flex
>
<
Reference
...
...
@@ -139,7 +149,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
)
}
</
Flex
>
<
Flex
mt=
{
2
}
w=
{
'full'
}
alignItems=
{
'center'
}
className=
"nodrag"
>
<
Flex
w=
{
'60px'
}
flex=
{
0
}
>
<
Flex
w=
{
'60px'
}
>
<
Box
>
{
t
(
'core.workflow.value'
)
}
</
Box
>
<
MyTooltip
label=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment