From d103ccec85ff48c3e398d8a0d37660cb0d076bbd Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Fri, 24 Jul 2020 17:54:15 +0800 Subject: [PATCH] update select ui --- .../component/base/edit/editInterface.tsx | 1 + .../component/base/edit/search/index.less | 5 +-- .../component/base/edit/search/index.tsx | 31 +++++++------------ .../component/base/edit/select/index.tsx | 21 ++----------- .../component/base/edit/select/styles.less | 8 +++-- .../base/extra/associationSearch/index.less | 10 ------ .../component/base/extra/dataEntry/readme.md | 1 - 7 files changed, 23 insertions(+), 54 deletions(-) delete mode 100644 components/apolloTable/component/base/extra/associationSearch/index.less delete mode 100644 components/apolloTable/component/base/extra/dataEntry/readme.md diff --git a/components/apolloTable/component/base/edit/editInterface.tsx b/components/apolloTable/component/base/edit/editInterface.tsx index 6699083..48bd886 100644 --- a/components/apolloTable/component/base/edit/editInterface.tsx +++ b/components/apolloTable/component/base/edit/editInterface.tsx @@ -40,6 +40,7 @@ export interface ApolloInputSearchProps extends SelectProps, CommonProps { export interface ApolloSelectProps extends SelectProps, CommonProps { isMultiple?: boolean; options?: any[]; + maxPopHeight?:boolean; } export interface ApolloNumberProps extends InputNumberProps, CommonProps {} export interface ApolloCheckboxProps extends CheckboxProps, CommonProps { diff --git a/components/apolloTable/component/base/edit/search/index.less b/components/apolloTable/component/base/edit/search/index.less index af0f82d..0b0908b 100644 --- a/components/apolloTable/component/base/edit/search/index.less +++ b/components/apolloTable/component/base/edit/search/index.less @@ -1,6 +1,7 @@ .search { width: 100%; - height: 100%; + //height: 100%; + display: flex; :global(.ant-select-selection) { width: 100%; min-height: 100%; @@ -8,7 +9,7 @@ display: flex; align-items: center; } - :global(.ant-select-selection__rendered){ + :global(.ant-select-selection__rendered) { width: 100%; } } diff --git a/components/apolloTable/component/base/edit/search/index.tsx b/components/apolloTable/component/base/edit/search/index.tsx index 2dc9bca..e454a32 100644 --- a/components/apolloTable/component/base/edit/search/index.tsx +++ b/components/apolloTable/component/base/edit/search/index.tsx @@ -7,9 +7,9 @@ import { onBlurFn } from '../onBlurFn'; import s from './index.less'; export const ApolloSearch = (props: ApolloSearchProps) => { - const { onChange, maxCount, isMultiple, request, origin } = props; + const { onChange, maxCount, isMultiple, request } = props; const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'isMultiple', 'options', 'request', 'maxCount']); - const isOpen = useRef(); + const isOpen: any = useRef(); if (isMultiple) { selfProps.mode = 'multiple'; } @@ -35,23 +35,16 @@ export const ApolloSearch = (props: ApolloSearchProps) => { onBlurFn(props); } }; + return ( - origin === 'editForm' ? - : + ); }; diff --git a/components/apolloTable/component/base/edit/select/index.tsx b/components/apolloTable/component/base/edit/select/index.tsx index 5680dfc..328a9e8 100644 --- a/components/apolloTable/component/base/edit/select/index.tsx +++ b/components/apolloTable/component/base/edit/select/index.tsx @@ -6,7 +6,7 @@ import { antiAssign } from '../../../../utils/utils'; import styles from './styles.less'; export const ApolloSelect = (props: ApolloSelectProps) => { - const { options = [], onChange, isMultiple, origin, maxPopHeight } = props; + const { options = [], onChange, isMultiple, maxPopHeight } = props; const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'isMultiple', 'options', 'maxPopHeight']); const isOpen: any = useRef(); @@ -31,7 +31,7 @@ export const ApolloSelect = (props: ApolloSelectProps) => { } }; - return origin === 'editForm' ? ( + return ( - ) : ( - ); }; diff --git a/components/apolloTable/component/base/edit/select/styles.less b/components/apolloTable/component/base/edit/select/styles.less index 20aca23..ed123d1 100644 --- a/components/apolloTable/component/base/edit/select/styles.less +++ b/components/apolloTable/component/base/edit/select/styles.less @@ -1,18 +1,20 @@ .select { width: 100%; - height: 100%; + display: flex; :global(.ant-select-selector) { height: 100% !important; align-items: center; } :global(.ant-select-selection) { width: 100%; - min-height: 100%; + height: auto; border-radius: 0; display: flex; align-items: center; } - :global(.ant-select-selection__rendered){ + :global(.ant-select-selection__rendered) { width: 100%; + display: flex; + align-items: center; } } diff --git a/components/apolloTable/component/base/extra/associationSearch/index.less b/components/apolloTable/component/base/extra/associationSearch/index.less deleted file mode 100644 index a4901bf..0000000 --- a/components/apolloTable/component/base/extra/associationSearch/index.less +++ /dev/null @@ -1,10 +0,0 @@ -.searchContainer { - width: 100%; - height: 100%; - :global(.ant-select-selection__rendered) { - width: 100%; - } - :global(.ant-select-selection) { - min-height: 100%; - } -} diff --git a/components/apolloTable/component/base/extra/dataEntry/readme.md b/components/apolloTable/component/base/extra/dataEntry/readme.md deleted file mode 100644 index 0eb58a6..0000000 --- a/components/apolloTable/component/base/extra/dataEntry/readme.md +++ /dev/null @@ -1 +0,0 @@ -## 此组件用于组合数据录入空间几何 \ No newline at end of file -- 2.21.0