Commit ba4641e1 authored by zhangwenshuai's avatar zhangwenshuai

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

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