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
e288c640
Commit
e288c640
authored
Feb 06, 2025
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chcm
parent
61b9db66
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1009 additions
and
1 deletion
+1009
-1
index.js
src/api/index.js
+4
-0
CafrmDocument.js
src/container/CAFRM/CafrmDocument.js
+1
-1
ChcmDocument.js
src/container/CHCM/ChcmDocument.js
+321
-0
CreateChcmDocument.js
src/container/CHCM/CreateChcmDocument.js
+459
-0
TableChcmDocument.js
src/container/CHCM/TableChcmDocument.js
+215
-0
homeRoutes.js
src/router/homeRoutes.js
+9
-0
No files found.
src/api/index.js
View file @
e288c640
...
...
@@ -492,6 +492,8 @@ const create = (type = "") => {
const
getDetailDocument
=
(
id
)
=>
api
.
get
(
`document/get_document_by_id/
${
id
}
`
)
const
deleteDocument
=
(
id
)
=>
api
.
post
(
`document/delete_document/
${
id
}
`
)
const
uploadCarfmDocument
=
(
body
)
=>
api
.
post
(
'document/upload_cafrm_document'
,
body
)
const
getChcmDocumentBySubmenu
=
(
body
)
=>
api
.
post
(
'document/get_chcm_document_by_submenu'
,
body
);
const
uploadChcmDocument
=
(
body
)
=>
api
.
post
(
'document/upload_chcm_document'
,
body
)
// Monitoring
...
...
@@ -673,6 +675,8 @@ const create = (type = "") => {
getAllDocument
,
uploadDocument
,
uploadCarfmDocument
,
getChcmDocumentBySubmenu
,
uploadChcmDocument
,
updateDocument
,
downloadDocument
,
getPerusahaanUserActive
,
...
...
src/container/CAFRM/CafrmDocument.js
View file @
e288c640
...
...
@@ -149,7 +149,7 @@ export default class CafrmDocument extends Component {
let
compActive
=
[]
let
userCompActive
=
[]
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
if
(
index
!==
-
1
&&
String
(
data
[
index
].
status
).
toLocaleLowerCase
()
==
'active'
){
if
(
index
!==
-
1
&&
String
(
data
[
index
]
?
.
status
).
toLocaleLowerCase
()
==
'active'
){
userCompActive
.
push
(
item
)
}
})
...
...
src/container/CHCM/ChcmDocument.js
0 → 100644
View file @
e288c640
This diff is collapsed.
Click to expand it.
src/container/CHCM/CreateChcmDocument.js
0 → 100644
View file @
e288c640
This diff is collapsed.
Click to expand it.
src/container/CHCM/TableChcmDocument.js
0 → 100644
View file @
e288c640
import
React
,
{
Component
}
from
'react'
;
import
api
from
"../../api"
;
import
Constant
from
"../../library/Constant"
;
import
Images
from
"../../assets/Images"
;
import
ReactTooltip
from
"react-tooltip"
;
import
PropagateLoader
from
"react-spinners/PropagateLoader"
;
import
{
createMuiTheme
,
MuiThemeProvider
,
Snackbar
}
from
"@material-ui/core"
;
import
MUIDataTable
from
"mui-datatables"
;
import
{
withStyles
}
from
"@material-ui/core/styles"
;
import
MuiAlert
from
"@material-ui/lab/Alert"
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
options
=
ct
.
customOptionsManagementDocument
();
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
TableChcmDocument
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[],
visibleCreate
:
false
,
refresh
:
''
,
alert
:
false
,
}
}
componentDidMount
()
{
this
.
getData
()
}
componentWillReceiveProps
(
props
)
{
// console.log(props);
const
{
refresh
}
=
this
.
props
;
if
(
props
.
refresh
!==
refresh
)
{
this
.
getData
()
}
}
getData
()
{
let
payload
=
{
"submenu_id"
:
this
.
props
.
submenu_id
}
this
.
setState
({
loading
:
true
})
api
.
create
().
getChcmDocumentBySubmenu
(
payload
).
then
(
response
=>
{
// console.log("table document carfm");
console
.
log
(
response
)
// console.log("table document carfm stop")
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
dataTable
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
let
indexId
=
this
.
props
.
userCompActive
.
findIndex
((
val
)
=>
val
==
item
.
company_id
)
if
(
indexId
!==
-
1
)
{
dataTable
.
push
(
[
index
,
item
.
document_name
,
item
.
description
,
item
.
company_name
,
item
.
document_month
,
item
.
document_periode
,
item
.
document_type
,
String
(
Number
(
item
.
document_size
)
/
1000
+
' KB'
),
item
.
created_by
,
item
.
created_at
,
item
.
values
])
}
})
let
docPath
=
response
.
data
.
data
.
map
((
item
)
=>
{
return
[
item
.
document_filepath
]
})
let
docId
=
response
.
data
.
data
.
map
((
item
)
=>
{
return
[
item
.
document_id
]
})
// console.log(dataTable)
this
.
setState
({
dataTable
,
docPath
,
docId
,
loading
:
false
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
console
.
log
(
"error di table document getcarfm 1"
);
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
else
{
console
.
log
(
"error di table document getcarfm 2"
);
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
openPopUp
=
async
(
index
,
val
,
type
)
=>
{
// console.log(index)
if
(
type
===
'download'
)
{
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/document/download_chcm_document?documentName=`
+
this
.
state
.
docPath
[
val
]
+
"&&fileType="
+
index
[
6
]
)
res
=
await
res
.
blob
()
// console.log(res)
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
(
String
(
index
[
3
]).
includes
(
":"
)
?
String
(
index
[
3
]).
replace
(
":"
,
" ("
)
+
` )`
:
String
(
index
[
3
]))
+
" - "
+
index
[
4
]
+
" - "
+
index
[
5
]
+
" - "
+
index
[
10
]
+
"."
+
index
[
6
];
a
.
click
();
}
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
let
columns
=
[{
name
:
"Action"
,
options
:
{
filter
:
false
,
sort
:
false
,
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
this
.
props
.
btndownload
&&
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginRight
:
15
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
val
,
'download'
)}
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/a>
}
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
}
},
{
name
:
"File Name"
,
options
:
{
display
:
false
}
},
"Description"
,
"Company Name"
,
"Period Month"
,
"Period Year"
,
"Type"
,
"File Size"
,
"Created By"
,
"Created Date"
,
{
name
:
"Category"
,
options
:
{
display
:
false
}
},
]
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
// css={override}
size
=
{
20
}
color
=
{
"#274B80"
}
loading
=
{
this
.
state
.
loading
}
/
>
<
/div
>
);
return
(
<
div
style
=
{{
width
:
'100%'
}}
>
{
this
.
props
.
load
&&
(
<
div
style
=
{{
padding
:
25
}}
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
{
this
.
state
.
loading
&&
loadingComponent
}
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
// theme={getMuiTheme()}
data
=
{
this
.
state
.
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
<
/div
>
)}
<
/div
>
)
}
}
src/router/homeRoutes.js
View file @
e288c640
...
...
@@ -25,6 +25,7 @@ import CafrmDocument from "../container/CAFRM/CafrmDocument";
import
ReportCafrm
from
"../container/ReportCarfm/RepotrCafrm"
;
import
Maintenance
from
"../container/Auth/Maintenance"
;
import
DownloadReport
from
"../container/DownloadReport/DownloadReport"
import
ChcmDocument
from
'../container/CHCM/ChcmDocument'
;
const
routes
=
[
{
...
...
@@ -139,6 +140,14 @@ const routes = [
path
:
"/home/download-report"
,
main
:
DownloadReport
},
{
path
:
"/home/report-talent-management-tm"
,
main
:
ChcmDocument
},
{
path
:
"/home/report-trec"
,
main
:
ChcmDocument
},
{
path
:
"*"
,
main
:
screen404
...
...
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