feat: configure fields style fix (#1322)
This commit is contained in:
parent
8943dabc4d
commit
ebc103c8ff
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { SchemaInitializer } from '../SchemaInitializer';
|
import { SchemaInitializer } from '../SchemaInitializer';
|
||||||
import { gridRowColWrap, useCustomFormItemInitializerFields,useInheritsFormItemInitializerFields } from '../utils';
|
import { gridRowColWrap, useCustomFormItemInitializerFields, useInheritsFormItemInitializerFields } from '../utils';
|
||||||
import { useCompile } from '../../schema-component';
|
import { useCompile } from '../../schema-component';
|
||||||
|
|
||||||
// 表单里配置字段
|
// 表单里配置字段
|
||||||
@ -10,25 +10,26 @@ export const CustomFormItemInitializers = (props: any) => {
|
|||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
const { insertPosition, component } = props;
|
const { insertPosition, component } = props;
|
||||||
const inheritFields = useInheritsFormItemInitializerFields();
|
const inheritFields = useInheritsFormItemInitializerFields();
|
||||||
const fieldItems:any[]=[
|
const fieldItems: any[] = [
|
||||||
{
|
{
|
||||||
type: 'itemGroup',
|
type: 'itemGroup',
|
||||||
title: t('Configure fields'),
|
title: t('Configure fields'),
|
||||||
children: useCustomFormItemInitializerFields(),
|
children: useCustomFormItemInitializerFields(),
|
||||||
},
|
},
|
||||||
]
|
];
|
||||||
if (inheritFields?.length > 0) {
|
if (inheritFields?.length > 0) {
|
||||||
inheritFields.forEach((inherit) => {
|
inheritFields.forEach((inherit) => {
|
||||||
fieldItems.push(
|
Object.values(inherit)[0].length &&
|
||||||
{
|
fieldItems.push(
|
||||||
type: 'divider',
|
{
|
||||||
},
|
type: 'divider',
|
||||||
{
|
},
|
||||||
type: 'itemGroup',
|
{
|
||||||
title: t(`Parent collection fields`) + '(' + compile(`${Object.keys(inherit)[0]}`) + ')',
|
type: 'itemGroup',
|
||||||
children: Object.values(inherit)[0],
|
title: t(`Parent collection fields`) + '(' + compile(`${Object.keys(inherit)[0]}`) + ')',
|
||||||
},
|
children: Object.values(inherit)[0],
|
||||||
);
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
@ -20,7 +20,7 @@ export const ReadPrettyFormItemInitializers = (props: any) => {
|
|||||||
];
|
];
|
||||||
if (inheritFields?.length > 0) {
|
if (inheritFields?.length > 0) {
|
||||||
inheritFields.forEach((inherit) => {
|
inheritFields.forEach((inherit) => {
|
||||||
fieldItems.push(
|
Object.values(inherit)[0]?.length&&fieldItems.push(
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user