fix: style condition on subtable column fields not applied correctly (#7083)

* fix: style condition on subtable column fields not applied correctly

* fix: bug
This commit is contained in:
Katherine 2025-06-17 21:51:04 +08:00 committed by GitHub
parent b3fb423d5e
commit e030c4b680
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -515,6 +515,7 @@ const InternalBodyCellComponent = (props) => {
const displayNone = { display: 'none' };
const BodyCellComponent = ({ columnHidden, ...props }) => {
const { designable } = useDesignable();
const collection = useCollection();
if (columnHidden) {
return (
@ -524,7 +525,11 @@ const BodyCellComponent = ({ columnHidden, ...props }) => {
);
}
return <InternalBodyCellComponent {...props} />;
return (
<SubFormProvider value={{ value: props?.record, collection, fieldSchema: props.schema }}>
<InternalBodyCellComponent {...props} />{' '}
</SubFormProvider>
);
};
interface TableProps {

View File

@ -34,7 +34,8 @@ export function useSatisfiedActionValues({
const variables = useVariables();
const localVariables = useLocalVariables({ currentForm: { values: formValues } as any });
const localSchema = schema ?? fieldSchema;
const styleRules = rules ?? localSchema[LinkageRuleDataKeyMap[category]];
const styleRules =
rules ?? (localSchema[LinkageRuleDataKeyMap[category]] || localSchema?.parent[LinkageRuleDataKeyMap[category]]);
const app = useApp();
const compute = useCallback(() => {
@ -65,7 +66,7 @@ export function useSatisfiedActionValues({
form.removeEffects(id);
};
}
}, [form, compute]);
}, [form, compute, formValues]);
return { valueMap };
}