mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
feat: fetch flow (#1068)
### What problem does this PR solve? feat: fetch flow #918 feat: save graph ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { IModalProps } from '@/interfaces/common';
|
||||
import { Drawer } from 'antd';
|
||||
import { Drawer, Form } from 'antd';
|
||||
import { useEffect } from 'react';
|
||||
import { Node } from 'reactflow';
|
||||
import AnswerForm from '../answer-form';
|
||||
import BeginForm from '../begin-form';
|
||||
@ -26,8 +27,16 @@ const FlowDrawer = ({
|
||||
}: IModalProps<any> & IProps) => {
|
||||
const operatorName: Operator = node?.data.label;
|
||||
const OperatorForm = FormMap[operatorName];
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const { handleValuesChange } = useHandleFormValuesChange(node?.id);
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
form.setFieldsValue(node?.data?.form);
|
||||
}
|
||||
}, [visible, form, node?.data?.form]);
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
title={node?.data.label}
|
||||
@ -39,7 +48,10 @@ const FlowDrawer = ({
|
||||
width={470}
|
||||
>
|
||||
{visible && (
|
||||
<OperatorForm onValuesChange={handleValuesChange}></OperatorForm>
|
||||
<OperatorForm
|
||||
onValuesChange={handleValuesChange}
|
||||
form={form}
|
||||
></OperatorForm>
|
||||
)}
|
||||
</Drawer>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user