mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 10:17:00 +00:00
fix: record provider required for read pretty
This commit is contained in:
parent
538a28d0bd
commit
38c3e3e4cc
@ -2,6 +2,7 @@ import { createForm } from '@formily/core';
|
||||
import { useField } from '@formily/react';
|
||||
import { Spin } from 'antd';
|
||||
import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react';
|
||||
import { RecordProvider } from '../record-provider';
|
||||
import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
||||
|
||||
export const FormBlockContext = createContext<any>({});
|
||||
@ -33,7 +34,13 @@ const InternalFormBlockProvider = (props) => {
|
||||
formBlockRef,
|
||||
}}
|
||||
>
|
||||
<div ref={formBlockRef}>{props.children}</div>
|
||||
{readPretty ? (
|
||||
<RecordProvider record={service?.data?.data}>
|
||||
<div ref={formBlockRef}>{props.children}</div>
|
||||
</RecordProvider>
|
||||
) : (
|
||||
<div ref={formBlockRef}>{props.children}</div>
|
||||
)}
|
||||
</FormBlockContext.Provider>
|
||||
);
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ArrayField } from '@formily/core';
|
||||
import { Schema, useField, useFieldSchema } from '@formily/react';
|
||||
import React, { createContext, useContext, useEffect } from 'react';
|
||||
import { useCollection, useCollectionManager } from '../collection-manager';
|
||||
import { useCollectionManager } from '../collection-manager';
|
||||
import { useRecord } from '../record-provider';
|
||||
import { BlockProvider, useBlockRequestContext } from './BlockProvider';
|
||||
import { useFormBlockContext } from './FormBlockProvider';
|
||||
@ -60,7 +60,7 @@ export const TableSelectorProvider = (props) => {
|
||||
if (props.dragSort) {
|
||||
params['sort'] = ['sort'];
|
||||
}
|
||||
if (appends?.length) {
|
||||
if (!Object.keys(params).includes('appends')) {
|
||||
params['appends'] = appends;
|
||||
}
|
||||
if (collectionField) {
|
||||
|
@ -52,6 +52,7 @@ export const ExportActionInitializer = (props) => {
|
||||
exportSettings: [],
|
||||
},
|
||||
'x-designer': 'ExportDesigner',
|
||||
'x-decorator': 'ACLActionProvider',
|
||||
'x-component': 'Action',
|
||||
'x-component-props': {
|
||||
icon: 'clouddownloadoutlined',
|
||||
|
Loading…
Reference in New Issue
Block a user