mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:47:10 +00:00
refactor: code improve
This commit is contained in:
parent
18ccd6e7e2
commit
86b2046a68
@ -20,9 +20,8 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => {
|
||||
const field: any = useField();
|
||||
const fieldSchema = useFieldSchema();
|
||||
const [visibleAddNewer, setVisibleAddNewer] = useState(false);
|
||||
const { getField } = useCollection();
|
||||
const { getCollectionJoinField } = useCollectionManager();
|
||||
const collectionField = getField(field.props.name) || getCollectionJoinField(fieldSchema?.['x-collection-field']);
|
||||
const collectionField = getCollectionJoinField(fieldSchema?.['x-collection-field']);
|
||||
const service = useServiceOptions(props);
|
||||
const isFilterForm = fieldSchema['x-designer'] === 'FormItem.FilterFormDesigner';
|
||||
const isAllowAddNew = fieldSchema['x-add-new'];
|
||||
|
@ -32,8 +32,7 @@ export const ReadPrettyInternalViewer: React.FC = observer((props: any) => {
|
||||
const fieldNames = useFieldNames(props);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const insertViewer = useInsertSchema('Viewer');
|
||||
const { getField } = useCollection();
|
||||
const collectionField = getField(fieldSchema.name) || getCollectionJoinField(fieldSchema?.['x-collection-field']);
|
||||
const collectionField = getCollectionJoinField(fieldSchema?.['x-collection-field']);
|
||||
const [record, setRecord] = useState({});
|
||||
const compile = useCompile();
|
||||
const labelUiSchema = useLabelUiSchema(collectionField, fieldNames?.label || 'label');
|
||||
|
Loading…
Reference in New Issue
Block a user