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
84e6bd54
Commit
84e6bd54
authored
Jun 27, 2022
by
syadziy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update doc management
parent
f5b4e102
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
15 deletions
+37
-15
DocumentManagement.js
src/container/DocumentManagement/DocumentManagement.js
+37
-15
No files found.
src/container/DocumentManagement/DocumentManagement.js
View file @
84e6bd54
...
@@ -30,16 +30,17 @@ export default class DocumentManagement extends Component {
...
@@ -30,16 +30,17 @@ export default class DocumentManagement extends Component {
btndelete
:
false
,
btndelete
:
false
,
load
:
false
,
load
:
false
,
name
:
''
,
name
:
''
,
userCompActive
:
[]
userCompActive
:
[],
isHasAccessDocument
:
false
,
}
}
}
}
getPermission
()
{
getPermission
(
subMenu
)
{
let
payload
=
{
let
payload
=
{
menu
:
"document management"
menu
:
subMenu
}
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
//
console.log(response)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
this
.
setState
({
...
@@ -60,28 +61,44 @@ export default class DocumentManagement extends Component {
...
@@ -60,28 +61,44 @@ export default class DocumentManagement extends Component {
}
}
selectTab
=
(
event
,
newEvent
)
=>
{
selectTab
=
(
event
,
newEvent
)
=>
{
this
.
setState
({
tab
:
newEvent
}
)
this
.
setState
({
tab
:
newEvent
}
,
()
=>
{
console
.
log
(
this
.
state
.
tab
)
console
.
log
(
this
.
state
.
tab
)
this
.
getPermission
(
this
.
state
.
listData
[
this
.
state
.
tab
].
value
.
toLocaleLowerCase
())
})
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getDataDocument
()
this
.
getDataDocument
()
this
.
getPermission
()
//
this.getPermission()
this
.
getDetailUser
()
this
.
getDetailUser
()
}
}
getDataDocument
(
id
,
name
)
{
getDataDocument
(
id
,
name
)
{
api
.
create
().
getDocumentCategory
().
then
(
response
=>
{
api
.
create
().
getDocumentCategory
().
then
(
response
=>
{
//
console.log(response);
console
.
log
(
response
);
if
(
response
)
{
if
(
response
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataList
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
// if (item.value == "Manual Book TIA 4.0sss") {
dataList
.
push
(
item
)
// }
})
if
(
dataList
.
length
==
0
)
{
this
.
setState
({
isHasAccessDocument
:
dataList
.
length
==
0
?
false
:
true
})
}
else
{
this
.
setState
({
this
.
setState
({
listData
:
response
.
data
.
data
,
isHasAccessDocument
:
dataList
.
length
==
0
?
false
:
true
,
id
:
id
===
undefined
?
response
.
data
.
data
[
0
].
setting_id
:
id
,
listData
:
dataList
,
name
:
name
===
undefined
?
response
.
data
.
data
[
0
].
value
:
name
,
id
:
id
===
undefined
?
dataList
[
0
].
setting_id
:
id
,
name
:
name
===
undefined
?
dataList
[
0
].
value
:
name
,
loadTable
:
true
,
loadTable
:
true
,
refresh
:
id
===
undefined
?
''
:
'create'
refresh
:
id
===
undefined
?
''
:
'create'
},
()
=>
{
this
.
getPermission
(
dataList
[
0
].
value
)
})
})
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
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"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
...
@@ -255,7 +272,7 @@ export default class DocumentManagement extends Component {
...
@@ -255,7 +272,7 @@ export default class DocumentManagement extends Component {
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Document
Management
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Document
Management
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
padding
:
20
}}
>
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
loading
&&
loadingComponent
&&
this
.
state
.
isHasAccessDocument
}
<
Paper
style
=
{{
padding
:
20
}}
>
<
Paper
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
{(
this
.
state
.
btncreate
)
&&
<
span
>
{(
this
.
state
.
btncreate
)
&&
<
span
>
...
@@ -308,6 +325,11 @@ export default class DocumentManagement extends Component {
...
@@ -308,6 +325,11 @@ export default class DocumentManagement extends Component {
<
/div
>
<
/div
>
<
/Paper
>
<
/Paper
>
{
!
this
.
state
.
isHasAccessDocument
&&
(
<
Paper
style
=
{{
padding
:
20
}}
>
<
label
>
You
Don
't Have Any Access in Document Management</label>
</Paper>
)}
</div>
</div>
{this.state.konfirmasi && (
{this.state.konfirmasi && (
<PopUpKonfirmasi
<PopUpKonfirmasi
...
...
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