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
2272899b
authored
Jun 04, 2026
by
YeYuheng
Committed by
GitHub
Jun 04, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: preserve two-column table workflow inputs (#7051)
parent
9bb91d9b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
packages/global/core/workflow/runtime/utils.ts
+1
-1
packages/global/core/workflow/utils.ts
+14
-2
packages/global/test/core/workflow/runtime/utils.test.ts
+16
-0
No files found.
packages/global/core/workflow/runtime/utils.ts
View file @
2272899b
...
@@ -322,7 +322,7 @@ export const getReferenceVariableValue = ({
...
@@ -322,7 +322,7 @@ export const getReferenceVariableValue = ({
if
(
if
(
Array
.
isArray
(
value
)
&&
Array
.
isArray
(
value
)
&&
value
.
length
>
0
&&
value
.
length
>
0
&&
value
.
every
((
item
)
=>
isValidReferenceValueFormat
(
item
))
value
.
every
((
item
)
=>
isValidReferenceValueFormat
(
item
,
nodesMap
))
)
{
)
{
return
value
return
value
.
map
<
any
>
((
val
)
=>
{
.
map
<
any
>
((
val
)
=>
{
...
...
packages/global/core/workflow/utils.ts
View file @
2272899b
...
@@ -408,8 +408,20 @@ export const formatEditorVariablePickerIcon = (
...
@@ -408,8 +408,20 @@ export const formatEditorVariablePickerIcon = (
};
};
// Check the value is a valid reference value format: [variableId, outputId]
// Check the value is a valid reference value format: [variableId, outputId]
export
const
isValidReferenceValueFormat
=
(
value
:
any
):
value
is
ReferenceItemValueType
=>
{
export
const
isValidReferenceValueFormat
=
(
return
Array
.
isArray
(
value
)
&&
value
.
length
===
2
&&
typeof
value
[
0
]
===
'string'
;
value
:
any
,
nodesMap
?:
Record
<
string
,
Pick
<
StoreNodeItemType
,
'nodeId'
>>
|
Map
<
string
,
Pick
<
StoreNodeItemType
,
'nodeId'
>>
):
value
is
ReferenceItemValueType
=>
{
if
(
!
(
Array
.
isArray
(
value
)
&&
value
.
length
===
2
&&
typeof
value
[
0
]
===
'string'
))
{
return
false
;
}
if
(
!
nodesMap
)
return
true
;
const
sourceNodeId
=
value
[
0
];
if
(
sourceNodeId
===
VARIABLE_NODE_ID
)
return
true
;
return
nodesMap
instanceof
Map
?
nodesMap
.
has
(
sourceNodeId
)
:
!!
nodesMap
[
sourceNodeId
];
};
};
/*
/*
Check whether the value([variableId, outputId]) value is a valid reference value:
Check whether the value([variableId, outputId]) value is a valid reference value:
...
...
packages/global/test/core/workflow/runtime/utils.test.ts
View file @
2272899b
...
@@ -1265,6 +1265,22 @@ describe('getReferenceVariableValue', () => {
...
@@ -1265,6 +1265,22 @@ describe('getReferenceVariableValue', () => {
expect
(
result
).
toBe
(
'plain string'
);
expect
(
result
).
toBe
(
'plain string'
);
});
});
it
(
'should keep two-column table data as a two-dimensional array'
,
()
=>
{
const
tableData
=
[
[
'指标'
,
'金额(元)'
],
[
'资产总额(期末余额)'
,
'22,701,764,055.63'
],
[
'负债总额(期末余额)'
,
'4,809,415,705.17'
]
];
const
result
=
getReferenceVariableValue
({
value
:
tableData
,
nodesMap
:
{},
variables
:
{}
});
expect
(
result
).
toEqual
(
tableData
);
});
it
(
'should handle array with single reference'
,
()
=>
{
it
(
'should handle array with single reference'
,
()
=>
{
const
nodesMap
:
Record
<
string
,
RuntimeNodeItemType
>
=
{
const
nodesMap
:
Record
<
string
,
RuntimeNodeItemType
>
=
{
node1
:
{
node1
:
{
...
...
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