From 9036eee80be75809408892cae4a53fb1abe4c292 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 11 Mar 2022 23:33:22 +0800 Subject: [PATCH] feat: improve code --- .../Configuration/AddSubFieldAction.tsx | 16 +++++++++++----- .../interfaces/properties/index.ts | 4 +++- .../schema-component/antd/menu/Menu.Designer.tsx | 4 ++++ .../antd/menu/MenuItemInitializers/index.tsx | 3 +++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/client/src/collection-manager/Configuration/AddSubFieldAction.tsx b/packages/client/src/collection-manager/Configuration/AddSubFieldAction.tsx index a99e1a4e09..6d9eb1c75a 100644 --- a/packages/client/src/collection-manager/Configuration/AddSubFieldAction.tsx +++ b/packages/client/src/collection-manager/Configuration/AddSubFieldAction.tsx @@ -105,6 +105,10 @@ export const AddSubFieldAction = () => { { const schema = getSchema(getInterface(info.key)); setSchema(schema); @@ -113,11 +117,13 @@ export const AddSubFieldAction = () => { > {options.map((option) => { return ( - - {option.children.map((child) => { - return {compile(child.title)}; - })} - + option.children.length > 0 && ( + + {option.children.map((child) => { + return {compile(child.title)}; + })} + + ) ); })} diff --git a/packages/client/src/collection-manager/interfaces/properties/index.ts b/packages/client/src/collection-manager/interfaces/properties/index.ts index c6713a578e..0afcc9666f 100644 --- a/packages/client/src/collection-manager/interfaces/properties/index.ts +++ b/packages/client/src/collection-manager/interfaces/properties/index.ts @@ -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: { diff --git a/packages/client/src/schema-component/antd/menu/Menu.Designer.tsx b/packages/client/src/schema-component/antd/menu/Menu.Designer.tsx index a7fce0e5d2..772a286520 100644 --- a/packages/client/src/schema-component/antd/menu/Menu.Designer.tsx +++ b/packages/client/src/schema-component/antd/menu/Menu.Designer.tsx @@ -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': {}, diff --git a/packages/client/src/schema-component/antd/menu/MenuItemInitializers/index.tsx b/packages/client/src/schema-component/antd/menu/MenuItemInitializers/index.tsx index b327a23a77..477c5d154c 100644 --- a/packages/client/src/schema-component/antd/menu/MenuItemInitializers/index.tsx +++ b/packages/client/src/schema-component/antd/menu/MenuItemInitializers/index.tsx @@ -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', },