Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web_component
submodule
Commits
b9af6242
Commit
b9af6242
authored
Jul 20, 2020
by
李晓静
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日期组件失去焦点优化
parent
32e2c45f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
index.tsx
components/apolloTable/component/base/edit/date/index.tsx
+9
-3
No files found.
components/apolloTable/component/base/edit/date/index.tsx
View file @
b9af6242
...
@@ -5,7 +5,7 @@ import { antiAssign } from '../../../../utils/utils';
...
@@ -5,7 +5,7 @@ import { antiAssign } from '../../../../utils/utils';
import
styles
from
'./styles.less'
;
import
styles
from
'./styles.less'
;
export
const
ApolloDate
=
(
props
:
any
)
=>
{
export
const
ApolloDate
=
(
props
:
any
)
=>
{
const
{
origin
,
onChange
}
=
props
;
const
{
origin
,
onChange
,
showTime
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'columnConfig'
]);
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'columnConfig'
]);
const
isOpen
=
useRef
();
const
isOpen
=
useRef
();
const
changeValue
=
(
date
,
dateString
)
=>
{
const
changeValue
=
(
date
,
dateString
)
=>
{
...
@@ -16,9 +16,15 @@ export const ApolloDate = (props: any) => {
...
@@ -16,9 +16,15 @@ export const ApolloDate = (props: any) => {
onChange
(
date
,
dateString
);
onChange
(
date
,
dateString
);
}
}
};
};
const
input
OnBlurFn
=
(
e
:
boolean
)
=>
{
const
date
OnBlurFn
=
(
e
:
boolean
)
=>
{
isOpen
.
current
=
e
;
isOpen
.
current
=
e
;
};
};
const
timeOnBlurFn
=
(
e
:
boolean
)
=>
{
isOpen
.
current
=
e
;
if
(
typeof
onBlurFn
===
'function'
&&
!
e
)
{
onBlurFn
(
props
);
}
};
return
(
origin
===
'editForm'
?
return
(
origin
===
'editForm'
?
<
DatePicker
<
DatePicker
className=
{
styles
.
date
}
className=
{
styles
.
date
}
...
@@ -27,7 +33,7 @@ export const ApolloDate = (props: any) => {
...
@@ -27,7 +33,7 @@ export const ApolloDate = (props: any) => {
popupStyle=
{
{
width
:
'350px'
}
}
popupStyle=
{
{
width
:
'350px'
}
}
{
...
selfProps
}
{
...
selfProps
}
onChange=
{
changeValue
}
onChange=
{
changeValue
}
onOpenChange=
{
input
OnBlurFn
}
onOpenChange=
{
showTime
?
timeOnBlurFn
:
date
OnBlurFn
}
/>
:
/>
:
<
DatePicker
<
DatePicker
className=
{
styles
.
date
}
className=
{
styles
.
date
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment