From e0ea36be5c261153a4565aa73fa69cd93cf9cc32 Mon Sep 17 00:00:00 2001 From: Katherine Date: Sat, 11 Oct 2025 09:47:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(action-panel):=20fix=20list=20item=20not=20?= =?UTF-8?q?hiding=20correctly=20under=20linkage=20r=E2=80=A6=20(#7569)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(action-panel): fix list item not hiding correctly under linkage rules * fix: bug --- .../src/client/WorkbenchAction.tsx | 76 +++++++++++++++---- .../src/client/WorkbenchBlock.tsx | 19 ++--- 2 files changed, 68 insertions(+), 27 deletions(-) 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' }} + > +