mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-24 07:26:47 +08:00
### What problem does this PR solve? Feat: Add Template operator #3560 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -36,6 +36,7 @@ const DynamicParameters = ({ nodeId }: IProps) => {
|
||||
title: t('key'),
|
||||
dataIndex: 'key',
|
||||
key: 'key',
|
||||
width: '40%',
|
||||
onCell: (record: IGenerateParameter) => ({
|
||||
record,
|
||||
editable: true,
|
||||
@ -49,6 +50,7 @@ const DynamicParameters = ({ nodeId }: IProps) => {
|
||||
dataIndex: 'component_id',
|
||||
key: 'component_id',
|
||||
align: 'center',
|
||||
width: '40%',
|
||||
render(text, record) {
|
||||
return (
|
||||
<Select
|
||||
|
||||
26
web/src/pages/flow/form/template-form/index.tsx
Normal file
26
web/src/pages/flow/form/template-form/index.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { Form, Input } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { IOperatorForm } from '../../interface';
|
||||
import DynamicParameters from '../generate-form/dynamic-parameters';
|
||||
|
||||
const TemplateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Form
|
||||
name="basic"
|
||||
autoComplete="off"
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
layout={'vertical'}
|
||||
>
|
||||
<Form.Item name={['content']} label={t('flow.content')}>
|
||||
<Input.TextArea rows={8} placeholder={t('flow.blank')} />
|
||||
</Form.Item>
|
||||
|
||||
<DynamicParameters nodeId={node?.id}></DynamicParameters>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
export default TemplateForm;
|
||||
Reference in New Issue
Block a user