Commit 52373ad9 authored by 李晓静's avatar 李晓静

merge

parents ed58f579 b9af6242
......@@ -5,7 +5,7 @@ import { antiAssign } from '../../../../utils/utils';
import styles from './styles.less';
export const ApolloDate = (props: any) => {
const { origin, onChange } = props;
const { origin, onChange, showTime } = props;
const selfProps = antiAssign(props, ['onChange', 'columnConfig']);
const isOpen = useRef();
const changeValue = (date, dateString) => {
......@@ -16,9 +16,15 @@ export const ApolloDate = (props: any) => {
onChange(date, dateString);
}
};
const inputOnBlurFn = (e: boolean) => {
const dateOnBlurFn = (e: boolean) => {
isOpen.current = e;
};
const timeOnBlurFn = (e: boolean) => {
isOpen.current = e;
if (typeof onBlurFn === 'function' && !e) {
onBlurFn(props);
}
};
return (origin === 'editForm' ?
<DatePicker
className={styles.date}
......@@ -27,7 +33,7 @@ export const ApolloDate = (props: any) => {
popupStyle={{ width: '350px' }}
{...selfProps}
onChange={changeValue}
onOpenChange={inputOnBlurFn}
onOpenChange={showTime ? timeOnBlurFn : dateOnBlurFn}
/> :
<DatePicker
className={styles.date}
......
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