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
c995bcce
authored
Dec 15, 2024
by
Archer
Committed by
GitHub
Dec 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: input form value type error (#3399)
parent
3deac290
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
packages/global/core/workflow/runtime/utils.ts
+7
-3
packages/service/core/workflow/dispatch/index.ts
+1
-2
packages/web/components/common/Input/NumberInput/index.tsx
+2
-1
No files found.
packages/global/core/workflow/runtime/utils.ts
View file @
c995bcce
...
@@ -284,9 +284,13 @@ export const formatVariableValByType = (val: any, valueType?: WorkflowIOValueTyp
...
@@ -284,9 +284,13 @@ export const formatVariableValByType = (val: any, valueType?: WorkflowIOValueTyp
if
(
!
valueType
)
return
val
;
if
(
!
valueType
)
return
val
;
// Value type check, If valueType invalid, return undefined
// Value type check, If valueType invalid, return undefined
if
(
valueType
.
startsWith
(
'array'
)
&&
!
Array
.
isArray
(
val
))
return
undefined
;
if
(
valueType
.
startsWith
(
'array'
)
&&
!
Array
.
isArray
(
val
))
return
undefined
;
if
(
valueType
===
WorkflowIOValueTypeEnum
.
boolean
&&
typeof
val
!==
'boolean'
)
return
undefined
;
if
(
valueType
===
WorkflowIOValueTypeEnum
.
boolean
)
return
Boolean
(
val
);
if
(
valueType
===
WorkflowIOValueTypeEnum
.
number
&&
typeof
val
!==
'number'
)
return
undefined
;
if
(
valueType
===
WorkflowIOValueTypeEnum
.
number
)
return
Number
(
val
);
if
(
valueType
===
WorkflowIOValueTypeEnum
.
string
&&
typeof
val
!==
'string'
)
return
undefined
;
if
(
valueType
===
WorkflowIOValueTypeEnum
.
string
)
{
if
(
val
===
undefined
)
return
'undefined'
;
if
(
val
===
null
)
return
'null'
;
return
typeof
val
===
'object'
?
JSON
.
stringify
(
val
)
:
String
(
val
);
}
if
(
if
(
[
[
WorkflowIOValueTypeEnum
.
object
,
WorkflowIOValueTypeEnum
.
object
,
...
...
packages/service/core/workflow/dispatch/index.ts
View file @
c995bcce
...
@@ -73,7 +73,6 @@ import { dispatchLoopEnd } from './loop/runLoopEnd';
...
@@ -73,7 +73,6 @@ import { dispatchLoopEnd } from './loop/runLoopEnd';
import
{
dispatchLoopStart
}
from
'./loop/runLoopStart'
;
import
{
dispatchLoopStart
}
from
'./loop/runLoopStart'
;
import
{
dispatchFormInput
}
from
'./interactive/formInput'
;
import
{
dispatchFormInput
}
from
'./interactive/formInput'
;
import
{
dispatchToolParams
}
from
'./agent/runTool/toolParams'
;
import
{
dispatchToolParams
}
from
'./agent/runTool/toolParams'
;
import
{
AppChatConfigType
}
from
'@fastgpt/global/core/app/type'
;
const
callbackMap
:
Record
<
FlowNodeTypeEnum
,
Function
>
=
{
const
callbackMap
:
Record
<
FlowNodeTypeEnum
,
Function
>
=
{
[
FlowNodeTypeEnum
.
workflowStart
]:
dispatchWorkflowStart
,
[
FlowNodeTypeEnum
.
workflowStart
]:
dispatchWorkflowStart
,
...
@@ -635,7 +634,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
...
@@ -635,7 +634,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
const
entryNodes
=
runtimeNodes
.
filter
((
item
)
=>
item
.
isEntry
);
const
entryNodes
=
runtimeNodes
.
filter
((
item
)
=>
item
.
isEntry
);
// reset entry
// reset entry
runtimeNodes
.
forEach
((
item
)
=>
{
runtimeNodes
.
forEach
((
item
)
=>
{
// Interactive
node is not the entry node, return interactive result
// Interactive
ly nodes will use the "isEntry", which does not need to be updated
if
(
if
(
item
.
flowNodeType
!==
FlowNodeTypeEnum
.
userSelect
&&
item
.
flowNodeType
!==
FlowNodeTypeEnum
.
userSelect
&&
item
.
flowNodeType
!==
FlowNodeTypeEnum
.
formInput
&&
item
.
flowNodeType
!==
FlowNodeTypeEnum
.
formInput
&&
...
...
packages/web/components/common/Input/NumberInput/index.tsx
View file @
c995bcce
...
@@ -41,7 +41,8 @@ const MyNumberInput = (props: Props) => {
...
@@ -41,7 +41,8 @@ const MyNumberInput = (props: Props) => {
?
register
(
name
,
{
?
register
(
name
,
{
required
:
props
.
isRequired
,
required
:
props
.
isRequired
,
min
:
props
.
min
,
min
:
props
.
min
,
max
:
props
.
max
max
:
props
.
max
,
valueAsNumber
:
true
})
})
:
{})}
:
{})}
/>
/>
...
...
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