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
ce05efcc
Commit
ce05efcc
authored
Jul 21, 2020
by
李晓静
Browse files
Options
Browse Files
Download
Plain Diff
时间区间组件修改
parents
8ec56b67
8fb5d5cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
index.tsx
...nents/apolloTable/component/base/edit/dateRange/index.tsx
+29
-6
index.less
components/apolloTable/editFormV3/index.less
+1
-2
No files found.
components/apolloTable/component/base/edit/dateRange/index.tsx
View file @
ce05efcc
import
React
from
'react'
;
import
React
,
{
useRef
}
from
'react'
;
import
{
DatePicker
}
from
'antd'
;
import
styles
from
'./styles.less
'
;
import
{
onBlurFn
}
from
'../onBlurFn
'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
import
styles
from
'./styles.less'
;
const
{
RangePicker
}
=
DatePicker
;
export
const
ApolloDateRange
=
(
props
:
any
)
=>
{
const
{
onChange
,
placeholder
,
beginDatePlaceholder
,
endDatePlaceholder
}
=
props
;
const
{
onChange
,
placeholder
,
showTime
,
beginDatePlaceholder
,
endDatePlaceholder
,
origin
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'columnConfig'
]);
const
changeValue
=
(
dates
,
dateStrings
)
=>
{
const
isOpen
=
useRef
();
const
changeValue
=
(
date
,
dateString
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
onChange
(
dates
,
dateStrings
);
if
(
typeof
onBlurFn
===
'function'
&&
!
isOpen
.
current
)
{
onBlurFn
({
...
props
,
value
:
date
});
}
onChange
(
date
,
dateString
);
}
};
const
dateOnBlurFn
=
(
e
:
boolean
)
=>
{
isOpen
.
current
=
e
;
};
const
timeOnBlurFn
=
(
e
:
boolean
)
=>
{
isOpen
.
current
=
e
;
if
(
typeof
onBlurFn
===
'function'
&&
!
e
)
{
onBlurFn
(
props
);
}
};
return
(
return
(
origin
===
'editForm'
?
<
RangePicker
className=
{
styles
.
date
}
dropdownClassName=
{
styles
.
dropdownClassName
}
// popupStyle={{ width: '350px' }}
{
...
selfProps
}
placeholder=
{
[
beginDatePlaceholder
||
placeholder
,
endDatePlaceholder
||
placeholder
]
}
onChange=
{
changeValue
}
onOpenChange=
{
showTime
?
timeOnBlurFn
:
dateOnBlurFn
}
/>
:
<
RangePicker
className=
{
styles
.
date
}
dropdownClassName=
{
styles
.
dropdownClassName
}
...
...
components/apolloTable/editFormV3/index.less
View file @
ce05efcc
...
...
@@ -2,9 +2,8 @@
.wrap {
position: relative;
// width: 580px;
width: 100%;
min-width: 580px;
.titleCls {
position: absolute;
left: 26px;
...
...
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