diff --git a/packages/core/client/src/schema-component/antd/action/Action.tsx b/packages/core/client/src/schema-component/antd/action/Action.tsx index cb7657877a..fecdd5e8fe 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.tsx @@ -582,6 +582,7 @@ const RenderButtonInner = observer( } const actionTitle = title || field?.title; + const { opacity, ...restButtonStyle } = buttonStyle; return ( : icon} + icon={typeof icon === 'string' ? : icon} disabled={disabled} - style={buttonStyle} + style={restButtonStyle} onClick={process.env.__E2E__ ? handleButtonClick : debouncedClick} // E2E 中的点击操作都是很快的,如果加上 debounce 会导致 E2E 测试失败 component={tarComponent || Button} className={classnames(componentCls, hashId, className, 'nb-action')} type={type === 'danger' ? undefined : type} > - {actionTitle && {actionTitle}} + {actionTitle && ( + + {actionTitle} + + )} ); diff --git a/packages/core/client/src/schema-initializer/components/CreateRecordAction.tsx b/packages/core/client/src/schema-initializer/components/CreateRecordAction.tsx index a940d82085..e938d151ae 100644 --- a/packages/core/client/src/schema-initializer/components/CreateRecordAction.tsx +++ b/packages/core/client/src/schema-initializer/components/CreateRecordAction.tsx @@ -267,11 +267,6 @@ function FinallyButton({ }) { const { getCollection } = useCollectionManager_deprecated(); const aclCtx = useACLActionParamsContext(); - const buttonStyle = useMemo(() => { - return { - opacity: designable && (field?.data?.hidden || !aclCtx) && 0.1, - }; - }, [designable, field?.data?.hidden]); if (inheritsCollections?.length > 0) { if (!linkageFromForm) { @@ -281,7 +276,6 @@ function FinallyButton({ danger={props.danger} type={componentType} icon={} - style={{ ...props?.style, ...buttonStyle }} buttonsRender={([leftButton, rightButton]) => [ React.cloneElement(leftButton as React.ReactElement, { style: props?.style, @@ -302,13 +296,7 @@ function FinallyButton({ ) : ( { - } @@ -333,7 +321,6 @@ function FinallyButton({ style={{ display: !designable && field?.data?.hidden && 'none', opacity: designable && field?.data?.hidden && 0.1, - ...buttonStyle, }} > {props.children} @@ -355,7 +342,7 @@ function FinallyButton({ ...props?.style, display: !designable && field?.data?.hidden && 'none', opacity: designable && field?.data?.hidden && 0.1, - ...buttonStyle, + height: '100%', }} > {props.children} diff --git a/packages/plugins/@nocobase/plugin-action-duplicate/src/client/DuplicateAction.tsx b/packages/plugins/@nocobase/plugin-action-duplicate/src/client/DuplicateAction.tsx index 39ef111c8f..7c02222437 100644 --- a/packages/plugins/@nocobase/plugin-action-duplicate/src/client/DuplicateAction.tsx +++ b/packages/plugins/@nocobase/plugin-action-duplicate/src/client/DuplicateAction.tsx @@ -112,11 +112,7 @@ export const DuplicateAction = observer( }), ) : record[collection.filterTargetKey] || id; - const buttonStyle = useMemo(() => { - return { - opacity: designable && (field?.data?.hidden || !aclCtx) && 0.1, - }; - }, [designable, field?.data?.hidden]); + const template = { key: 'duplicate', dataId, @@ -198,7 +194,6 @@ export const DuplicateAction = observer( opacity: designable && field?.data?.hidden && 0.1, cursor: loading ? 'not-allowed' : 'pointer', position: 'relative', - ...buttonStyle, }} onClick={handelDuplicate} >