Commit ba4641e1 authored by zhangwenshuai's avatar zhangwenshuai

表格中下拉组件弹框样式增加判断条件

parent a2cecbaf
......@@ -44,6 +44,15 @@ export const ApolloSearch = (props: ApolloSearchProps) => {
}
};
const extra: any = {};
// 表格中限制下拉类组件弹框高度
if (maxPopHeight) {
extra.dropdownClassName = s.searchDropdown;
extra.dropdownStyle = {
maxHeight: maxPopHeight,
};
}
return (
<Search
className={s.search}
......@@ -53,10 +62,7 @@ export const ApolloSearch = (props: ApolloSearchProps) => {
onDropdownVisibleChange={selfProps.mode === 'multiple' ? multipleBlurFn : singleBlurFn}
onChange={changeValue}
initDataType="onfocus"
dropdownClassName={s.searchDropdown}
dropdownStyle={{
maxHeight: maxPopHeight,
}}
{...extra}
/>
);
};
......@@ -4,6 +4,7 @@ import { onBlurFn } from '../onBlurFn';
import { ApolloSelectProps } from '../editInterface';
import { antiAssign } from '../../../../utils/utils';
import styles from './styles.less';
import s from "@/submodule/components/apolloTable/component/base/edit/search/index.less";
export const ApolloSelect = (props: ApolloSelectProps) => {
const { options = [], onChange, isMultiple, maxPopHeight } = props;
......@@ -31,16 +32,21 @@ export const ApolloSelect = (props: ApolloSelectProps) => {
}
};
const extra: any = {};
if (maxPopHeight) {
extra.dropdownClassName = s.searchDropdown;
extra.dropdownStyle = {
maxHeight: maxPopHeight,
};
}
return (
<Select
className={styles.select}
{...selfProps}
onChange={changeValue}
onDropdownVisibleChange={selfProps.mode === 'multiple' ? multipleBlurFn : singleBlurFn}
dropdownClassName={styles.selectDropdown}
dropdownStyle={{
maxHeight: maxPopHeight,
}}
{...extra}
>
{options.map((item) => {
return (
......
......@@ -3,6 +3,7 @@ import { Menu, Empty, Spin, Input, Dropdown } from 'antd';
import { findDOMNode } from 'react-dom';
import lodash from 'lodash';
import styles from './styles.less';
import s from "@/submodule/components/apolloTable/component/base/edit/search/index.less";
/*
* 此空间用于数据选择及输入控制,若不选择只传入输入框数据
......@@ -200,14 +201,18 @@ class TextSelect extends React.Component<Props, State> {
render() {
const { placeholder, disabled, maxPopHeight } = this.props;
const { searchStr } = this.state;
const extra: any = {};
if (maxPopHeight) {
extra.overlayClassName = styles.overlayClassName;
extra.overlayStyle = {
maxHeight: maxPopHeight,
};
}
return (
<div className={styles.textSelectContainer} ref={this.container}>
<Dropdown
trigger={['click']}
overlayClassName={styles.overlayClassName}
overlayStyle={{
maxHeight: maxPopHeight,
}}
{...extra}
onVisibleChange={this.onVisibleChange}
placement="bottomLeft"
overlay={this.renderList()}
......
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