Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
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
黄庭坚
jinfa-platform
Commits
ba465d50
Commit
ba465d50
authored
Jul 30, 2020
by
tjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整timeRange方法,输出时间戳
parent
2bfa621e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
52 deletions
+77
-52
base.config.json
config/base.config.json
+0
-0
index.tsx
src/pages/member/memberMaintain/index.tsx
+0
-4
index.ts
src/utils/index.ts
+77
-48
No files found.
config/base.config.json
View file @
ba465d50
This diff is collapsed.
Click to expand it.
src/pages/member/memberMaintain/index.tsx
View file @
ba465d50
...
@@ -291,11 +291,7 @@ const memberMaintain: React.FC<[]> = () => {
...
@@ -291,11 +291,7 @@ const memberMaintain: React.FC<[]> = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
isFirst
)
return
;
if
(
!
isFirst
)
return
;
let
timeRanges
=
timeRange
(
searchForm
.
timeRange
);
let
timeRanges
=
timeRange
(
searchForm
.
timeRange
);
if
(
searchForm
.
timeRange
==
0
)
{
setIsFirst
(
false
);
setIsFirst
(
false
);
}
else
{
setIsFirst
(
false
);
}
setSearchForm
({
setSearchForm
({
...
searchForm
,
...
searchForm
,
startDate
:
timeRanges
.
st
,
startDate
:
timeRanges
.
st
,
...
...
src/utils/index.ts
View file @
ba465d50
...
@@ -9,68 +9,97 @@ function isObject(obj: any) {
...
@@ -9,68 +9,97 @@ function isObject(obj: any) {
}
}
export
function
timeRange
(
val
:
number
)
{
export
function
timeRange
(
val
:
number
)
{
let
st
=
''
,
et
=
''
;
let
st
,
et
;
switch
(
val
)
{
switch
(
val
)
{
case
0
:
case
0
:
st
=
et
=
''
st
=
et
=
''
;
break
break
;
case
1
:
case
1
:
st
=
et
=
moment
()
st
=
moment
(
moment
()
.
startOf
(
'days'
)
.
startOf
(
'days'
)
.
format
(
'YYYY-MM-DD'
);
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
break
).
unix
();
et
=
moment
(
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
).
unix
();
break
;
case
2
:
case
2
:
st
=
moment
()
st
=
moment
(
.
subtract
(
6
,
'days'
)
moment
()
.
format
(
'YYYY-MM-DD'
);
.
subtract
(
7
,
'days'
)
et
=
moment
()
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
.
startOf
(
'days'
)
).
unix
();
.
format
(
'YYYY-MM-DD'
);
et
=
moment
(
break
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
).
unix
();
break
;
case
3
:
case
3
:
st
=
moment
()
st
=
moment
(
.
startOf
(
'month'
)
moment
()
.
format
(
'YYYY-MM-DD'
);
.
subtract
(
29
,
'days'
)
et
=
moment
()
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
.
startOf
(
'days'
)
).
unix
();
.
format
(
'YYYY-MM-DD'
);
et
=
moment
(
break
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
).
unix
();
break
;
case
4
:
case
4
:
st
=
st
=
moment
(
moment
()
moment
()
.
subtract
(
2
,
'month'
)
.
subtract
(
89
,
'days'
)
.
format
(
'YYYY-MM'
)
+
'-01'
;
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
et
=
moment
()
).
unix
();
.
startOf
(
'days'
)
et
=
moment
(
.
format
(
'YYYY-MM-DD'
);
moment
()
break
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
).
unix
();
break
;
case
5
:
case
5
:
st
=
st
=
moment
(
moment
()
moment
()
.
subtract
(
5
,
'month'
)
.
subtract
(
179
,
'days'
)
.
format
(
'YYYY-MM'
)
+
'-01'
;
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
et
=
moment
()
).
unix
();
.
startOf
(
'days'
)
et
=
moment
(
.
format
(
'YYYY-MM-DD'
);
moment
()
break
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
).
unix
();
break
;
case
6
:
case
6
:
st
=
moment
()
st
=
moment
(
.
startOf
(
'year'
)
moment
()
.
format
(
'YYYY-MM-DD'
);
.
subtract
(
364
,
'days'
)
et
=
moment
()
.
format
(
'YYYY-MM-DD'
)
+
' 00:00:00'
,
.
startOf
(
'days'
)
).
unix
();
.
format
(
'YYYY-MM-DD'
);
et
=
moment
(
break
moment
()
.
endOf
(
'days'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
).
unix
();
break
;
case
7
:
case
7
:
st
=
moment
()
st
=
moment
(
.
years
(
moment
().
years
()
-
1
)
moment
()
.
year
(
moment
().
year
()
-
1
)
.
startOf
(
'year'
)
.
startOf
(
'year'
)
.
format
(
'YYYY-MM-DD'
);
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
et
=
moment
()
).
unix
();
.
years
(
moment
().
years
()
-
1
)
et
=
moment
(
moment
()
.
year
(
moment
().
year
()
-
1
)
.
endOf
(
'year'
)
.
endOf
(
'year'
)
.
format
(
'YYYY-MM-DD'
);
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
break
).
unix
();
break
;
}
}
return
{
st
,
et
}
return
{
st
,
et
}
}
}
...
...
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