feat: improve code
This commit is contained in:
parent
982c7a3038
commit
9036eee80b
@ -105,6 +105,10 @@ export const AddSubFieldAction = () => {
|
|||||||
<Dropdown
|
<Dropdown
|
||||||
overlay={
|
overlay={
|
||||||
<Menu
|
<Menu
|
||||||
|
style={{
|
||||||
|
maxHeight: '60vh',
|
||||||
|
overflow: 'auto',
|
||||||
|
}}
|
||||||
onClick={(info) => {
|
onClick={(info) => {
|
||||||
const schema = getSchema(getInterface(info.key));
|
const schema = getSchema(getInterface(info.key));
|
||||||
setSchema(schema);
|
setSchema(schema);
|
||||||
@ -113,11 +117,13 @@ export const AddSubFieldAction = () => {
|
|||||||
>
|
>
|
||||||
{options.map((option) => {
|
{options.map((option) => {
|
||||||
return (
|
return (
|
||||||
<Menu.SubMenu title={compile(option.label)}>
|
option.children.length > 0 && (
|
||||||
|
<Menu.ItemGroup title={compile(option.label)}>
|
||||||
{option.children.map((child) => {
|
{option.children.map((child) => {
|
||||||
return <Menu.Item key={child.name}>{compile(child.title)}</Menu.Item>;
|
return <Menu.Item key={child.name}>{compile(child.title)}</Menu.Item>;
|
||||||
})}
|
})}
|
||||||
</Menu.SubMenu>
|
</Menu.ItemGroup>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</Menu>
|
</Menu>
|
||||||
|
@ -87,7 +87,9 @@ export const dataSource: ISchema = {
|
|||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'ArrayTable',
|
'x-component': 'ArrayTable',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
pagination: false,
|
pagination: {
|
||||||
|
pageSize: 1000,
|
||||||
|
},
|
||||||
// scroll: { x: '100%' },
|
// scroll: { x: '100%' },
|
||||||
},
|
},
|
||||||
items: {
|
items: {
|
||||||
|
@ -61,6 +61,7 @@ const InsertMenuItems = (props) => {
|
|||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
title: t('Menu item title'),
|
title: t('Menu item title'),
|
||||||
|
required: true,
|
||||||
'x-component-props': {},
|
'x-component-props': {},
|
||||||
// description: `原字段标题:${collectionField?.uiSchema?.title}`,
|
// description: `原字段标题:${collectionField?.uiSchema?.title}`,
|
||||||
},
|
},
|
||||||
@ -95,6 +96,7 @@ const InsertMenuItems = (props) => {
|
|||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
title: t('Menu item title'),
|
title: t('Menu item title'),
|
||||||
|
required: true,
|
||||||
'x-component-props': {},
|
'x-component-props': {},
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
@ -141,6 +143,7 @@ const InsertMenuItems = (props) => {
|
|||||||
properties: {
|
properties: {
|
||||||
title: {
|
title: {
|
||||||
title: t('Menu item title'),
|
title: t('Menu item title'),
|
||||||
|
required: true,
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
},
|
},
|
||||||
@ -210,6 +213,7 @@ export const MenuDesigner = () => {
|
|||||||
properties: {
|
properties: {
|
||||||
title: {
|
title: {
|
||||||
title: t('Menu item title'),
|
title: t('Menu item title'),
|
||||||
|
required: true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
'x-component-props': {},
|
'x-component-props': {},
|
||||||
|
@ -57,6 +57,7 @@ export const GroupItem = itemWrap((props) => {
|
|||||||
title: t('Menu item title'),
|
title: t('Menu item title'),
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
title: t('Icon'),
|
title: t('Icon'),
|
||||||
@ -103,6 +104,7 @@ export const PageMenuItem = itemWrap((props) => {
|
|||||||
properties: {
|
properties: {
|
||||||
title: {
|
title: {
|
||||||
title: t('Menu item title'),
|
title: t('Menu item title'),
|
||||||
|
required: true,
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
},
|
},
|
||||||
@ -166,6 +168,7 @@ export const LinkMenuItem = itemWrap((props) => {
|
|||||||
properties: {
|
properties: {
|
||||||
title: {
|
title: {
|
||||||
title: t('Menu item title'),
|
title: t('Menu item title'),
|
||||||
|
required: true,
|
||||||
'x-component': 'Input',
|
'x-component': 'Input',
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user