From 2bdaab0d5adb81c34451669ff1b1d89b5a4d0f43 Mon Sep 17 00:00:00 2001 From: yxh01132861 Date: Fri, 15 Sep 2023 17:11:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseFormSchemaField/VisTypeSelect/VisTypeSelect.less | 4 ++++ .../Formily/ColorRangeSelector/Internal/style.ts | 8 ++++++-- .../Formily/ControlPositionSelect/Select/index.tsx | 2 +- .../Formily/ControlPositionSelect/Select/style.ts | 9 ++++++++- .../src/components/Formily/FieldSelect/Select/index.tsx | 1 + .../src/components/Formily/FieldSelect/Select/style.ts | 9 ++++++++- .../Formily/RibbonSelect/RibbonSelect/style.ts | 7 ++++++- 7 files changed, 34 insertions(+), 6 deletions(-) diff --git a/packages/li-editor/src/widgets/LayersPanel/LayerAttribute/BaseFormSchemaField/VisTypeSelect/VisTypeSelect.less b/packages/li-editor/src/widgets/LayersPanel/LayerAttribute/BaseFormSchemaField/VisTypeSelect/VisTypeSelect.less index 3560e77f..7315dce6 100644 --- a/packages/li-editor/src/widgets/LayersPanel/LayerAttribute/BaseFormSchemaField/VisTypeSelect/VisTypeSelect.less +++ b/packages/li-editor/src/widgets/LayersPanel/LayerAttribute/BaseFormSchemaField/VisTypeSelect/VisTypeSelect.less @@ -5,6 +5,10 @@ @prefix-select-cls: ~'@{prefix}-vis-type-select'; .@{prefix-select-cls} { + .ant-select-selection-item { + height: 30px; + } + &__drop-down { display: flex; flex-wrap: wrap; diff --git a/packages/li-p2/src/components/Formily/ColorRangeSelector/Internal/style.ts b/packages/li-p2/src/components/Formily/ColorRangeSelector/Internal/style.ts index 917074a8..84b44183 100644 --- a/packages/li-p2/src/components/Formily/ColorRangeSelector/Internal/style.ts +++ b/packages/li-p2/src/components/Formily/ColorRangeSelector/Internal/style.ts @@ -1,12 +1,16 @@ import { genStyleHook } from '@formily/antd-v5/esm/__builtins__'; export default genStyleHook('color-range-selector', (token) => { - const { componentCls, antCls } = token; - + const { componentCls, antCls, controlHeight, lineWidth } = token; + const selectHeightWithoutBorder = controlHeight - lineWidth * 2; return { [componentCls]: { maxWidth: 260, + [`${antCls}-select-selection-item`]: { + height: selectHeightWithoutBorder, + }, + [`${componentCls}__selection-item`]: { display: 'flex', alignItems: 'center', diff --git a/packages/li-p2/src/components/Formily/ControlPositionSelect/Select/index.tsx b/packages/li-p2/src/components/Formily/ControlPositionSelect/Select/index.tsx index 8a607377..4d5ba4c5 100644 --- a/packages/li-p2/src/components/Formily/ControlPositionSelect/Select/index.tsx +++ b/packages/li-p2/src/components/Formily/ControlPositionSelect/Select/index.tsx @@ -13,7 +13,7 @@ const PositionSelect: React.FC = (props) => { const [wrapSSR, hashId] = useStyle(prefixCls); return wrapSSR( - {(options ?? POSITION).map((item, index) => { return ( diff --git a/packages/li-p2/src/components/Formily/ControlPositionSelect/Select/style.ts b/packages/li-p2/src/components/Formily/ControlPositionSelect/Select/style.ts index c4f6aa48..ba2d6bd8 100644 --- a/packages/li-p2/src/components/Formily/ControlPositionSelect/Select/style.ts +++ b/packages/li-p2/src/components/Formily/ControlPositionSelect/Select/style.ts @@ -1,9 +1,16 @@ import { genStyleHook } from '@formily/antd-v5/esm/__builtins__'; export default genStyleHook('field-select', (token) => { - const { componentCls } = token; + const { antCls, componentCls, controlHeight, lineWidth } = token; + const selectHeightWithoutBorder = controlHeight - lineWidth * 2; return { + [`${componentCls}-select`]: { + [`${antCls}-select-selection-item`]: { + height: selectHeightWithoutBorder, + }, + }, + [componentCls]: { [`${componentCls}-item`]: { lineHeight: '30px', diff --git a/packages/li-p2/src/components/Formily/FieldSelect/Select/index.tsx b/packages/li-p2/src/components/Formily/FieldSelect/Select/index.tsx index 281901f6..3ea8e487 100644 --- a/packages/li-p2/src/components/Formily/FieldSelect/Select/index.tsx +++ b/packages/li-p2/src/components/Formily/FieldSelect/Select/index.tsx @@ -22,6 +22,7 @@ const InternalSelect: React.FC> = (pr return wrapSSR(