mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 20:56:13 +08:00
feat: Arrange the form of generate, categorize, switch, retrieval operators vertically #1739 (#2800)
### What problem does this PR solve? feat: Arrange the form of generate, categorize, switch, retrieval operators vertically #1739 ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe):
This commit is contained in:
parent
cbd7cd7c4d
commit
bfaef2cca6
@ -1,3 +1,9 @@
|
|||||||
.title {
|
.title {
|
||||||
flex-basis: 60px;
|
flex-basis: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.formWrapper {
|
||||||
|
:global(.ant-form-item-label) {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -118,6 +118,7 @@ const FlowDrawer = ({
|
|||||||
mask={false}
|
mask={false}
|
||||||
width={470}
|
width={470}
|
||||||
>
|
>
|
||||||
|
<section className={styles.formWrapper}>
|
||||||
{visible && (
|
{visible && (
|
||||||
<OperatorForm
|
<OperatorForm
|
||||||
onValuesChange={handleValuesChange}
|
onValuesChange={handleValuesChange}
|
||||||
@ -125,6 +126,7 @@ const FlowDrawer = ({
|
|||||||
node={node}
|
node={node}
|
||||||
></OperatorForm>
|
></OperatorForm>
|
||||||
)}
|
)}
|
||||||
|
</section>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -18,12 +18,11 @@ const CategorizeForm = ({ form, onValuesChange, node }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 6 }}
|
|
||||||
wrapperCol={{ span: 18 }}
|
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
onValuesChange={handleValuesChange}
|
onValuesChange={handleValuesChange}
|
||||||
initialValues={{ items: [{}] }}
|
initialValues={{ items: [{}] }}
|
||||||
|
layout={'vertical'}
|
||||||
>
|
>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={'llm_id'}
|
name={'llm_id'}
|
||||||
|
@ -13,11 +13,10 @@ const GenerateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 10 }}
|
|
||||||
wrapperCol={{ span: 14 }}
|
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
|
layout={'vertical'}
|
||||||
>
|
>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={'llm_id'}
|
name={'llm_id'}
|
||||||
|
@ -24,13 +24,12 @@ const RetrievalForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 12 }}
|
|
||||||
wrapperCol={{ span: 12 }}
|
|
||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
onFinishFailed={onFinishFailed}
|
onFinishFailed={onFinishFailed}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
form={form}
|
form={form}
|
||||||
|
layout={'vertical'}
|
||||||
>
|
>
|
||||||
<SimilaritySlider
|
<SimilaritySlider
|
||||||
isTooltipShown
|
isTooltipShown
|
||||||
|
@ -13,14 +13,6 @@ import { useBuildComponentIdSelectOptions } from '../../hooks';
|
|||||||
import { IOperatorForm, ISwitchForm } from '../../interface';
|
import { IOperatorForm, ISwitchForm } from '../../interface';
|
||||||
import { getOtherFieldValues } from '../../utils';
|
import { getOtherFieldValues } from '../../utils';
|
||||||
|
|
||||||
const subLabelCol = {
|
|
||||||
span: 11,
|
|
||||||
};
|
|
||||||
|
|
||||||
const subWrapperCol = {
|
|
||||||
span: 13,
|
|
||||||
};
|
|
||||||
|
|
||||||
const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const buildCategorizeToOptions = useBuildFormSelectOptions(
|
const buildCategorizeToOptions = useBuildFormSelectOptions(
|
||||||
@ -53,13 +45,12 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
labelCol={{ span: 8 }}
|
|
||||||
wrapperCol={{ span: 16 }}
|
|
||||||
form={form}
|
form={form}
|
||||||
name="dynamic_form_complex"
|
name="dynamic_form_complex"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
initialValues={{ conditions: [{}] }}
|
initialValues={{ conditions: [{}] }}
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
|
layout={'vertical'}
|
||||||
>
|
>
|
||||||
<Form.List name="conditions">
|
<Form.List name="conditions">
|
||||||
{(fields, { add, remove }) => (
|
{(fields, { add, remove }) => (
|
||||||
@ -125,8 +116,6 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('flow.componentId')}
|
label={t('flow.componentId')}
|
||||||
name={[subField.name, 'cpn_id']}
|
name={[subField.name, 'cpn_id']}
|
||||||
labelCol={subLabelCol}
|
|
||||||
wrapperCol={subWrapperCol}
|
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
placeholder={t('flow.componentId')}
|
placeholder={t('flow.componentId')}
|
||||||
@ -136,8 +125,6 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('flow.operator')}
|
label={t('flow.operator')}
|
||||||
name={[subField.name, 'operator']}
|
name={[subField.name, 'operator']}
|
||||||
labelCol={subLabelCol}
|
|
||||||
wrapperCol={subWrapperCol}
|
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
placeholder={t('flow.operator')}
|
placeholder={t('flow.operator')}
|
||||||
@ -147,8 +134,6 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('flow.value')}
|
label={t('flow.value')}
|
||||||
name={[subField.name, 'value']}
|
name={[subField.name, 'value']}
|
||||||
labelCol={subLabelCol}
|
|
||||||
wrapperCol={subWrapperCol}
|
|
||||||
>
|
>
|
||||||
<Input placeholder={t('flow.value')} />
|
<Input placeholder={t('flow.value')} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user