Feat: Downstream operators can get the variables defined by the user input operator #3221 (#9036)

### 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:
balibabu
2025-07-24 19:51:08 +08:00
committed by GitHub
parent 5c6e586251
commit 6529bb433b
8 changed files with 81 additions and 11 deletions

View File

@ -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>
);
}