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
432c66e7
Commit
432c66e7
authored
Aug 16, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
Didam See merge request
!86
parents
33b53923
63abacad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
10 deletions
+45
-10
VisualisasiAM.js
src/container/ApprovalMatrix/VisualisasiAM.js
+45
-10
No files found.
src/container/ApprovalMatrix/VisualisasiAM.js
View file @
432c66e7
...
...
@@ -32,7 +32,9 @@ export default class VisualisasiAM extends Component {
visibleAM
:
false
,
visibleVisual
:
true
,
data
,
listApproval
:
[]
listApproval
:
[],
listEdit
:
[],
listOriginal
:
[]
}
}
...
...
@@ -84,7 +86,7 @@ export default class VisualisasiAM extends Component {
listVisual
[
indexId
].
data
.
push
(
item
)
}
})
this
.
setState
({
listApproval
:
listVisual
})
this
.
setState
({
listApproval
:
listVisual
})
console
.
log
(
listVisual
);
}
else
{
alert
(
response
.
data
.
message
)
...
...
@@ -94,9 +96,37 @@ export default class VisualisasiAM extends Component {
handleChangeOrder
(
fromIndex
,
toIndex
,
that
)
{
let
listApproval
=
that
.
state
.
listApproval
let
orderIdFrom
=
listApproval
[
fromIndex
].
orderId
listApproval
[
fromIndex
].
orderId
=
listApproval
[
toIndex
].
orderId
listApproval
[
toIndex
].
orderId
=
listApproval
[
fromIndex
].
orderId
console
.
log
(
fromIndex
,
toIndex
)
listApproval
[
toIndex
].
orderId
=
orderIdFrom
that
.
setState
({
listEdit
:
listApproval
})
}
handleSave
()
{
let
data
=
[]
this
.
state
.
listEdit
.
map
((
item
,
index
)
=>
{
item
.
data
.
map
((
items
,
index
)
=>
{
data
.
push
({
approval_matrix_id
:
items
.
approval_matrix_id
,
approval_type_id
:
items
.
approval_type_id
,
approval_type_name
:
items
.
approval_type_name
,
created
:
items
.
created
,
end_date
:
items
.
end_date
,
fullname
:
items
.
fullname
,
operator_type_id
:
items
.
operator_type_id
,
operator_type_name
:
items
.
operator_type_name
,
orders
:
item
.
orderId
,
start_date
:
items
.
start_date
,
status
:
items
.
status
,
updated
:
items
.
updated
,
user_id
:
items
.
user_id
})
})
})
setTimeout
(()
=>
{
this
.
setState
({
listOriginal
:
data
})
},
500
);
}
render
()
{
...
...
@@ -135,15 +165,20 @@ export default class VisualisasiAM extends Component {
/
>
<
/div
>
<
ReactDragListView
{...
dragProps
}
>
<
ol
>
<
ol
style
=
{{
paddingLeft
:
15
}}
>
{
this
.
state
.
listApproval
.
map
((
item
,
index
)
=>
(
<
li
key
=
{
index
}
>
<
a
href
=
"#"
>
{
`
${
item
.
data
.
map
((
items
,
indexs
)
=>
{
return
(
items
.
fullname
)})}
${
item
.
data
.
length
==
1
?
''
:
item
.
data
[
0
].
operator_type_name
}
`
}
<
/a
>
<
li
key
=
{
index
}
style
=
{{
color
:
'#525252'
,
fontSize
:
14
}}
>
<
a
href
=
"#"
style
=
{{
color
:
'#525252'
}}
>
<
div
className
=
"grid grid-3x grid-mobile-none gap-20px"
style
=
{{
width
:
'75%'
}}
>
{
item
.
data
.
map
((
items
,
indexs
)
=>
{
return
(
<
label
>
{
items
.
fullname
}
<
/label>
)
}
)
}
<
label
>
{
item
.
data
.
length
==
1
?
''
:
item
.
data
[
0
].
operator_type_name
}
<
/label
>
<
/div
>
<
/a
>
<
/li
>
))}
<
/ol
>
<
/ReactDragListView
>
<
div
className
=
"grid grid-4x grid-mobile-none gap-15px"
>
{
/*
<div className="grid grid-4x grid-mobile-none gap-15px">
<div className="column-1">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>1. John Doe</label>
...
...
@@ -155,7 +190,7 @@ export default class VisualisasiAM extends Component {
</div>
<div className="column-4">
</div>
<
/div
>
</div>
*/
}
<
div
className
=
"grid grid-4x grid-mobile-none gap-15px"
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-bottom-20px"
>
...
...
@@ -211,7 +246,7 @@ export default class VisualisasiAM extends Component {
<
div
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
cursor
:
"pointer"
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Batal
<
/span
>
<
/div
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
marginLeft
:
25
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
cursor
:
"pointer"
}}
>
<
div
onClick
=
{()
=>
this
.
handleSave
()}
style
=
{{
width
:
102
,
height
:
30
,
marginLeft
:
25
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
cursor
:
"pointer"
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Simpan
<
/span
>
<
/div
>
<
/div
>
...
...
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