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
4e4fed2e
Commit
4e4fed2e
authored
Feb 10, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update download
parent
8ce98fd8
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
496 additions
and
565 deletions
+496
-565
BudgetTahunan.js
src/container/BudgetTahunan/BudgetTahunan.js
+121
-101
DownloadReport.js
src/container/DownloadReport/DownloadReport.js
+23
-34
MonthlyReport.js
src/container/MonthlyReport/MonthlyReport.js
+96
-100
OperatingIndicator.js
src/container/OperatingIndicator/OperatingIndicator.js
+64
-172
OutlookPA.js
src/container/OutlookPA/OutlookPA.js
+94
-78
RollingOutlook.js
src/container/RollingOutlook/RollingOutlook.js
+98
-80
No files found.
src/container/BudgetTahunan/BudgetTahunan.js
View file @
4e4fed2e
This diff is collapsed.
Click to expand it.
src/container/DownloadReport/DownloadReport.js
View file @
4e4fed2e
...
...
@@ -81,27 +81,25 @@ class DownloadReport extends Component {
this
.
state
=
{
load
:
false
,
loading
:
false
,
listDownload
:
[]
,
listDownload
:
[]
}
}
componentDidMount
()
{
//
const interval = setInterval(() => {
const
interval
=
setInterval
(()
=>
{
this
.
getListDownload
()
//
}, 500);
//
return () => clearInterval(interval);
},
500
);
return
()
=>
clearInterval
(
interval
);
}
getListDownload
()
{
api
.
create
().
getListDownload
().
then
((
response
)
=>
{
// console.log(response);
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
listDate
=
[]
let
arr
=
[];
var
groups
=
this
.
groupItems
(
data
,
"created_at"
);
// array will be grouped by 'date' property
...
...
@@ -112,29 +110,6 @@ class DownloadReport extends Component {
items
:
groups
[
key
],
});
}
console
.
log
(
arr
,
'ihiw'
);
// data.map((item) => {
// var reference = moment(item.created_at).format('YYYY-MM-DD');
// var today = moment().subtract(0, "days").format("YYYY-MM-DD");
// var yesterday = moment().subtract(1, "days").format("YYYY-MM-DD");
// let dateType = ""
// if (reference === today) {
// listDate.push({
// dateType: 'today'
// })
// } else if (reference === yesterday) {
// listDate.push({
// dateType: 'yesterday'
// })
// } else {
// listDate.push({
// dateType: 'daysago'
// })
// }
// console.log(listDate);
// })
this
.
setState
({
listDownload
:
arr
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
...
...
@@ -161,7 +136,6 @@ class DownloadReport extends Component {
var
pastDate
=
moment
(
reference
,
"DD-MM-YYYY"
);
var
todayDate
=
moment
(
moment
().
format
(
"DD-MM-YYYY"
),
"DD-MM-YYYY"
);
let
dDiff
=
todayDate
.
diff
(
pastDate
,
"days"
);
console
.
log
(
item
);
var
name
=
item
.
status
===
0
?
""
:
(
dDiff
===
0
?
"Today"
:
dDiff
===
1
?
"Yesterday"
:
"Days Ago"
);
var
group
=
groups
[
name
]
||
(
groups
[
name
]
=
[]);
group
.
push
(
item
);
...
...
@@ -187,7 +161,7 @@ class DownloadReport extends Component {
}
render
()
{
let
{
listDownload
,
messageAlert
}
=
this
.
state
let
{
listDownload
,
messageAlert
,
pageEmpty
}
=
this
.
state
const
loadingComponent
=
(
<
div
style
=
{{
position
:
'absolute'
,
zIndex
:
110
,
top
:
0
,
left
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'rgba(255,255,255,0.8)'
}}
>
<
PropagateLoader
...
...
@@ -224,7 +198,9 @@ class DownloadReport extends Component {
listItem
.
items
.
map
((
item
)
=>
{
return
(
<
div
>
{
item
.
status
==
0
?
null
:
{
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'
}}
>
...
...
@@ -281,7 +257,7 @@ class DownloadReport extends Component {
}}
>
<
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
<
span
><
CheckCircleIcon
fontSize
=
'small'
style
=
{{
marginBottom
:
3
,
marginLeft
:
7
}}
/></
span
><
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Download
<
span
><
CheckCircleIcon
fontSize
=
'small'
style
=
{{
marginBottom
:
1
,
marginLeft
:
7
}}
/></
span
><
/Typography
>
<
/div
>
<
/button
>
:
...
...
@@ -300,6 +276,7 @@ class DownloadReport extends Component {
)
})}
<
div
style
=
{{
fontSize
:
12
,
fontWeight
:
700
,
color
:
'red'
,
marginLeft
:
5
,
marginBottom
:
10
}}
>
Note
:
File
download
akan
hilang
dalam
3
hari
setelah
di
generate
.
<
/div
>
<
/div
>
<
/Paper
>
<
/div
>
...
...
@@ -308,11 +285,23 @@ class DownloadReport extends Component {
<
div
style
=
{{
flexDirection
:
'column'
,
textAlign
:
'center'
}}
>
<
CloudDownloadIcon
style
=
{{
fontSize
:
50
,
color
:
'grey'
}}
/
>
<
h3
style
=
{{
marginTop
:
5
,
color
:
'grey'
}}
>
Download
Report
Download
Report
Empty
<
/h3
>
<
/div
>
<
/div
>
}
{
/* {this.state.pageEmpty &&
<div style={{ flex: 1, height: '100vh', alignItems: 'center', justifyContent: 'center', display: 'flex' }}>
<div style={{ flexDirection: 'column', textAlign: 'center' }}>
<CloudDownloadIcon style={{ fontSize: 50, color: 'grey' }} />
<h3 style={{ marginTop: 5, color: 'grey' }}>
Download Report Empty
</h3>
</div>
</div>
} */
}
<
/div
>
<
/div
>
);
...
...
src/container/MonthlyReport/MonthlyReport.js
View file @
4e4fed2e
This diff is collapsed.
Click to expand it.
src/container/OperatingIndicator/OperatingIndicator.js
View file @
4e4fed2e
This diff is collapsed.
Click to expand it.
src/container/OutlookPA/OutlookPA.js
View file @
4e4fed2e
This diff is collapsed.
Click to expand it.
src/container/RollingOutlook/RollingOutlook.js
View file @
4e4fed2e
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