feat: improve code

This commit is contained in:
chenos 2022-03-11 23:33:22 +08:00
parent 982c7a3038
commit 9036eee80b
4 changed files with 21 additions and 6 deletions

View File

@ -105,6 +105,10 @@ export const AddSubFieldAction = () => {
<Dropdown
overlay={
<Menu
style={{
maxHeight: '60vh',
overflow: 'auto',
}}
onClick={(info) => {
const schema = getSchema(getInterface(info.key));
setSchema(schema);
@ -113,11 +117,13 @@ export const AddSubFieldAction = () => {
>
{options.map((option) => {
return (
<Menu.SubMenu title={compile(option.label)}>
{option.children.map((child) => {
return <Menu.Item key={child.name}>{compile(child.title)}</Menu.Item>;
})}
</Menu.SubMenu>
option.children.length > 0 && (
<Menu.ItemGroup title={compile(option.label)}>
{option.children.map((child) => {
return <Menu.Item key={child.name}>{compile(child.title)}</Menu.Item>;
})}
</Menu.ItemGroup>
)
);
})}
</Menu>

View File

@ -87,7 +87,9 @@ export const dataSource: ISchema = {
'x-decorator': 'FormItem',
'x-component': 'ArrayTable',
'x-component-props': {
pagination: false,
pagination: {
pageSize: 1000,
},
// scroll: { x: '100%' },
},
items: {

View File

@ -61,6 +61,7 @@ const InsertMenuItems = (props) => {
'x-decorator': 'FormItem',
'x-component': 'Input',
title: t('Menu item title'),
required: true,
'x-component-props': {},
// description: `原字段标题:${collectionField?.uiSchema?.title}`,
},
@ -95,6 +96,7 @@ const InsertMenuItems = (props) => {
'x-decorator': 'FormItem',
'x-component': 'Input',
title: t('Menu item title'),
required: true,
'x-component-props': {},
},
icon: {
@ -141,6 +143,7 @@ const InsertMenuItems = (props) => {
properties: {
title: {
title: t('Menu item title'),
required: true,
'x-component': 'Input',
'x-decorator': 'FormItem',
},
@ -210,6 +213,7 @@ export const MenuDesigner = () => {
properties: {
title: {
title: t('Menu item title'),
required: true,
'x-decorator': 'FormItem',
'x-component': 'Input',
'x-component-props': {},

View File

@ -57,6 +57,7 @@ export const GroupItem = itemWrap((props) => {
title: t('Menu item title'),
'x-component': 'Input',
'x-decorator': 'FormItem',
required: true,
},
icon: {
title: t('Icon'),
@ -103,6 +104,7 @@ export const PageMenuItem = itemWrap((props) => {
properties: {
title: {
title: t('Menu item title'),
required: true,
'x-component': 'Input',
'x-decorator': 'FormItem',
},
@ -166,6 +168,7 @@ export const LinkMenuItem = itemWrap((props) => {
properties: {
title: {
title: t('Menu item title'),
required: true,
'x-component': 'Input',
'x-decorator': 'FormItem',
},