fix: association select report Maximum call stack size exceeded in sub-table (#4278)

This commit is contained in:
katherinehhh 2024-05-07 21:03:10 +08:00 committed by GitHub
parent 0f6c2ab8c8
commit 61ac914772
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,7 @@
*/ */
import { LoadingOutlined, PlusOutlined } from '@ant-design/icons'; import { LoadingOutlined, PlusOutlined } from '@ant-design/icons';
import { onFieldChange } from '@formily/core'; import { onFieldInputValueChange } from '@formily/core';
import { RecursionField, connect, mapProps, observer, useField, useFieldSchema, useForm } from '@formily/react'; import { RecursionField, connect, mapProps, observer, useField, useFieldSchema, useForm } from '@formily/react';
import { uid } from '@formily/shared'; import { uid } from '@formily/shared';
import { Space, message } from 'antd'; import { Space, message } from 'antd';
@ -77,7 +77,7 @@ const InternalAssociationSelect = observer(
const id = uid(); const id = uid();
form.addEffects(id, () => { form.addEffects(id, () => {
//支持深层次子表单 //支持深层次子表单
onFieldChange('*', (fieldPath: any) => { onFieldInputValueChange('*', (fieldPath: any) => {
const linkageFields = filterAnalyses(field.componentProps?.service?.params?.filter) || []; const linkageFields = filterAnalyses(field.componentProps?.service?.params?.filter) || [];
if (linkageFields.includes(fieldPath?.props?.name) && field.value) { if (linkageFields.includes(fieldPath?.props?.name) && field.value) {
field.setValue(field.initialValue); field.setValue(field.initialValue);