diff --git a/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchAction.tsx b/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchAction.tsx index e5b8b22eff8..39cd17653d5 100644 --- a/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchAction.tsx +++ b/packages/plugins/@nocobase/plugin-block-workbench/src/client/WorkbenchAction.tsx @@ -16,7 +16,9 @@ import { ACLActionProvider, NAMESPACE_UI_SCHEMA, } from '@nocobase/client'; +import { css } from '@emotion/css'; import { Avatar } from 'antd'; +import { List } from 'antd-mobile'; import { createStyles } from 'antd-style'; import React, { useContext } from 'react'; import { useTranslation } from 'react-i18next'; @@ -78,18 +80,64 @@ export const WorkbenchAction = withDynamicSchemaProps((props) => { const { styles, cx } = useStyles() as any; const fieldSchema = useFieldSchema(); const Component = useComponent(props?.targetComponent) || Action; - return ( - - } - confirmTitle={fieldSchema.title} - style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }} - /> - - ); + const { layout = WorkbenchLayout.Grid } = fieldSchema.parent?.parent?.['x-component-props'] || {}; + + if (layout === 'list') { + const icon = fieldSchema['x-component-props']?.['icon']; + const backgroundColor = fieldSchema['x-component-props']?.['iconColor']; + + return ( + + span { + width: 100%; + } + padding-top: 0px !important; + `, + )} + {...others} + onlyIcon={false} + type="text" + icon={null} + title={ + } />} + onClick={() => {}} + style={{ marginTop: '5px' }} + > +