mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: linkage rules compatibility with legacy data (#6686)
* fix: linkage rules compatibility with legacy data * fix: bug
This commit is contained in:
parent
78fefe197b
commit
38f8cf9d56
@ -20,6 +20,7 @@ import { SubFormProvider } from '../../schema-component/antd/association-field/h
|
||||
import { DynamicComponentProps } from '../../schema-component/antd/filter/DynamicComponent';
|
||||
import { FilterContext } from '../../schema-component/antd/filter/context';
|
||||
import { VariableInput, getShouldChange } from '../VariableInput/VariableInput';
|
||||
import { useCurrentFormContext } from '../VariableInput/hooks/useFormVariable';
|
||||
import { LinkageRuleActionGroup } from './LinkageRuleActionGroup';
|
||||
import { EnableLinkage } from './components/EnableLinkage';
|
||||
import { ArrayCollapse } from './components/LinkageHeader';
|
||||
@ -95,6 +96,7 @@ export const FormLinkageRules = withDynamicSchemaProps(
|
||||
const { name } = useCollection_deprecated();
|
||||
const { getAllCollectionsInheritChain } = useCollectionManager_deprecated();
|
||||
const parentRecordData = useCollectionParentRecordData();
|
||||
const { shouldDisplayCurrentForm } = useCurrentFormContext();
|
||||
const variableKey = getActiveContextName(localVariables);
|
||||
const components = useMemo(() => ({ ArrayCollapse }), []);
|
||||
const schema = useMemo(
|
||||
@ -103,7 +105,7 @@ export const FormLinkageRules = withDynamicSchemaProps(
|
||||
properties: {
|
||||
rules: {
|
||||
type: 'array',
|
||||
default: transformDefaultValue(defaultValues, variableKey),
|
||||
default: transformDefaultValue(defaultValues, shouldDisplayCurrentForm ? variableKey : '$nRecord'),
|
||||
'x-component': 'ArrayCollapse',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component-props': {
|
||||
|
Loading…
x
Reference in New Issue
Block a user