diff --git a/components/apolloTable/component/base/edit/date/index.tsx b/components/apolloTable/component/base/edit/date/index.tsx index 774c0699007fd4985fb8f0699cf608d262158c29..07be80fe5a50734ecbe6ef9ba2bfad16c35b3578 100644 --- a/components/apolloTable/component/base/edit/date/index.tsx +++ b/components/apolloTable/component/base/edit/date/index.tsx @@ -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' ? { popupStyle={{ width: '350px' }} {...selfProps} onChange={changeValue} - onOpenChange={inputOnBlurFn} + onOpenChange={showTime ? timeOnBlurFn : dateOnBlurFn} /> :