Feat: Solved the problem that BeginForm would get stuck when modifying data #3221 (#8080)

### What problem does this PR solve?

Feat: Solved the problem that BeginForm would get stuck when modifying
data #3221
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-05 15:12:21 +08:00
committed by GitHub
parent ee52000870
commit 7c7359a9b2
3 changed files with 17 additions and 22 deletions

View File

@ -39,15 +39,9 @@ const BeginForm = ({ node }: INextOperatorForm) => {
const FormSchema = z.object({
enablePrologue: z.boolean().optional(),
prologue: z
.string()
.min(1, {
message: t('common.namePlaceholder'),
})
.trim()
.optional(),
prologue: z.string().trim().optional(),
mode: z.string(),
query: z
inputs: z
.array(
z.object({
key: z.string(),
@ -68,7 +62,7 @@ const BeginForm = ({ node }: INextOperatorForm) => {
useWatchFormChange(node?.id, form);
const query = useWatch({ control: form.control, name: 'query' });
const inputs = useWatch({ control: form.control, name: 'inputs' });
const mode = useWatch({ control: form.control, name: 'mode' });
const enablePrologue = useWatch({
@ -160,7 +154,7 @@ const BeginForm = ({ node }: INextOperatorForm) => {
{/* Create a hidden field to make Form instance record this */}
<FormField
control={form.control}
name={'query'}
name={'inputs'}
render={() => <div></div>}
/>
<Collapse
@ -183,7 +177,7 @@ const BeginForm = ({ node }: INextOperatorForm) => {
}
>
<QueryTable
data={query}
data={inputs}
showModal={showModal}
deleteRecord={handleDeleteRecord}
></QueryTable>