refactor: assocation select file clear linkage (#2885)
This commit is contained in:
parent
d2bf691b69
commit
2dbb095529
@ -1,5 +1,5 @@
|
|||||||
import { LoadingOutlined, PlusOutlined } from '@ant-design/icons';
|
import { LoadingOutlined, PlusOutlined } from '@ant-design/icons';
|
||||||
import { onFieldChange } from '@formily/core';
|
import { onFieldChange, FormPath } 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';
|
||||||
@ -63,8 +63,9 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => {
|
|||||||
form.addEffects(id, () => {
|
form.addEffects(id, () => {
|
||||||
linkageFields?.forEach((v) => {
|
linkageFields?.forEach((v) => {
|
||||||
if (v) {
|
if (v) {
|
||||||
onFieldChange(v, () => {
|
//支持深层次子表单
|
||||||
if (field.value) {
|
onFieldChange('*', (fieldPath: any) => {
|
||||||
|
if (fieldPath.props.name === v && field.value) {
|
||||||
props.onChange(null);
|
props.onChange(null);
|
||||||
setInnerValue(null);
|
setInnerValue(null);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user