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
Hide 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 {
btndelete
:
false
,
load
:
false
,
name
:
''
,
userCompActive
:
[]
userCompActive
:
[],
isHasAccessDocument
:
false
,
}
}
getPermission
()
{
getPermission
(
subMenu
)
{
let
payload
=
{
menu
:
"document management"
menu
:
subMenu
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
//
console.log(response)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
...
...
@@ -60,28 +61,44 @@ export default class DocumentManagement extends Component {
}
selectTab
=
(
event
,
newEvent
)
=>
{
this
.
setState
({
tab
:
newEvent
})
console
.
log
(
this
.
state
.
tab
)
this
.
setState
({
tab
:
newEvent
},
()
=>
{
console
.
log
(
this
.
state
.
tab
)
this
.
getPermission
(
this
.
state
.
listData
[
this
.
state
.
tab
].
value
.
toLocaleLowerCase
())
})
}
componentDidMount
()
{
this
.
getDataDocument
()
this
.
getPermission
()
//
this.getPermission()
this
.
getDetailUser
()
}
getDataDocument
(
id
,
name
)
{
api
.
create
().
getDocumentCategory
().
then
(
response
=>
{
//
console.log(response);
console
.
log
(
response
);
if
(
response
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
listData
:
response
.
data
.
data
,
id
:
id
===
undefined
?
response
.
data
.
data
[
0
].
setting_id
:
id
,
name
:
name
===
undefined
?
response
.
data
.
data
[
0
].
value
:
name
,
loadTable
:
true
,
refresh
:
id
===
undefined
?
''
:
'create'
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
({
isHasAccessDocument
:
dataList
.
length
==
0
?
false
:
true
,
listData
:
dataList
,
id
:
id
===
undefined
?
dataList
[
0
].
setting_id
:
id
,
name
:
name
===
undefined
?
dataList
[
0
].
value
:
name
,
loadTable
:
true
,
refresh
:
id
===
undefined
?
''
:
'create'
},
()
=>
{
this
.
getPermission
(
dataList
[
0
].
value
)
})
}
}
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"
))
{
...
...
@@ -255,7 +272,7 @@ export default class DocumentManagement extends Component {
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Document
Management
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
loading
&&
loadingComponent
&&
this
.
state
.
isHasAccessDocument
}
<
Paper
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
{(
this
.
state
.
btncreate
)
&&
<
span
>
...
...
@@ -308,6 +325,11 @@ export default class DocumentManagement extends Component {
<
/div
>
<
/Paper
>
{
!
this
.
state
.
isHasAccessDocument
&&
(
<
Paper
style
=
{{
padding
:
20
}}
>
<
label
>
You
Don
't Have Any Access in Document Management</label>
</Paper>
)}
</div>
{this.state.konfirmasi && (
<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