fix: useRecord (#2911)
This commit is contained in:
parent
d492471ed5
commit
101e1f8f97
@ -43,7 +43,6 @@ const InternalFormBlockProvider = (props) => {
|
||||
if (service.loading && Object.keys(form?.initialValues)?.length === 0 && action) {
|
||||
return <Spin />;
|
||||
}
|
||||
|
||||
let content = (
|
||||
<div ref={formBlockRef}>
|
||||
<RenderChildrenWithDataTemplates form={form} />
|
||||
@ -97,7 +96,6 @@ export const FormBlockProvider = (props) => {
|
||||
if (isDetailBlock) {
|
||||
detailFlag = true;
|
||||
if (!designable && __collection) {
|
||||
console.log(__collection === collection);
|
||||
detailFlag = __collection === collection;
|
||||
}
|
||||
}
|
||||
@ -127,7 +125,7 @@ export const useFormBlockProps = () => {
|
||||
if (addChild) {
|
||||
ctx.form?.query('parent').take((field) => {
|
||||
field.disabled = true;
|
||||
field.value = new Proxy({ ...record }, {});
|
||||
field.value = new Proxy({ ...record?.__parent }, {});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -205,8 +205,8 @@ export const useCreateActionProps = () => {
|
||||
// const values = omitBy(formValues, (value) => isEqual(JSON.stringify(value), '[{}]'));
|
||||
if (addChild) {
|
||||
const treeParentField = getTreeParentField();
|
||||
values[treeParentField?.name ?? 'parent'] = currentRecord;
|
||||
values[treeParentField?.foreignKey ?? 'parentId'] = currentRecord.id;
|
||||
values[treeParentField?.name ?? 'parent'] = currentRecord?.__parent;
|
||||
values[treeParentField?.foreignKey ?? 'parentId'] = currentRecord?.__parent?.id;
|
||||
}
|
||||
actionField.data = field.data || {};
|
||||
actionField.data.loading = true;
|
||||
|
Loading…
Reference in New Issue
Block a user