Commit 1d2c3ad6 authored by littleforest's avatar littleforest

feat: fixed don't get input value

parent 1c138412
...@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment