Commit d103ccec authored by zhangwenshuai's avatar zhangwenshuai

update select ui

parent 8972d499
......@@ -40,6 +40,7 @@ export interface ApolloInputSearchProps extends SelectProps<any>, CommonProps {
export interface ApolloSelectProps extends SelectProps<any>, CommonProps {
isMultiple?: boolean;
options?: any[];
maxPopHeight?:boolean;
}
export interface ApolloNumberProps extends InputNumberProps, CommonProps {}
export interface ApolloCheckboxProps extends CheckboxProps, CommonProps {
......
.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%;
}
}
......@@ -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' ?
<Search
className={s.search}
request={request}
fieldNames={{ value: 'fieldValueValue', label: 'fieldValueName' }}
{...selfProps}
onChange={changeValue}
onDropdownVisibleChange={selfProps.mode === 'multiple' ? multipleBlurFn : singleBlurFn}
initDataType="onfocus"
/> : <Search
className={s.search}
request={request}
fieldNames={{ value: 'fieldValueValue', label: 'fieldValueName' }}
{...selfProps}
onChange={changeValue}
initDataType="onfocus"
/>
<Search
className={s.search}
request={request}
fieldNames={{ value: 'fieldValueValue', label: 'fieldValueName' }}
{...selfProps}
onDropdownVisibleChange={selfProps.mode === 'multiple' ? multipleBlurFn : singleBlurFn}
onChange={changeValue}
initDataType="onfocus"
/>
);
};
......@@ -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 (
<Select
className={styles.select}
{...selfProps}
......@@ -49,22 +49,5 @@ export const ApolloSelect = (props: ApolloSelectProps) => {
);
})}
</Select>
) : (
<Select
className={styles.select}
{...selfProps}
onChange={changeValue}
dropdownStyle={{
maxHeight: maxPopHeight,
}}
>
{options.map((item) => {
return (
<Select.Option key={item.id} value={item.id}>
{item.name}
</Select.Option>
);
})}
</Select>
);
};
.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;
}
}
.searchContainer {
width: 100%;
height: 100%;
:global(.ant-select-selection__rendered) {
width: 100%;
}
:global(.ant-select-selection) {
min-height: 100%;
}
}
## 此组件用于组合数据录入空间几何
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment