diff --git a/packages/core/client/src/css-variable/CSSVariableProvider.tsx b/packages/core/client/src/css-variable/CSSVariableProvider.tsx index e88f3758f..fd6fb67b7 100644 --- a/packages/core/client/src/css-variable/CSSVariableProvider.tsx +++ b/packages/core/client/src/css-variable/CSSVariableProvider.tsx @@ -42,9 +42,6 @@ export const CSSVariableProvider = ({ children }) => { document.body.style.setProperty('--colorSettings', token.colorSettings || defaultTheme.token.colorSettings); document.body.style.setProperty('--colorBgSettingsHover', token.colorBgSettingsHover); document.body.style.setProperty('--colorBorderSettingsHover', token.colorBorderSettingsHover); - document.body.style.setProperty('--margin', `${token.margin}px`); - document.body.style.setProperty('--padding', `${token.padding}px`); - document.body.style.setProperty('--paddingXXS', `${token.paddingXXS}px`); // 设置登录页面的背景色 document.body.style.setProperty('background-color', token.colorBgContainer); @@ -75,9 +72,6 @@ export const CSSVariableProvider = ({ children }) => { token.colorSettings, token.colorBgSettingsHover, token.colorBorderSettingsHover, - token.margin, - token.padding, - token.paddingXXS, ]); return children; diff --git a/packages/core/client/src/global.less b/packages/core/client/src/global.less index 099c57678..0d59a4cc3 100644 --- a/packages/core/client/src/global.less +++ b/packages/core/client/src/global.less @@ -33,9 +33,3 @@ .rc-virtual-list-scrollbar-thumb:active { background: var(--colorBgScrollBarActive) !important; } - -// fix https://nocobase.height.app/T-3333/description -.ant-table-column-has-sorters .nb-sortable-designer { - margin-right: calc(0px - var(--margin) - var(--margin)); - padding-right: calc(var(--padding) + var(--padding)); -} diff --git a/packages/core/client/src/schema-component/antd/table-v2/Table.Column.ActionBar.tsx b/packages/core/client/src/schema-component/antd/table-v2/Table.Column.ActionBar.tsx index fe7e52c42..1e3d4f4ea 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/Table.Column.ActionBar.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/Table.Column.ActionBar.tsx @@ -2,11 +2,12 @@ import { css } from '@emotion/css'; import { observer } from '@formily/react'; import React from 'react'; import { SortableItem, useDesigner } from '../..'; +import { useFlag } from '../../../flag-provider/hooks/useFlag'; -export const designerCss = css` +export const designerCss = ({ margin = '-18px -16px', padding = '18px 16px' } = {}) => css` position: relative; - margin: calc(0px - var(--margin)) calc(0px - var(--margin)); - padding: calc(var(--padding) + var(--paddingXXS)) var(--padding); + margin: ${margin}; + padding: ${padding}; &:hover { > .general-schema-designer { @@ -45,8 +46,14 @@ export const designerCss = css` export const TableColumnActionBar = observer( (props) => { const Designer = useDesigner(); + const { isInSubTable } = useFlag() || {}; return ( - + {props.children} diff --git a/packages/core/client/src/schema-component/antd/table-v2/Table.Column.Decorator.tsx b/packages/core/client/src/schema-component/antd/table-v2/Table.Column.Decorator.tsx index ccf589c9f..e26bed37c 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/Table.Column.Decorator.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/Table.Column.Decorator.tsx @@ -7,6 +7,7 @@ import { useCompile, useDesigner, CollectionFieldContext, + useFlag, } from '../../../'; import { designerCss } from './Table.Column.ActionBar'; import { isCollectionFieldComponent } from './utils'; @@ -35,6 +36,7 @@ export const TableColumnDecorator = (props) => { const field = useField(); const { fieldSchema, uiSchema, collectionField } = useColumnSchema(); const compile = useCompile(); + const { isInSubTable } = useFlag() || {}; useLayoutEffect(() => { if (field.title) { return; @@ -47,7 +49,12 @@ export const TableColumnDecorator = (props) => { } }, [uiSchema?.title]); return ( - + {/* */}