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
f351a69f
Commit
f351a69f
authored
Sep 08, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
malam issue
parent
f3f16c6c
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
464 additions
and
56 deletions
+464
-56
index.js
src/api/index.js
+3
-1
AuditTahunan.js
src/container/DocumentManagement/AuditTahunan.js
+3
-12
CreateManagementDoc.js
src/container/DocumentManagement/CreateManagementDoc.js
+356
-0
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+17
-0
ManualBookTia.js
src/container/DocumentManagement/ManualBookTia.js
+0
-11
CreateParameter.js
src/container/MasterData/Parameter/CreateParameter.js
+2
-4
Upload.js
src/library/Upload.js
+83
-28
No files found.
src/api/index.js
View file @
f351a69f
...
...
@@ -176,6 +176,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
// MANAGEMENT DOCUMENT
const
getDocumentCategory
=
()
=>
api
.
get
(
'document_category/get_all_document_category'
)
const
getAllDocument
=
(
body
)
=>
api
.
post
(
'document/get_all_document'
,
body
)
const
uploadDocument
=
(
body
)
=>
api
.
post
(
'document/upload_document'
,
body
)
// ------
// STEP 3
...
...
@@ -281,7 +282,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
deletePerusahaan
,
deleteReportItems
,
getDocumentCategory
,
getAllDocument
getAllDocument
,
uploadDocument
}
}
...
...
src/container/DocumentManagement/AuditTahunan.js
View file @
f351a69f
...
...
@@ -2,6 +2,7 @@ import React, { Component } from 'react'
import
MUIDataTable
from
'mui-datatables'
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core'
;
import
api
from
'../../api'
;
import
CreateManagementDoc
from
'./CreateManagementDoc'
;
var
ct
=
require
(
"../../library/CustomTable"
);
...
...
@@ -12,7 +13,8 @@ export default class AuditTahunan extends Component {
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[]
dataTable
:
[],
visibleCreate
:
false
}
}
...
...
@@ -50,17 +52,6 @@ export default class AuditTahunan extends Component {
]
return
(
<
div
style
=
{{
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'flex-end'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
null
}
style
=
{{
marginRight
:
25
}}
>
<
div
style
=
{{
width
:
150
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Add
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
div
style
=
{{
padding
:
25
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
...
...
src/container/DocumentManagement/CreateManagementDoc.js
0 → 100644
View file @
f351a69f
This diff is collapsed.
Click to expand it.
src/container/DocumentManagement/DocumentManagement.js
View file @
f351a69f
...
...
@@ -5,6 +5,7 @@ import Images from '../../assets/Images'
import
ManualBookTia
from
'./ManualBookTia'
import
api
from
'../../api'
import
AuditTahunan
from
'./AuditTahunan'
import
CreateManagementDoc
from
'./CreateManagementDoc'
export
default
class
DocumentManagement
extends
Component
{
constructor
(
props
)
{
...
...
@@ -47,6 +48,17 @@ export default class DocumentManagement extends Component {
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
Paper
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'flex-end'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
style
=
{{
marginRight
:
25
}}
>
<
div
style
=
{{
width
:
150
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Add
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Tabs
orientation
=
"vertical"
...
...
@@ -79,6 +91,11 @@ export default class DocumentManagement extends Component {
<
/Paper
>
<
/div
>
{
this
.
state
.
visibleCreate
&&
(
<
CreateManagementDoc
onClickClose
=
{()
=>
this
.
setState
({
visibleCreate
:
false
})}
/
>
)}
<
/div
>
)
}
...
...
src/container/DocumentManagement/ManualBookTia.js
View file @
f351a69f
...
...
@@ -21,17 +21,6 @@ export default class ManualBookTia extends Component {
]
return
(
<
div
style
=
{{
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'flex-end'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
null
}
style
=
{{
marginRight
:
25
}}
>
<
div
style
=
{{
width
:
150
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Add
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
div
style
=
{{
padding
:
25
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
...
...
src/container/MasterData/Parameter/CreateParameter.js
View file @
f351a69f
...
...
@@ -58,9 +58,6 @@ export default class CreateParameter extends Component {
componentDidMount
()
{
if
(
this
.
props
.
type
===
'edit'
)
{
this
.
setState
({
getSettingTypeID
:
this
.
props
.
data
[
0
],
})
this
.
getDetailParameter
()
}
else
{
let
date
=
format
(
new
Date
,
'yyyy-MM-dd'
)
...
...
@@ -85,6 +82,7 @@ export default class CreateParameter extends Component {
getSettingGroupID
:
response
.
data
.
data
.
setting_group_id
,
getCompanyID
:
data
.
company_id
,
settingType
:
data
.
setting_type
,
getSettingTypeID
:
data
.
setting_type_id
},
()
=>
{
this
.
getAllGroup
()
this
.
getPerusahaan
()
...
...
@@ -283,7 +281,7 @@ export default class CreateParameter extends Component {
options
:
typeData
,
getOptionLabel
:
(
option
)
=>
option
.
setting_type_name
,
};
this
.
setState
({
enableParameter
:
true
,
parameter
:
typeProps
,
parameterData
:
response
.
data
.
data
,
getParameter
:
index
==
-
1
?
typeData
[
0
]
:
typeData
[
index
]
})
this
.
setState
({
enableParameter
:
true
,
parameter
:
typeProps
,
parameterData
:
response
.
data
.
data
,
getParameter
:
index
==
-
1
?
null
:
typeData
[
index
]
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
...
src/library/Upload.js
View file @
f351a69f
...
...
@@ -49,41 +49,87 @@ class Upload extends Component {
let
length
=
acceptedFiles
[
0
].
name
.
split
(
"."
).
length
let
fileType
=
acceptedFiles
[
0
].
name
.
split
(
"."
)[
length
-
1
]
formData
.
append
(
'file'
,
acceptedFiles
[
0
])
console
.
log
(
acceptedFiles
);
if
(
acceptedFiles
)
{
console
.
log
(
fileType
);
if
(
this
.
props
.
intent
===
'management'
)
{
if
(
acceptedFiles
)
{
if
(
this
.
props
.
acceptedFiles
.
includes
(
fileType
))
{
if
(
this
.
state
.
sizeFile
<
10000
)
{
this
.
setState
({
file
:
acceptedFiles
[
0
],
typeFile
:
fileType
,
nameFile
:
acceptedFiles
[
0
].
name
,
sizeFile
:
(
acceptedFiles
[
0
].
size
/
1000
).
toFixed
(
0
),
previewVisible
:
true
,
inputVisible
:
false
,
uploadProgress
:
false
,
percentage
:
'0'
})
this
.
props
.
onHandle
(
acceptedFiles
[
0
])
}
else
{
this
.
setState
({
alertMessage
:
'The file is too large. Allowed maximum size is 10MB'
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
}
}
else
{
this
.
setState
({
alertMessage
:
'File extension not allowed.'
,
alert
:
true
})
// alert('File Tidak Mendukung')
}
}
else
{
this
.
setState
({
previewVisible
:
false
,
inputVisible
:
true
,
uploadProgress
:
false
,
percentage
:
'0'
})
this
.
setState
({
alertMessage
:
"File extension not allowed."
,
alert
:
true
})
// alert("Unsupported Media Type")
}
}
else
{
if
(
acceptedFiles
)
{
this
.
setState
({
file
:
acceptedFiles
[
0
],
typeFile
:
fileType
,
nameFile
:
acceptedFiles
[
0
].
name
,
sizeFile
:
(
acceptedFiles
[
0
].
size
/
1000
).
toFixed
(
0
),
previewVisible
:
true
,
inputVisible
:
false
,
uploadProgress
:
false
,
percentage
:
'0'
})
this
.
props
.
onHandle
(
acceptedFiles
[
0
])
}
else
{
this
.
setState
({
previewVisible
:
false
,
inputVisible
:
true
,
uploadProgress
:
false
,
percentage
:
'0'
})
this
.
setState
({
alertMessage
:
"File extension not allowed."
,
alert
:
true
})
// alert("Unsupported Media Type")
}
}
}
onRemove
=
()
=>
{
if
(
this
.
props
.
intent
===
"management"
)
{
this
.
setState
({
file
:
acceptedFiles
[
0
],
typeFile
:
fileType
,
nameFile
:
acceptedFiles
[
0
].
name
,
sizeFile
:
(
acceptedFiles
[
0
].
size
/
1000
).
toFixed
(
0
),
previewVisible
:
true
,
inputVisible
:
false
,
previewVisible
:
false
,
inputVisible
:
true
,
uploadProgress
:
false
,
percentage
:
'0'
})
this
.
props
.
onHandle
(
acceptedFiles
[
0
])
}
else
{
this
.
props
.
onDelete
(
"delete"
)
}
else
{
this
.
setState
({
previewVisible
:
false
,
inputVisible
:
true
,
uploadProgress
:
false
,
percentage
:
'0'
})
this
.
setState
({
alertMessage
:
"File extension not allowed."
,
alert
:
true
})
// alert("Unsupported Media Type")
}
}
onRemove
=
()
=>
{
this
.
setState
({
previewVisible
:
false
,
inputVisible
:
true
,
uploadProgress
:
false
,
percentage
:
'0'
})
}
onUpload
=
()
=>
{
// this.props.onUpload()
var
strProps
=
this
.
props
.
acceptedFiles
...
...
@@ -92,11 +138,20 @@ class Upload extends Component {
// console.log(strState);
if
(
strProps
.
includes
(
strState
))
{
if
(
this
.
state
.
sizeFile
<
1000
)
{
this
.
props
.
onUpload
()
if
(
this
.
props
.
intent
===
'management'
)
{
if
(
this
.
state
.
sizeFile
<
10000
)
{
this
.
props
.
onUpload
()
}
else
{
this
.
setState
({
alertMessage
:
'The file is too large. Allowed maximum size is 10MB'
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
}
}
else
{
this
.
setState
({
alertMessage
:
'The file is too large. Allowed maximum size is 1MB'
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
if
(
this
.
state
.
sizeFile
<
1000
)
{
this
.
props
.
onUpload
()
}
else
{
this
.
setState
({
alertMessage
:
'The file is too large. Allowed maximum size is 1MB'
,
alert
:
true
})
// alert('File Tidak Boleh Lebih Dari 1MB')
}
}
}
else
{
this
.
setState
({
alertMessage
:
'File extension not allowed.'
,
alert
:
true
})
...
...
@@ -171,8 +226,8 @@ class Upload extends Component {
onClick
=
{
this
.
state
.
uploadProgress
===
true
?
null
:
this
.
onUpload
}
>
{
/*<i className={this.state.iconButtonUpload} />*/
}
{
this
.
state
.
uploadProgress
===
true
?
<
i
className
=
{
'fa fa-1x fa-spinner fa-spin'
}
/>
:
<
img
src
=
{
Images
.
upload
}
/>
}
?
<
i
className
=
{
'fa fa-1x fa-spinner fa-spin'
}
/> :
this.props.intent === 'management'
?
null
:
<
img
src
=
{
Images
.
upload
}
/>
}
<
/button
>
<
/div
>
)
:
null
}
...
...
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