Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
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
Dida Adams Arizona
Tia-dev
Commits
8ce98fd8
Commit
8ce98fd8
authored
Feb 09, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validasi
parent
41501aaf
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
221 additions
and
231 deletions
+221
-231
DownloadReport.js
src/container/DownloadReport/DownloadReport.js
+76
-109
MonthlyReport.js
src/container/MonthlyReport/MonthlyReport.js
+145
-122
No files found.
src/container/DownloadReport/DownloadReport.js
View file @
8ce98fd8
...
@@ -12,7 +12,8 @@ import SunEditor, { buttonList } from "suneditor-react";
...
@@ -12,7 +12,8 @@ import SunEditor, { buttonList } from "suneditor-react";
import
'suneditor/dist/css/suneditor.min.css'
;
// Import Sun Editor's CSS File
import
'suneditor/dist/css/suneditor.min.css'
;
// Import Sun Editor's CSS File
import
CloudDownloadIcon
from
'@material-ui/icons/CloudDownload'
;
import
CloudDownloadIcon
from
'@material-ui/icons/CloudDownload'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
CheckCircleOutlineIcon
from
'@material-ui/icons/CheckCircleOutline'
;
import
CheckCircleIcon
from
'@material-ui/icons/CheckCircle'
;
const
IOSSwitch
=
withStyles
((
theme
)
=>
({
const
IOSSwitch
=
withStyles
((
theme
)
=>
({
...
@@ -86,10 +87,10 @@ class DownloadReport extends Component {
...
@@ -86,10 +87,10 @@ class DownloadReport extends Component {
componentDidMount
()
{
componentDidMount
()
{
const
interval
=
setInterval
(()
=>
{
//
const interval = setInterval(() => {
this
.
getListDownload
()
this
.
getListDownload
()
},
500
);
//
}, 500);
return
()
=>
clearInterval
(
interval
);
//
return () => clearInterval(interval);
}
}
...
@@ -111,7 +112,7 @@ class DownloadReport extends Component {
...
@@ -111,7 +112,7 @@ class DownloadReport extends Component {
items
:
groups
[
key
],
items
:
groups
[
key
],
});
});
}
}
//
console.log(arr, 'ihiw');
console
.
log
(
arr
,
'ihiw'
);
// data.map((item) => {
// data.map((item) => {
// var reference = moment(item.created_at).format('YYYY-MM-DD');
// var reference = moment(item.created_at).format('YYYY-MM-DD');
...
@@ -160,7 +161,8 @@ class DownloadReport extends Component {
...
@@ -160,7 +161,8 @@ class DownloadReport extends Component {
var
pastDate
=
moment
(
reference
,
"DD-MM-YYYY"
);
var
pastDate
=
moment
(
reference
,
"DD-MM-YYYY"
);
var
todayDate
=
moment
(
moment
().
format
(
"DD-MM-YYYY"
),
"DD-MM-YYYY"
);
var
todayDate
=
moment
(
moment
().
format
(
"DD-MM-YYYY"
),
"DD-MM-YYYY"
);
let
dDiff
=
todayDate
.
diff
(
pastDate
,
"days"
);
let
dDiff
=
todayDate
.
diff
(
pastDate
,
"days"
);
var
name
=
dDiff
===
0
?
"Today"
:
dDiff
===
1
?
"Yesterday"
:
"Days Ago"
;
console
.
log
(
item
);
var
name
=
item
.
status
===
0
?
""
:
(
dDiff
===
0
?
"Today"
:
dDiff
===
1
?
"Yesterday"
:
"Days Ago"
);
var
group
=
groups
[
name
]
||
(
groups
[
name
]
=
[]);
var
group
=
groups
[
name
]
||
(
groups
[
name
]
=
[]);
group
.
push
(
item
);
group
.
push
(
item
);
return
groups
;
return
groups
;
...
@@ -221,6 +223,8 @@ class DownloadReport extends Component {
...
@@ -221,6 +223,8 @@ class DownloadReport extends Component {
{
listItem
.
items
.
length
>
0
&&
{
listItem
.
items
.
length
>
0
&&
listItem
.
items
.
map
((
item
)
=>
{
listItem
.
items
.
map
((
item
)
=>
{
return
(
return
(
<
div
>
{
item
.
status
==
0
?
null
:
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
width
:
'7%'
,
height
:
90
,
background
:
'#D9D9D9'
,
borderRadius
:
10
,
marginBottom
:
15
,
marginRight
:
2
,
borderBottomRightRadius
:
0
,
borderTopRightRadius
:
0
}}
>
<
div
style
=
{{
width
:
'7%'
,
height
:
90
,
background
:
'#D9D9D9'
,
borderRadius
:
10
,
marginBottom
:
15
,
marginRight
:
2
,
borderBottomRightRadius
:
0
,
borderTopRightRadius
:
0
}}
>
<
div
style
=
{{
alignItems
:
'center'
,
display
:
'flex'
}}
>
<
div
style
=
{{
alignItems
:
'center'
,
display
:
'flex'
}}
>
...
@@ -265,52 +269,7 @@ class DownloadReport extends Component {
...
@@ -265,52 +269,7 @@ class DownloadReport extends Component {
<
/div
>
<
/div
>
<
/button
>
<
/button
>
:
:
null
item
.
status
===
3
?
}
<
/div
>
<
/div
>
<
/div
>
)
})}
<
/div
>
)
})}
{
/* {this.state.listDownload.map((item) => (
item.status === 0 ?
null
:
<div style={{ display: 'flex' }}>
<div style={{ width: '7%', height: 90, background: '#D9D9D9', borderRadius: 10, marginBottom: 15, marginRight: 2, borderBottomRightRadius: 0, borderTopRightRadius: 0 }}>
<div style={{ alignItems: 'center', display: 'flex' }}>
<img src={Images.zip} style={{ width: 80, margin: 9 }} />
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', width: '92%', height: 90, background: '#D9D9D9', borderRadius: 10, marginBottom: 15, borderBottomLeftRadius: 0, borderTopLeftRadius: 0 }}>
<div>
<Typography style={{ fontSize: 18, color: '#273B80', fontWeight: 700, marginTop: 10, marginLeft: 10 }}>{item.download_file_report_name}</Typography>
<Typography style={{ marginLeft: 10, marginTop: 5, fontSize: 11 }}>Last Download by: {item.created_by} - {item.created_at}</Typography>
</div>
<div style={{ display: 'flex', justifyContent: 'center', marginRight: 40 }}>
{item.status === 1 ?
<button
type="button"
disabled={true}
onClick={() => null}
style={{
backgroundColor: 'transparent',
borderColor: 'transparent',
outline: 'none',
}}
>
<div style={{ backgroundColor: '#939497de', width: 140, height: 40, borderRadius: 10, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '16px', color: '#fff', textAlign: 'center' }}>In Progress</Typography>
</div>
</button>
:
item.status === 2 ?
<
button
<
button
type
=
"button"
type
=
"button"
// disabled={this.state.buttonError}
// disabled={this.state.buttonError}
...
@@ -322,7 +281,7 @@ class DownloadReport extends Component {
...
@@ -322,7 +281,7 @@ class DownloadReport extends Component {
}}
}}
>
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
140
,
height
:
40
,
borderRadius
:
10
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
140
,
height
:
40
,
borderRadius
:
10
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<Typography style={{ fontSize: '16px', color: '#fff', textAlign: 'center' }}>Download
</Typography>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Download
<
span
><
CheckCircleIcon
fontSize
=
'small'
style
=
{{
marginBottom
:
3
,
marginLeft
:
7
}}
/></
span
>
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
:
:
...
@@ -332,7 +291,15 @@ class DownloadReport extends Component {
...
@@ -332,7 +291,15 @@ class DownloadReport extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
))} */
}
}
<
/div
>
)
})}
<
/div
>
)
})}
<
/div
>
<
/div
>
<
/Paper
>
<
/Paper
>
<
/div
>
<
/div
>
...
...
src/container/MonthlyReport/MonthlyReport.js
View file @
8ce98fd8
This diff is collapsed.
Click to expand it.
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