diff --git a/packages/client/src/application/demos/demo2/index.tsx b/packages/client/src/application/demos/demo2/index.tsx index 674512eda..21d6d55b9 100644 --- a/packages/client/src/application/demos/demo2/index.tsx +++ b/packages/client/src/application/demos/demo2/index.tsx @@ -3,6 +3,7 @@ import { Action, AdminLayout, AntdConfigProvider, + AntdSchemaComponentProvider, APIClientProvider, AuthLayout, CollectionManagerShortcut, @@ -36,6 +37,7 @@ const providers = [ { components: { ACLShortcut, DesignableSwitch, CollectionManagerShortcut, SystemSettingsShortcut } }, ], [SchemaComponentProvider, { components: { Page, Menu, Action } }], + AntdSchemaComponentProvider, [DocumentTitleProvider, { addonAfter: 'NocoBase' }], [RouteSwitchProvider, { components: { AuthLayout, AdminLayout } }], ]; diff --git a/packages/client/src/collection-manager/CollectionManagerShortcut.tsx b/packages/client/src/collection-manager/CollectionManagerShortcut.tsx index 22f4c777c..b2d81d8b1 100644 --- a/packages/client/src/collection-manager/CollectionManagerShortcut.tsx +++ b/packages/client/src/collection-manager/CollectionManagerShortcut.tsx @@ -1,8 +1,9 @@ -import React, { useState } from 'react'; import { DatabaseOutlined } from '@ant-design/icons'; -import { SchemaComponent, useActionVisible, VisibleContext } from '../schema-component'; import { ISchema, useForm } from '@formily/react'; +import { uid } from '@formily/shared'; +import React, { useState } from 'react'; import { PluginManager } from '../plugin-manager'; +import { SchemaComponent, useActionVisible, VisibleContext } from '../schema-component'; const useCloseAction = () => { const { setVisible } = useActionVisible(); @@ -20,7 +21,7 @@ const useCloseAction = () => { const schema: ISchema = { type: 'object', properties: { - drawer1: { + [uid()]: { 'x-component': 'Action.Drawer', type: 'void', title: 'Drawer Title', diff --git a/packages/client/src/plugin-manager/PluginManager.tsx b/packages/client/src/plugin-manager/PluginManager.tsx index cf7e12744..f67c557a7 100644 --- a/packages/client/src/plugin-manager/PluginManager.tsx +++ b/packages/client/src/plugin-manager/PluginManager.tsx @@ -1,10 +1,9 @@ -import React, { createContext, useContext } from 'react'; -import { Menu, Space, Tooltip, MenuItemProps } from 'antd'; -import { SettingOutlined, MoreOutlined, DesktopOutlined } from '@ant-design/icons'; -import { get } from 'lodash'; -import { PluginManagerContext } from './context'; +import { MoreOutlined, SettingOutlined } from '@ant-design/icons'; +import { ConfigProvider, Menu, MenuItemProps, Tooltip } from 'antd'; import cls from 'classnames'; -import { ConfigProvider } from 'antd'; +import { get } from 'lodash'; +import React, { createContext, useContext } from 'react'; +import { PluginManagerContext } from './context'; export const usePrefixCls = ( tag?: string, @@ -67,7 +66,7 @@ PluginManager.Toolbar = (props: ToolbarProps) => { ); })} - }> + }> 管理插件 diff --git a/packages/client/src/schema-component/antd/action/Action.Drawer.tsx b/packages/client/src/schema-component/antd/action/Action.Drawer.tsx index bf7c26a52..1dd27ab5d 100644 --- a/packages/client/src/schema-component/antd/action/Action.Drawer.tsx +++ b/packages/client/src/schema-component/antd/action/Action.Drawer.tsx @@ -1,9 +1,9 @@ +import { observer, RecursionField, useField, useFieldSchema } from '@formily/react'; +import { Drawer } from 'antd'; import React, { useContext } from 'react'; import { createPortal } from 'react-dom'; -import { Drawer } from 'antd'; import { VisibleContext } from './context'; import { ComposedActionDrawer } from './types'; -import { observer, RecursionField, useField, useFieldSchema } from '@formily/react'; export const ActionDrawer: ComposedActionDrawer = observer((props) => { const [visible, setVisible] = useContext(VisibleContext); @@ -13,6 +13,7 @@ export const ActionDrawer: ComposedActionDrawer = observer((props) => { <> {createPortal( { setVisible(false)} footer={ - + + + } > { - return s['x-component'] === 'RowSelection'; - }} + // filterProperties={(s) => { + // return s['x-component'] === 'RowSelection'; + // }} /> diff --git a/packages/client/src/system-settings/SystemSettingsShortcut.tsx b/packages/client/src/system-settings/SystemSettingsShortcut.tsx index 91cb6df01..46b5ce5ab 100644 --- a/packages/client/src/system-settings/SystemSettingsShortcut.tsx +++ b/packages/client/src/system-settings/SystemSettingsShortcut.tsx @@ -1,9 +1,9 @@ -import { Menu } from 'antd'; -import React, { useState } from 'react'; import { SettingOutlined } from '@ant-design/icons'; -import { SchemaComponent, useActionVisible, VisibleContext } from '../schema-component'; import { ISchema, useForm } from '@formily/react'; +import { uid } from '@formily/shared'; +import React, { useState } from 'react'; import { PluginManager } from '..'; +import { SchemaComponent, useActionVisible, VisibleContext } from '../schema-component'; const useCloseAction = () => { const { setVisible } = useActionVisible(); @@ -21,7 +21,7 @@ const useCloseAction = () => { const schema: ISchema = { type: 'object', properties: { - drawer1: { + [uid()]: { 'x-component': 'Action.Drawer', type: 'void', title: 'Drawer Title',