Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chatGLM
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘坚-丰林-DEV
chatGLM
Commits
1d2c3ad6
Commit
1d2c3ad6
authored
Apr 15, 2023
by
littleforest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: fixed don't get input value
parent
1c138412
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
index.tsx
src/pages/Chat/index.tsx
+3
-7
No files found.
src/pages/Chat/index.tsx
View file @
1d2c3ad6
...
@@ -57,11 +57,11 @@ const Chat: React.FC = () => {
...
@@ -57,11 +57,11 @@ const Chat: React.FC = () => {
};
};
const
setInput
=
(
value
:
any
)
=>
{
const
setInput
=
(
value
:
any
)
=>
{
setChat
(
value
?.
firstChat
);
form
.
setFieldValue
(
'chatInput'
,
value
?.
firstInput
);
form
.
setFieldValue
(
'chatInput'
,
value
?.
firstInput
);
};
};
const
onChange
=
(
value
:
any
)
=>
{
const
onChange
=
(
value
:
any
)
=>
{
console
.
log
(
value
);
value
?.
chatInput
&&
setChat
(
value
?.
chatInput
);
value
?.
chatInput
&&
setChat
(
value
?.
chatInput
);
value
?.
firstInput
&&
setInput
(
value
);
value
?.
firstInput
&&
setInput
(
value
);
};
};
...
@@ -189,6 +189,7 @@ const Chat: React.FC = () => {
...
@@ -189,6 +189,7 @@ const Chat: React.FC = () => {
onValuesChange=
{
onChange
}
onValuesChange=
{
onChange
}
onFinish=
{
onSend
}
onFinish=
{
onSend
}
>
>
{
console
.
log
(
chat
)
}
{
firstChat
?
(
{
firstChat
?
(
<
NewSession
questionValue=
{
chat
}
/>
<
NewSession
questionValue=
{
chat
}
/>
)
:
(
)
:
(
...
@@ -213,12 +214,7 @@ const Chat: React.FC = () => {
...
@@ -213,12 +214,7 @@ const Chat: React.FC = () => {
<
Col
span=
{
4
}
push=
{
isMobile
?
0
:
4
}
>
<
Col
span=
{
4
}
push=
{
isMobile
?
0
:
4
}
>
<
div
className=
{
styles
.
outputButtonWrapper
}
>
<
div
className=
{
styles
.
outputButtonWrapper
}
>
<
Item
name=
"outputButton"
>
<
Item
name=
"outputButton"
>
<
Button
<
Button
htmlType=
"submit"
type=
"primary"
size=
"large"
>
htmlType=
"submit"
type=
"primary"
size=
"large"
disabled=
{
chat
.
length
===
0
}
>
发送
发送
</
Button
>
</
Button
>
</
Item
>
</
Item
>
...
...
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