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
c5371ae8
authored
Mar 31, 2026
by
gaga0714
Committed by
GitHub
Mar 31, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: deal with undefined valueType (#6684)
* fix: deal with undefined valueType * fix * fix * fix key
parent
b8846313
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
9 deletions
+20
-9
packages/global/core/workflow/node/constant.ts
+10
-0
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/DynamicInputs/index.tsx
+2
-2
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderOutput/DynamicOutputs.tsx
+6
-4
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/ValueTypeLabel.tsx
+2
-3
No files found.
packages/global/core/workflow/node/constant.ts
View file @
c5371ae8
...
@@ -232,6 +232,16 @@ export const FlowValueTypeMap: Record<
...
@@ -232,6 +232,16 @@ export const FlowValueTypeMap: Record<
}
}
};
};
export
const
getFlowValueTypeMeta
=
(
valueType
?:
WorkflowIOValueTypeEnum
|
string
|
null
):
(
typeof
FlowValueTypeMap
)[
WorkflowIOValueTypeEnum
]
=>
{
if
(
valueType
==
null
||
valueType
===
''
)
{
return
FlowValueTypeMap
[
WorkflowIOValueTypeEnum
.
any
];
}
const
meta
=
FlowValueTypeMap
[
valueType
as
WorkflowIOValueTypeEnum
];
return
meta
??
FlowValueTypeMap
[
WorkflowIOValueTypeEnum
.
any
];
};
export
const
EDGE_TYPE
=
'default'
;
export
const
EDGE_TYPE
=
'default'
;
export
const
chatHistoryValueDesc
=
`{
export
const
chatHistoryValueDesc
=
`{
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/DynamicInputs/index.tsx
View file @
c5371ae8
...
@@ -14,7 +14,7 @@ import MyIconButton from '@fastgpt/web/components/common/Icon/button';
...
@@ -14,7 +14,7 @@ import MyIconButton from '@fastgpt/web/components/common/Icon/button';
import
{
useToast
}
from
'@fastgpt/web/hooks/useToast'
;
import
{
useToast
}
from
'@fastgpt/web/hooks/useToast'
;
import
{
import
{
FlowNodeInputTypeEnum
,
FlowNodeInputTypeEnum
,
FlowValueTypeMap
getFlowValueTypeMeta
}
from
'@fastgpt/global/core/workflow/node/constant'
;
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
useMemoEnhance
}
from
'@fastgpt/web/hooks/useMemoEnhance'
;
import
{
useMemoEnhance
}
from
'@fastgpt/web/hooks/useMemoEnhance'
;
...
@@ -255,7 +255,7 @@ const Reference = ({
...
@@ -255,7 +255,7 @@ const Reference = ({
fontSize=
{
'sm'
}
fontSize=
{
'sm'
}
fontWeight=
{
'medium'
}
fontWeight=
{
'medium'
}
>
>
{
t
(
FlowValueTypeMap
[
inputChildren
.
valueType
||
WorkflowIOValueTypeEnum
.
any
]
.
label
)
}
{
t
(
getFlowValueTypeMeta
(
inputChildren
.
valueType
)
.
label
)
}
</
Flex
>
</
Flex
>
</
Flex
>
</
Flex
>
{
!
isEmptyItem
&&
(
{
!
isEmptyItem
&&
(
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderOutput/DynamicOutputs.tsx
View file @
c5371ae8
...
@@ -3,7 +3,7 @@ import type { FlowNodeOutputItemType } from '@fastgpt/global/core/workflow/type/
...
@@ -3,7 +3,7 @@ import type { FlowNodeOutputItemType } from '@fastgpt/global/core/workflow/type/
import
{
Box
,
Flex
,
Input
,
HStack
}
from
'@chakra-ui/react'
;
import
{
Box
,
Flex
,
Input
,
HStack
}
from
'@chakra-ui/react'
;
import
{
import
{
FlowNodeOutputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowValueTypeMap
getFlowValueTypeMeta
}
from
'@fastgpt/global/core/workflow/node/constant'
;
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useTranslation
}
from
'next-i18next'
;
...
@@ -90,7 +90,7 @@ const DynamicOutputs = ({ nodeId, outputs, addOutput }: DynamicOutputsProps) =>
...
@@ -90,7 +90,7 @@ const DynamicOutputs = ({ nodeId, outputs, addOutput }: DynamicOutputsProps) =>
{
outputs
.
length
>
0
&&
<
Box
w=
{
6
}
/>
}
{
outputs
.
length
>
0
&&
<
Box
w=
{
6
}
/>
}
</
Flex
>
</
Flex
>
{
[...
outputs
,
defaultOutput
].
map
((
output
,
index
)
=>
(
{
[...
outputs
,
defaultOutput
].
map
((
output
,
index
)
=>
(
<
Box
key=
{
output
.
key
}
_notLast=
{
{
mb
:
1.5
}
}
>
<
Box
key=
{
output
.
key
||
index
}
_notLast=
{
{
mb
:
1.5
}
}
>
<
DynamicOutputItem
<
DynamicOutputItem
output=
{
output
}
output=
{
output
}
outputs=
{
outputs
}
outputs=
{
outputs
}
...
@@ -135,7 +135,7 @@ const DynamicOutputItem = ({
...
@@ -135,7 +135,7 @@ const DynamicOutputItem = ({
type
!==
WorkflowIOValueTypeEnum
.
selectApp
&&
type
!==
WorkflowIOValueTypeEnum
.
dynamic
type
!==
WorkflowIOValueTypeEnum
.
selectApp
&&
type
!==
WorkflowIOValueTypeEnum
.
dynamic
)
)
.
map
((
item
)
=>
({
.
map
((
item
)
=>
({
label
:
t
(
FlowValueTypeMap
[
item
]
.
label
),
label
:
t
(
getFlowValueTypeMeta
(
item
)
.
label
),
value
:
item
value
:
item
}));
}));
},
[
t
]);
},
[
t
]);
...
@@ -178,6 +178,8 @@ const DynamicOutputItem = ({
...
@@ -178,6 +178,8 @@ const DynamicOutputItem = ({
[
output
,
onUpdate
,
onAdd
,
isEmptyItem
,
outputs
]
[
output
,
onUpdate
,
onAdd
,
isEmptyItem
,
outputs
]
);
);
const
selectValueType
=
getFlowValueTypeMeta
(
output
?.
valueType
).
value
;
return
(
return
(
<
Flex
alignItems=
{
'center'
}
mb=
{
1
}
gap=
{
2
}
>
<
Flex
alignItems=
{
'center'
}
mb=
{
1
}
gap=
{
2
}
>
<
Flex
flex=
{
'1'
}
bg=
{
'white'
}
rounded=
{
'md'
}
>
<
Flex
flex=
{
'1'
}
bg=
{
'white'
}
rounded=
{
'md'
}
>
...
@@ -198,7 +200,7 @@ const DynamicOutputItem = ({
...
@@ -198,7 +200,7 @@ const DynamicOutputItem = ({
h=
{
10
}
h=
{
10
}
borderLeftRadius=
{
'none'
}
borderLeftRadius=
{
'none'
}
borderColor=
{
'myGray.200'
}
borderColor=
{
'myGray.200'
}
value=
{
output
?.
v
alueType
}
value=
{
selectV
alueType
}
list=
{
valueTypeList
}
list=
{
valueTypeList
}
onChange=
{
onChangeValueType
}
onChange=
{
onChangeValueType
}
isDisabled=
{
isEmptyItem
}
isDisabled=
{
isEmptyItem
}
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/ValueTypeLabel.tsx
View file @
c5371ae8
import
{
FlowValueTypeMap
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
getFlowValueTypeMeta
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
type
{
BoxProps
}
from
'@chakra-ui/react'
;
import
type
{
BoxProps
}
from
'@chakra-ui/react'
;
import
{
Box
}
from
'@chakra-ui/react'
;
import
{
Box
}
from
'@chakra-ui/react'
;
import
type
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
type
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
...
@@ -14,9 +14,8 @@ const ValueTypeLabel = ({
...
@@ -14,9 +14,8 @@ const ValueTypeLabel = ({
valueType
?:
WorkflowIOValueTypeEnum
;
valueType
?:
WorkflowIOValueTypeEnum
;
valueDesc
?:
string
;
valueDesc
?:
string
;
}
&
BoxProps
)
=>
{
}
&
BoxProps
)
=>
{
const
valueTypeData
=
valueType
?
FlowValueTypeMap
[
valueType
]
:
undefined
;
const
{
t
}
=
useTranslation
();
const
{
t
}
=
useTranslation
();
const
label
=
valueType
Data
?.
label
||
''
;
const
label
=
valueType
?
getFlowValueTypeMeta
(
valueType
).
label
:
''
;
return
!!
label
?
(
return
!!
label
?
(
<
MyTooltip
label=
{
valueDesc
}
>
<
MyTooltip
label=
{
valueDesc
}
>
...
...
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