mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-21 21:36:42 +08:00
### What problem does this PR solve? Feat: Downstream operators can get the variables defined by the user input operator #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -17,10 +17,11 @@ import { memo } from 'react';
|
||||
import { useForm, useWatch } from 'react-hook-form';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { z } from 'zod';
|
||||
import { INextOperatorForm } from '../../interface';
|
||||
import { BeginQuery, INextOperatorForm } from '../../interface';
|
||||
import { ParameterDialog } from '../begin-form/parameter-dialog';
|
||||
import { QueryTable } from '../begin-form/query-table';
|
||||
import { useEditQueryRecord } from '../begin-form/use-edit-query';
|
||||
import { Output } from '../components/output';
|
||||
import { useValues } from './use-values';
|
||||
import { useWatchFormChange } from './use-watch-change';
|
||||
|
||||
@ -53,7 +54,15 @@ function UserFillUpForm({ node }: INextOperatorForm) {
|
||||
|
||||
useWatchFormChange(node?.id, form);
|
||||
|
||||
const inputs = useWatch({ control: form.control, name: 'inputs' });
|
||||
const inputs: BeginQuery[] = useWatch({
|
||||
control: form.control,
|
||||
name: 'inputs',
|
||||
});
|
||||
|
||||
const outputList = inputs?.map((item) => ({
|
||||
title: item.name,
|
||||
type: item.type,
|
||||
}));
|
||||
|
||||
const {
|
||||
ok,
|
||||
@ -149,6 +158,7 @@ function UserFillUpForm({ node }: INextOperatorForm) {
|
||||
></ParameterDialog>
|
||||
)}
|
||||
</Form>
|
||||
<Output list={outputList}></Output>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user