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
1b49c58d
Commit
1b49c58d
authored
Aug 16, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update didam
parent
f666c1cd
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
3907 additions
and
212 deletions
+3907
-212
package-lock.json
package-lock.json
+3546
-135
index.js
src/api/index.js
+5
-4
VisualisasiAM.js
src/container/ApprovalMatrix/VisualisasiAM.js
+21
-9
Home.js
src/container/Home.js
+19
-3
User.js
src/container/Otorisasi/User.js
+5
-3
AddUser.js
src/container/Otorisasi/User/AddUser.js
+157
-29
EditUser.js
src/container/Otorisasi/User/EditUser.js
+154
-29
No files found.
package-lock.json
View file @
1b49c58d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/api/index.js
View file @
1b49c58d
...
...
@@ -90,6 +90,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getPerusahaan
=
()
=>
api
.
get
(
'company/get_all_company'
)
const
createPerusahaan
=
(
body
)
=>
api
.
post
(
'/company/create_company'
,
body
)
const
updatePerusahaan
=
(
body
)
=>
api
.
post
(
'/company/update_company'
,
body
)
const
getPerusahaanHierarki
=
()
=>
api
.
get
(
'company/get_company_hierarki'
)
// APPROVAL MATRIX
const
getAM
=
()
=>
api
.
get
(
'approval_matrix/get_all_approval_matrix'
)
...
...
@@ -104,10 +105,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getUser
=
()
=>
api
.
get
(
'user/get_all_user'
)
const
getDetailUser
=
(
userId
)
=>
api
.
get
(
`user/get_user_by_id/
${
userId
}
`
)
const
searchUser
=
(
body
)
=>
api
.
post
(
'user/search_user'
,
body
)
const
createUser
=
(
body
)
=>
api
.
ge
t
(
'user/create_user'
,
body
)
const
updateUser
=
(
body
)
=>
api
.
ge
t
(
'user/update_user'
,
body
)
const
createUser
=
(
body
)
=>
api
.
pos
t
(
'user/create_user'
,
body
)
const
updateUser
=
(
body
)
=>
api
.
pos
t
(
'user/update_user'
,
body
)
const
deleteUser
=
(
userId
)
=>
api
.
get
(
`user/delete_user/
${
userId
}
`
)
const
changePassword
=
(
body
)
=>
api
.
post
(
'/user/change_password'
,
body
)
//Template
...
...
@@ -161,7 +161,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
downloadTemplate
,
checkUploadUnitBisnis
,
uploadUnitBisnis
,
changePassword
changePassword
,
getPerusahaanHierarki
}
}
...
...
src/container/ApprovalMatrix/VisualisasiAM.js
View file @
1b49c58d
...
...
@@ -70,31 +70,44 @@ export default class VisualisasiAM extends Component {
api
.
create
().
searchAM
(
body
).
then
(
response
=>
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
console
.
log
(
data
)
let
listVisual
=
[]
data
.
map
((
item
,
index
)
=>
{
let
indexId
=
listVisual
.
findIndex
((
val
)
=>
val
.
order
s
==
item
.
orders
)
let
indexId
=
listVisual
.
findIndex
((
val
)
=>
val
.
order
Id
==
item
.
orders
)
if
(
indexId
==
-
1
){
listVisual
.
push
(
item
)
listVisual
.
push
({
orderId
:
item
.
orders
,
data
:
[
item
]
})
console
.
log
(
listVisual
);
}
else
{
return
listVisual
[
indexId
].
data
.
push
(
item
)
}
})
this
.
setState
({
listApproval
:
listVisual
,
typeData
:
response
.
data
.
data
})
console
.
log
(
data
);
this
.
setState
({
listApproval
:
listVisual
})
console
.
log
(
listVisual
);
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
handleChangeOrder
(
fromIndex
,
toIndex
,
that
)
{
let
listApproval
=
that
.
state
.
listApproval
listApproval
[
fromIndex
].
orderId
=
listApproval
[
toIndex
].
orderId
listApproval
[
toIndex
].
orderId
=
listApproval
[
fromIndex
].
orderId
console
.
log
(
fromIndex
,
toIndex
)
}
render
()
{
const
that
=
this
;
const
dragProps
=
{
onDragEnd
(
fromIndex
,
toIndex
)
{
const
data
=
[...
that
.
state
.
data
];
const
data
=
[...
that
.
state
.
listApproval
];
const
item
=
data
.
splice
(
fromIndex
,
1
)[
0
];
that
.
handleChangeOrder
(
fromIndex
,
toIndex
,
that
)
data
.
splice
(
toIndex
,
0
,
item
);
that
.
setState
({
data
});
that
.
setState
({
listApproval
:
data
});
},
nodeSelector
:
'li'
,
handleSelector
:
'a'
...
...
@@ -125,8 +138,7 @@ export default class VisualisasiAM extends Component {
<
ol
>
{
this
.
state
.
listApproval
.
map
((
item
,
index
)
=>
(
<
li
key
=
{
index
}
>
{
'urutan: '
+
item
.
orders
}
<
a
href
=
"#"
>
Drag
<
/a
>
<
a
href
=
"#"
>
{
`
${
item
.
data
.
map
((
items
,
indexs
)
=>
{
return
(
items
.
fullname
)})}
${
item
.
data
.
length
==
1
?
''
:
item
.
data
[
0
].
operator_type_name
}
`
}
<
/a
>
<
/li
>
))}
<
/ol
>
...
...
src/container/Home.js
View file @
1b49c58d
...
...
@@ -39,6 +39,7 @@ import { Avatar } from '@material-ui/core';
import
HomeRoutes
from
'../router/homeRoutes'
import
ArraySide
from
'../library/Array'
import
Constant
from
'../library/Constant'
;
import
api
from
'../api'
;
const
drawerWidth
=
307
;
...
...
@@ -126,10 +127,25 @@ export default function MiniDrawer() {
const
[
selectedIndex
,
setSelectedIndex
]
=
React
.
useState
([]);
const
[
selectedIndexs
,
setSelectedIndexs
]
=
React
.
useState
([]);
const
[
selectedSubIndex
,
setSelectSub
]
=
React
.
useState
([]);
const
[
userFullname
,
setUserFullname
]
=
React
.
useState
(
""
)
const
[
userEmail
,
setUserEmail
]
=
React
.
useState
(
""
)
React
.
useEffect
(()
=>
{
if
(
userFullname
==
""
&&
userEmail
==
""
)
{
getUserData
()
}
})
// React.useEffect(() => {
// //
// })
const
getUserData
=
()
=>
{
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
if
(
response
.
data
.
status
==
'success'
)
{
setUserFullname
(
response
.
data
.
data
.
fullname
==
null
?
'Anonym'
:
response
.
data
.
data
.
fullname
)
setUserEmail
(
response
.
data
.
data
.
email
==
null
?
'Anonym@123.xyz'
:
response
.
data
.
data
.
email
)
console
.
log
(
userEmail
)
}
})
}
const
handleDrawerOpen
=
()
=>
{
setOpen
(
true
);
...
...
src/container/Otorisasi/User.js
View file @
1b49c58d
...
...
@@ -172,7 +172,7 @@ export default class UserRole extends Component {
downloadFile
=
async
()
=>
{
let
res
=
await
fetch
(
"https://t
rft
ia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=UserTemplate&&fileType=xlsx"
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=UserTemplate&&fileType=xlsx"
)
res
=
await
res
.
blob
()
console
.
log
(
res
)
...
...
@@ -186,7 +186,7 @@ export default class UserRole extends Component {
}
downloadDataTables
=
async
()
=>
{
let
res
=
await
fetch
(
"https://t
rft
ia.eksad.com/tia-reporting-dev/public/user/export_user"
)
let
res
=
await
fetch
(
"https://tia.eksad.com/tia-reporting-dev/public/user/export_user"
)
res
=
await
res
.
blob
()
console
.
log
(
res
)
if
(
res
.
size
>
0
)
{
...
...
@@ -289,7 +289,7 @@ export default class UserRole extends Component {
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
{
/* <Row> */
}
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
199
,
width
:
'100%'
}}
/
>
<
div
style
=
{{
height
:
199
,
backgroundColor
:
'#354960'
,
width
:
'100%'
}}
/
>
{
this
.
state
.
visibleUser
?
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
label
style
=
{{
fontFamily
:
'nunito'
,
color
:
'white'
,
width
:
'20%'
,
alignSelf
:
'center'
,
fontSize
:
18
}}
>
Master
Data
-
User
<
/label
>
...
...
@@ -424,12 +424,14 @@ export default class UserRole extends Component {
{
this
.
state
.
add
&&
(
<
AddUser
onClickClose
=
{
this
.
closeAdd
.
bind
(
this
)}
refresh
=
{
this
.
getUser
.
bind
(
this
)}
data
=
{
this
.
state
.
indexData
}
/
>
)}
{
this
.
state
.
edit
&&
(
<
EditUser
onClickClose
=
{
this
.
closeEdit
.
bind
(
this
)}
refresh
=
{
this
.
getUser
.
bind
(
this
)}
data
=
{
this
.
state
.
indexData
}
/
>
)}
...
...
src/container/Otorisasi/User/AddUser.js
View file @
1b49c58d
This diff is collapsed.
Click to expand it.
src/container/Otorisasi/User/EditUser.js
View file @
1b49c58d
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