mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: field linkage rules not working for subform (popup) in subtable (#6800)
This commit is contained in:
parent
973038a2e9
commit
bd077d5cc2
@ -29,6 +29,7 @@ import { useIsAssociationField } from '../../../../schema-component/antd/form-it
|
||||
import { FormLinkageRules } from '../../../../schema-settings/LinkageRules';
|
||||
import { SchemaSettingsLinkageRules } from '../../../../schema-settings/SchemaSettings';
|
||||
import { SchemaSettingsItemType } from '../../../../application';
|
||||
import { useColumnSchema } from '../../../../schema-component';
|
||||
|
||||
const enabledIndexColumn: SchemaSettingsItemType = {
|
||||
name: 'enableIndexColumn',
|
||||
@ -338,11 +339,12 @@ export const linkageRules = {
|
||||
Component: SchemaSettingsLinkageRules,
|
||||
useComponentProps() {
|
||||
const field = useField();
|
||||
const fieldSchema = useFieldSchema();
|
||||
const schema = useFieldSchema();
|
||||
const { fieldSchema: columnSchema } = useColumnSchema();
|
||||
const fieldSchema = columnSchema || schema;
|
||||
const cm = useCollectionManager();
|
||||
const collectionField = cm.getCollectionField(fieldSchema['x-collection-field']);
|
||||
const { rerenderDataBlock } = useRerenderDataBlock();
|
||||
|
||||
return {
|
||||
collectionName: collectionField?.target,
|
||||
Component: LinkageRulesComponent,
|
||||
|
@ -218,7 +218,6 @@ export const SubTable: any = observer(
|
||||
},
|
||||
};
|
||||
};
|
||||
console.log(props);
|
||||
return (
|
||||
<div className={subTableContainer}>
|
||||
<FlagProvider isInSubTable>
|
||||
|
@ -104,6 +104,7 @@ function getLinkageRules(fieldSchema) {
|
||||
if (!fieldSchema) {
|
||||
return;
|
||||
}
|
||||
const result = fieldSchema['x-linkage-rules'] || fieldSchema?.parent?.['x-linkage-rules'] || [];
|
||||
|
||||
return fieldSchema['x-linkage-rules']?.filter((k) => !k.disabled);
|
||||
return result?.filter((k) => !k.disabled);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user