Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
I
Internship UKSW 2019 document-management
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Internship UKSW 2019
Internship UKSW 2019 document-management
Commits
d86e9c9a
Commit
d86e9c9a
authored
Mar 10, 2020
by
Internship UKSW 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parent
005bde6a
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
135 additions
and
69 deletions
+135
-69
index.html
public/index.html
+15
-0
logo-visionet.png
public/logo-visionet.png
+0
-0
DataTableApprovalDocument.js
src/DataTableApprovalDocument.js
+3
-0
DataTableHome.js
src/DataTableHome.js
+3
-0
DataTableManageUser.js
src/DataTableManageUser.js
+3
-0
DataTableMyDocument.js
src/DataTableMyDocument.js
+3
-0
FormApproverDocument.js
src/FormApproverDocument.js
+39
-25
FormCreateDocument.js
src/FormCreateDocument.js
+28
-17
FormLogin.js
src/FormLogin.js
+1
-1
FormRevisionDocument.js
src/FormRevisionDocument.js
+39
-25
Navbar.js
src/Navbar.js
+1
-1
No files found.
public/index.html
View file @
d86e9c9a
...
...
@@ -32,12 +32,27 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<style>
.footer
{
position
:
fixed
;
left
:
0
;
bottom
:
0
;
height
:
35px
;
width
:
100%
;
background-color
:
rgb
(
80
,
80
,
80
);
color
:
white
;
text-align
:
center
;
}
</style>
<title>
Document Management
</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div
id=
"root"
></div>
<div
class=
"footer"
>
<p
class=
"py-1"
>
(c) 2020 - PT Visionet Data Internasional
</p>
</div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
...
...
public/logo-visionet.png
View replaced file @
005bde6a
View file @
d86e9c9a
4.93 KB
|
W:
|
H:
3.67 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/DataTableApprovalDocument.js
View file @
d86e9c9a
...
...
@@ -8,6 +8,9 @@ export class DataTableApprovalDocument extends Component {
componentDidMount
=
()
=>
{
this
.
$el
=
$
(
this
.
el
)
var
table
=
this
.
$el
.
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
props
.
data
,
columns
:
[
{
title
:
"No"
,
width
:
30
},
...
...
src/DataTableHome.js
View file @
d86e9c9a
...
...
@@ -7,6 +7,9 @@ export class DataTableHome extends Component {
componentDidMount
=
()
=>
{
this
.
$el
=
$
(
this
.
el
)
var
table
=
this
.
$el
.
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
props
.
data
,
columns
:
[
{
title
:
"No"
,
width
:
30
},
...
...
src/DataTableManageUser.js
View file @
d86e9c9a
...
...
@@ -8,6 +8,9 @@ export class DataTableManageUser extends Component {
componentDidMount
=
()
=>
{
this
.
$el
=
$
(
this
.
el
)
var
table
=
this
.
$el
.
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
props
.
data
,
columns
:
[
{
title
:
"No"
,
width
:
30
},
...
...
src/DataTableMyDocument.js
View file @
d86e9c9a
...
...
@@ -8,6 +8,9 @@ export class DataTableMyDocument extends Component {
componentDidMount
=
()
=>
{
this
.
$el
=
$
(
this
.
el
)
var
table
=
this
.
$el
.
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
props
.
data
,
columns
:
[
{
title
:
"No"
,
width
:
30
},
...
...
src/FormApproverDocument.js
View file @
d86e9c9a
...
...
@@ -9,6 +9,7 @@ import './DocumentManagement.css';
const
$
=
require
(
'jquery'
);
$
.
DataTable
=
require
(
'datatables.net'
);
var
tableScope
,
tableReference
;
class
FormApprover
extends
Component
{
constructor
(
props
)
{
...
...
@@ -25,6 +26,8 @@ class FormApprover extends Component {
pageReject
:
false
,
pageScope
:
false
,
pageReference
:
false
,
isTableScopeDraw
:
false
,
isTableReferenceDraw
:
false
,
dataRevisionHistory
:
[],
dataAuditTrail
:
[],
remark
:
""
,
...
...
@@ -82,7 +85,7 @@ class FormApprover extends Component {
let
dataRevision
=
responseDataRevision
.
data
.
revisionCollection
.
revision
;
// Check is user valid to open the document
if
(
dataRevision
[
dataRevision
.
length
-
1
].
status
==
"Waiting for Approval - "
+
JSON
.
parse
(
localStorage
.
getItem
(
"dataLogin"
)).
user_name
||
dataRevision
[
dataRevision
.
length
-
1
].
status
==
"Waiting for Approval - "
+
JSON
.
parse
(
localStorage
.
getItem
(
"dataLogin"
)).
user_name
||
dataRevision
[
dataRevision
.
length
-
1
].
status
==
"Waiting for Approval - Compliance Officer"
||
dataRevision
[
dataRevision
.
length
-
1
].
status
==
"Waiting for Approval - Manager Representative"
)
{
...
...
@@ -223,9 +226,9 @@ class FormApprover extends Component {
}
}
if
(
checked
)
{
datarow
.
push
(
1
);
datarow
.
push
(
dataDepartmentList
[
i
].
DepartmentCode
[
0
]
+
"-"
+
dataDepartmentList
[
i
].
Department
[
0
]
+
" true"
);
}
else
{
datarow
.
push
(
0
);
datarow
.
push
(
dataDepartmentList
[
i
].
DepartmentCode
[
0
]
+
"-"
+
dataDepartmentList
[
i
].
Department
[
0
]
+
" false"
);
}
this
.
state
.
dataScopes
.
push
(
datarow
);
}
...
...
@@ -250,16 +253,18 @@ class FormApprover extends Component {
}
}
if
(
checked
)
{
datarow
.
push
(
1
);
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]
+
" true"
);
}
else
{
datarow
.
push
(
0
);
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]
+
" false"
);
}
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]);
this
.
state
.
dataReferences
.
push
(
datarow
);
}
}
}
var
tableScope
=
$
(
'#tableScope'
).
DataTable
({
tableScope
=
$
(
'#tableScope'
).
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
state
.
dataScopes
,
columns
:
[
{
title
:
"Department"
},
...
...
@@ -277,11 +282,10 @@ class FormApprover extends Component {
orderable
:
false
,
targets
:
1
,
render
:
function
(
data
,
type
,
row
)
{
return
"<input type='checkbox' name='listAddScope[]' "
+
((
data
==
1
)
?
"checked"
:
""
)
+
" value='"
+
data
+
"'/>"
;
return
"<input type='checkbox' name='listAddScope[]' "
+
((
data
.
includes
(
"true"
)
)
?
"checked"
:
""
)
+
" value='"
+
data
+
"'/>"
;
}
}
],
lengthMenu
:
[[
25
,
50
,
75
,
100
],
[
25
,
50
,
75
,
100
]]
]
})
tableScope
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
...
...
@@ -303,17 +307,17 @@ class FormApprover extends Component {
let
data
=
tableScope
.
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
let
listAddScope
=
document
.
getElementsByName
(
"listAddScope[]"
);
for
(
let
i
=
0
;
i
<
listAddScope
.
length
;
i
++
)
{
if
(
listAddScope
[
i
].
value
==
data
[
0
]
)
{
if
(
listAddScope
[
i
].
value
.
includes
(
data
[
0
])
)
{
if
(
listAddScope
[
i
].
checked
)
{
listAddScope
[
i
].
checked
=
false
;
let
j
=
self
.
state
.
copyScopes
.
indexOf
(
listAddScope
[
i
].
value
);
let
j
=
self
.
state
.
copyScopes
.
indexOf
(
data
[
0
]
);
self
.
state
.
copyScopes
.
splice
(
j
,
1
);
if
(
self
.
state
.
copyScopes
.
length
==
0
)
{
self
.
state
.
validAddScope
=
false
;
}
}
else
{
listAddScope
[
i
].
checked
=
true
;
self
.
state
.
copyScopes
.
push
(
listAddScope
[
i
].
value
);
self
.
state
.
copyScopes
.
push
(
data
[
0
]
);
self
.
state
.
validAddScope
=
true
;
}
self
.
setState
({
validAddScope
:
self
.
state
.
validAddScope
});
...
...
@@ -321,7 +325,10 @@ class FormApprover extends Component {
}
}
})
var
tableReference
=
$
(
'#tableReference'
).
DataTable
({
tableReference
=
$
(
'#tableReference'
).
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
state
.
dataReferences
,
columns
:
[
{
title
:
"Code"
},
...
...
@@ -363,11 +370,10 @@ class FormApprover extends Component {
orderable
:
false
,
targets
:
4
,
render
:
function
(
data
,
type
,
row
)
{
return
"<input type='checkbox' name='listReference[]' "
+
((
data
==
1
)
?
"checked"
:
""
)
+
" value='"
+
data
+
"'/>"
;
return
"<input type='checkbox' name='listReference[]' "
+
((
data
.
includes
(
"true"
)
)
?
"checked"
:
""
)
+
" value='"
+
data
+
"'/>"
;
}
}
],
lengthMenu
:
[[
25
,
50
,
75
,
100
],
[
25
,
50
,
75
,
100
]]
]
})
tableReference
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
...
...
@@ -389,17 +395,17 @@ class FormApprover extends Component {
let
data
=
tableReference
.
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
let
listReference
=
document
.
getElementsByName
(
"listReference[]"
);
for
(
let
i
=
0
;
i
<
listReference
.
length
;
i
++
)
{
if
(
listReference
[
i
].
value
==
data
[
1
]
)
{
if
(
listReference
[
i
].
value
.
includes
(
data
[
1
])
)
{
if
(
listReference
[
i
].
checked
)
{
listReference
[
i
].
checked
=
false
;
let
j
=
self
.
state
.
copyReferences
.
indexOf
(
listReference
[
i
].
value
);
let
j
=
self
.
state
.
copyReferences
.
indexOf
(
data
[
1
]
);
self
.
state
.
copyReferences
.
splice
(
j
,
1
);
if
(
self
.
state
.
copyReferences
.
length
==
0
)
{
self
.
state
.
validAddReference
=
false
;
}
}
else
{
listReference
[
i
].
checked
=
true
;
self
.
state
.
copyReferences
.
push
(
listReference
[
i
].
value
);
self
.
state
.
copyReferences
.
push
(
data
[
1
]
);
self
.
state
.
validAddReference
=
true
;
}
self
.
setState
({
validAddReference
:
self
.
state
.
validAddReference
});
...
...
@@ -941,12 +947,16 @@ class FormApprover extends Component {
}
}
}
changePageScope
=
()
=>
{
changePageScope
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageScope
=
this
.
state
.
pageScope
;
clonePage
[
2
]
=
!
this
.
state
.
page
[
2
];
clonePageScope
=
!
this
.
state
.
pageScope
;
this
.
setState
({
page
:
clonePage
,
pageScope
:
clonePageScope
})
await
this
.
setState
({
page
:
clonePage
,
pageScope
:
clonePageScope
})
if
(
!
this
.
state
.
isTableScopeDraw
)
{
tableScope
.
columns
.
adjust
().
draw
();
this
.
setState
({
isTableScopeDraw
:
true
});
}
}
//fungsi halaman add scope
handleSubmitScope
=
async
()
=>
{
...
...
@@ -1013,12 +1023,16 @@ class FormApprover extends Component {
}
}
}
changePageReference
=
()
=>
{
changePageReference
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageReference
=
this
.
state
.
pageReference
;
clonePage
[
3
]
=
!
this
.
state
.
page
[
3
];
clonePageReference
=
!
this
.
state
.
pageReference
;
this
.
setState
({
page
:
clonePage
,
pageReference
:
clonePageReference
});
await
this
.
setState
({
page
:
clonePage
,
pageReference
:
clonePageReference
});
if
(
!
this
.
state
.
isTableReferenceDraw
)
{
tableReference
.
columns
.
adjust
().
draw
();
this
.
setState
({
isTableReferenceDraw
:
true
});
}
}
handleAddCode
=
(
subject
)
=>
{
let
code
;
...
...
@@ -1886,7 +1900,7 @@ class FormApprover extends Component {
<
div
className
=
"col-xl-12 col-lg-12 col-md-12 col-sm-12 text-right"
>
<
Button
color
=
"primary"
onClick
=
{(
e
)
=>
this
.
changePage
(
e
,
"Back"
,
2
)}
>
&
nbsp
;{
this
.
state
.
labelChangePage
[
0
]}
&
nbsp
;
<
/Button>  
;
<
Button
color
=
"primary"
onClick
=
{(
e
)
=>
this
.
changePage
(
e
,
"Next"
,
2
)}
disabled
=
{
!
this
.
state
.
validPage
[
1
]}
>
<
Button
color
=
"primary"
onClick
=
{(
e
)
=>
this
.
changePage
(
e
,
"Next"
,
2
)}
disabled
=
{
!
this
.
state
.
validPage
[
1
]}
>
&
nbsp
;{
this
.
state
.
labelChangePage
[
1
]}
&
nbsp
;
<
/Button
>
<
/div
>
<
/div
>
...
...
src/FormCreateDocument.js
View file @
d86e9c9a
...
...
@@ -6,6 +6,7 @@ import './DocumentManagement.css';
const
$
=
require
(
'jquery'
);
$
.
DataTable
=
require
(
'datatables.net'
);
var
tableScope
,
tableReference
;
class
FormCreate
extends
Component
{
constructor
(
props
)
{
...
...
@@ -17,6 +18,8 @@ class FormCreate extends Component {
optionScopes
:
[
"All Department"
],
pageScope
:
false
,
pageReference
:
false
,
isTableScopeDraw
:
false
,
isTableReferenceDraw
:
false
,
businessUnit
:
JSON
.
parse
(
localStorage
.
getItem
(
'dataLogin'
)).
user_dpt
[
0
],
//doc
documentType
:
""
,
//doc
revisionCode
:
"R0"
,
//doc
...
...
@@ -91,7 +94,10 @@ class FormCreate extends Component {
this
.
state
.
dataReferences
.
push
(
datarow
);
}
}
var
tableScope
=
$
(
'#tableScope'
).
DataTable
({
tableScope
=
$
(
'#tableScope'
).
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
state
.
dataScopes
,
columns
:
[
{
title
:
"Department"
},
...
...
@@ -112,8 +118,7 @@ class FormCreate extends Component {
return
"<input type='checkbox' name='listAddScope[]' value='"
+
data
+
"'/>"
;
}
}
],
lengthMenu
:
[[
25
,
50
,
75
,
100
],
[
25
,
50
,
75
,
100
]]
]
})
tableScope
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
...
...
@@ -153,7 +158,10 @@ class FormCreate extends Component {
}
}
})
var
tableReference
=
$
(
'#tableReference'
).
DataTable
({
tableReference
=
$
(
'#tableReference'
).
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
state
.
dataReferences
,
columns
:
[
{
title
:
"Code"
},
...
...
@@ -198,8 +206,7 @@ class FormCreate extends Component {
return
"<input type='checkbox' name='listReference[]' value='"
+
data
+
"'/>"
;
}
}
],
lengthMenu
:
[[
25
,
50
,
75
,
100
],
[
25
,
50
,
75
,
100
]]
]
})
tableReference
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
...
...
@@ -517,12 +524,16 @@ class FormCreate extends Component {
}
}
}
changePageScope
=
()
=>
{
changePageScope
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageScope
=
this
.
state
.
pageScope
;
clonePage
[
1
]
=
!
this
.
state
.
page
[
1
];
clonePageScope
=
!
this
.
state
.
pageScope
;
this
.
setState
({
page
:
clonePage
,
pageScope
:
clonePageScope
})
await
this
.
setState
({
page
:
clonePage
,
pageScope
:
clonePageScope
});
if
(
!
this
.
state
.
isTableScopeDraw
)
{
tableScope
.
columns
.
adjust
().
draw
();
this
.
setState
({
isTableScopeDraw
:
true
});
}
}
//fungsi halaman add scope
handleSubmitScope
=
async
()
=>
{
...
...
@@ -589,12 +600,16 @@ class FormCreate extends Component {
}
}
}
changePageReference
=
()
=>
{
changePageReference
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageReference
=
this
.
state
.
pageReference
;
clonePage
[
2
]
=
!
this
.
state
.
page
[
2
];
clonePageReference
=
!
this
.
state
.
pageReference
;
this
.
setState
({
page
:
clonePage
,
pageReference
:
clonePageReference
});
await
this
.
setState
({
page
:
clonePage
,
pageReference
:
clonePageReference
});
if
(
!
this
.
state
.
isTableReferenceDraw
)
{
tableReference
.
columns
.
adjust
().
draw
();
this
.
setState
({
isTableReferenceDraw
:
true
});
}
}
handleAddCode
=
(
subject
)
=>
{
let
code
;
...
...
@@ -1119,13 +1134,11 @@ class FormCreate extends Component {
}
<
/div
>
<
div
hidden
=
{
!
this
.
state
.
pageScope
}
>
<
div
className
=
"form-group"
>
<
table
className
=
"display"
width
=
"100%"
id
=
"tableScope"
><
/table
>
<
/div
>
<
table
className
=
"display"
width
=
"100%"
id
=
"tableScope"
><
/table
>
<
div
className
=
"form-group row"
>
<
div
className
=
"col-xl-12 col-lg-12 col-md-12 col-sm-12 text-right"
>
<
Button
color
=
"danger"
onClick
=
{()
=>
this
.
changePageScope
()}
>&
nbsp
;
Cancel
&
nbsp
;
<
/Button>  
;
<
Button
color
=
"success"
onClick
=
{()
=>
this
.
handleSubmitScope
()}
disabled
=
{
!
this
.
state
.
validAddScope
}
>&
nbsp
;
&
nbsp
;
Add
&
nbsp
;
&
nbsp
;
<
/Button
>
<
Button
color
=
"success"
onClick
=
{()
=>
this
.
handleSubmitScope
()}
disabled
=
{
!
this
.
state
.
validAddScope
}
>&
nbsp
;
&
nbsp
;
Add
&
nbsp
;
&
nbsp
;
<
/Button
>
<
/div
>
<
/div
>
<
/div
>
...
...
@@ -1181,9 +1194,7 @@ class FormCreate extends Component {
}
<
/div
>
<
div
hidden
=
{
!
this
.
state
.
pageReference
}
>
<
div
className
=
"form-group"
>
<
table
className
=
"display"
width
=
"100%"
id
=
"tableReference"
><
/table
>
<
/div
>
<
table
className
=
"display"
width
=
"100%"
id
=
"tableReference"
><
/table
>
<
div
className
=
"form-group row"
>
<
div
className
=
"col-xl-12 col-lg-12 col-md-12 col-sm-12 text-right"
>
<
Button
color
=
"danger"
onClick
=
{()
=>
this
.
changePageReference
()}
>&
nbsp
;
Cancel
&
nbsp
;
<
/Button>  
;
...
...
src/FormLogin.js
View file @
d86e9c9a
...
...
@@ -91,7 +91,7 @@ class FormLogin extends Component {
return
(
<
div
>
<
Navbar
color
=
"dark"
dark
expand
=
"lg"
>
<
NavbarBrand
href
=
"/"
><
img
src
=
"logo-visionet.png"
alt
=
"visionet"
width
=
"1
40px"
height
=
"70px"
/><
/NavbarBrand
>
<
NavbarBrand
href
=
"/"
><
img
src
=
"logo-visionet.png"
alt
=
"visionet"
width
=
"1
60px"
height
=
"45px"
/><
/NavbarBrand
>
<
/Navbar
>
<
div
className
=
"login-form"
>
<
div
className
=
"container"
>
...
...
src/FormRevisionDocument.js
View file @
d86e9c9a
...
...
@@ -9,6 +9,7 @@ import './DocumentManagement.css';
const
$
=
require
(
'jquery'
);
$
.
DataTable
=
require
(
'datatables.net'
);
var
tableScope
,
tableReference
;
class
FormRevision
extends
Component
{
constructor
(
props
)
{
...
...
@@ -24,6 +25,8 @@ class FormRevision extends Component {
optionScopes
:
[
"All Department"
],
pageScope
:
false
,
pageReference
:
false
,
isTableScopeDraw
:
false
,
isTableReferenceDraw
:
false
,
dataRevisionHistory
:
[],
dataAuditTrail
:
[],
remark
:
""
,
...
...
@@ -129,7 +132,7 @@ class FormRevision extends Component {
if
(
revisionDate
.
includes
(
"+00:00"
))
{
revisionDate
=
revisionDate
.
replace
(
"+00:00"
,
""
);
}
if
(
dataRevision
[
dataRevision
.
length
-
1
].
status
.
includes
(
"Waiting for Approval"
))
{
if
(
dataRevision
[
dataRevision
.
length
-
1
].
status
.
includes
(
"Waiting for Approval"
))
{
revisionDate
=
"-"
;
}
if
(
effectiveDate
.
includes
(
"+00:00"
))
{
...
...
@@ -218,9 +221,9 @@ class FormRevision extends Component {
}
}
if
(
checked
)
{
datarow
.
push
(
1
);
datarow
.
push
(
dataDepartmentList
[
i
].
DepartmentCode
[
0
]
+
"-"
+
dataDepartmentList
[
i
].
Department
[
0
]
+
" true"
);
}
else
{
datarow
.
push
(
0
);
datarow
.
push
(
dataDepartmentList
[
i
].
DepartmentCode
[
0
]
+
"-"
+
dataDepartmentList
[
i
].
Department
[
0
]
+
" false"
);
}
this
.
state
.
dataScopes
.
push
(
datarow
);
}
...
...
@@ -245,16 +248,18 @@ class FormRevision extends Component {
}
}
if
(
checked
)
{
datarow
.
push
(
1
);
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]
+
" true"
);
}
else
{
datarow
.
push
(
0
);
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]
+
" false"
);
}
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]);
this
.
state
.
dataReferences
.
push
(
datarow
);
}
}
}
var
tableScope
=
$
(
'#tableScope'
).
DataTable
({
tableScope
=
$
(
'#tableScope'
).
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
state
.
dataScopes
,
columns
:
[
{
title
:
"Department"
},
...
...
@@ -267,16 +272,15 @@ class FormRevision extends Component {
return
"<a class='text-decoration-none text-dark' href='#'>"
+
data
+
"</a>"
;
}
},
{
{
className
:
'select-checkbox'
,
orderable
:
false
,
targets
:
1
,
render
:
function
(
data
,
type
,
row
)
{
return
"<input type='checkbox' name='listAddScope[]' "
+
((
data
==
1
)
?
"checked"
:
""
)
+
" value='"
+
data
+
"'/>"
;
return
"<input type='checkbox' name='listAddScope[]' "
+
((
data
.
includes
(
"true"
)
)
?
"checked"
:
""
)
+
" value='"
+
data
+
"'/>"
;
}
}
],
lengthMenu
:
[[
25
,
50
,
75
,
100
],
[
25
,
50
,
75
,
100
]]
]
})
tableScope
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
...
...
@@ -298,17 +302,17 @@ class FormRevision extends Component {
let
data
=
tableScope
.
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
let
listAddScope
=
document
.
getElementsByName
(
"listAddScope[]"
);
for
(
let
i
=
0
;
i
<
listAddScope
.
length
;
i
++
)
{
if
(
listAddScope
[
i
].
value
==
data
[
0
]
)
{
if
(
listAddScope
[
i
].
value
.
includes
(
data
[
0
])
)
{
if
(
listAddScope
[
i
].
checked
)
{
listAddScope
[
i
].
checked
=
false
;
let
j
=
self
.
state
.
copyScopes
.
indexOf
(
listAddScope
[
i
].
value
);
let
j
=
self
.
state
.
copyScopes
.
indexOf
(
data
[
0
]
);
self
.
state
.
copyScopes
.
splice
(
j
,
1
);
if
(
self
.
state
.
copyScopes
.
length
==
0
)
{
self
.
state
.
validAddScope
=
false
;
}
}
else
{
listAddScope
[
i
].
checked
=
true
;
self
.
state
.
copyScopes
.
push
(
listAddScope
[
i
].
value
);
self
.
state
.
copyScopes
.
push
(
data
[
0
]
);
self
.
state
.
validAddScope
=
true
;
}
self
.
setState
({
validAddScope
:
self
.
state
.
validAddScope
});
...
...
@@ -316,7 +320,10 @@ class FormRevision extends Component {
}
}
})
var
tableReference
=
$
(
'#tableReference'
).
DataTable
({
tableReference
=
$
(
'#tableReference'
).
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
state
.
dataReferences
,
columns
:
[
{
title
:
"Code"
},
...
...
@@ -358,11 +365,10 @@ class FormRevision extends Component {
orderable
:
false
,
targets
:
4
,
render
:
function
(
data
,
type
,
row
)
{
return
"<input type='checkbox' name='listReference[]' "
+
((
data
==
1
)
?
"checked"
:
""
)
+
" value='"
+
data
+
"'/>"
;
return
"<input type='checkbox' name='listReference[]' "
+
((
data
.
includes
(
"true"
)
)
?
"checked"
:
""
)
+
" value='"
+
data
+
"'/>"
;
}
}
],
lengthMenu
:
[[
25
,
50
,
75
,
100
],
[
25
,
50
,
75
,
100
]]
]
})
tableReference
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
...
...
@@ -384,17 +390,17 @@ class FormRevision extends Component {
let
data
=
tableReference
.
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
let
listReference
=
document
.
getElementsByName
(
"listReference[]"
);
for
(
let
i
=
0
;
i
<
listReference
.
length
;
i
++
)
{
if
(
listReference
[
i
].
value
==
data
[
1
]
)
{
if
(
listReference
[
i
].
value
.
includes
(
data
[
1
])
)
{
if
(
listReference
[
i
].
checked
)
{
listReference
[
i
].
checked
=
false
;
let
j
=
self
.
state
.
copyReferences
.
indexOf
(
listReference
[
i
].
value
);
let
j
=
self
.
state
.
copyReferences
.
indexOf
(
data
[
1
]
);
self
.
state
.
copyReferences
.
splice
(
j
,
1
);
if
(
self
.
state
.
copyReferences
.
length
==
0
)
{
self
.
state
.
validAddReference
=
false
;
}
}
else
{
listReference
[
i
].
checked
=
true
;
self
.
state
.
copyReferences
.
push
(
listReference
[
i
].
value
);
self
.
state
.
copyReferences
.
push
(
data
[
1
]
);
self
.
state
.
validAddReference
=
true
;
}
self
.
setState
({
validAddReference
:
self
.
state
.
validAddReference
});
...
...
@@ -687,12 +693,16 @@ class FormRevision extends Component {
}
}
}
changePageScope
=
()
=>
{
changePageScope
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageScope
=
this
.
state
.
pageScope
;
clonePage
[
2
]
=
!
this
.
state
.
page
[
2
];
clonePageScope
=
!
this
.
state
.
pageScope
;
this
.
setState
({
page
:
clonePage
,
pageScope
:
clonePageScope
})
await
this
.
setState
({
page
:
clonePage
,
pageScope
:
clonePageScope
});
if
(
!
this
.
state
.
isTableScopeDraw
)
{
tableScope
.
columns
.
adjust
().
draw
();
this
.
setState
({
isTableScopeDraw
:
true
});
}
}
//fungsi halaman add scope
handleSubmitScope
=
async
()
=>
{
...
...
@@ -759,12 +769,16 @@ class FormRevision extends Component {
}
}
}
changePageReference
=
()
=>
{
changePageReference
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageReference
=
this
.
state
.
pageReference
;
clonePage
[
3
]
=
!
this
.
state
.
page
[
3
];
clonePageReference
=
!
this
.
state
.
pageReference
;
this
.
setState
({
page
:
clonePage
,
pageReference
:
clonePageReference
});
await
this
.
setState
({
page
:
clonePage
,
pageReference
:
clonePageReference
});
if
(
!
this
.
state
.
isTableReferenceDraw
)
{
tableReference
.
columns
.
adjust
().
draw
();
this
.
setState
({
isTableReferenceDraw
:
true
});
}
}
handleAddCode
=
(
subject
)
=>
{
let
code
;
...
...
src/Navbar.js
View file @
d86e9c9a
...
...
@@ -132,7 +132,7 @@ class Navbar1 extends Component {
<
/div
>
<
/div
>
<
Navbar
color
=
"dark"
dark
expand
=
"lg"
>
<
NavbarBrand
href
=
"#"
><
img
src
=
"logo-visionet.png"
alt
=
"visionet"
width
=
"1
40px"
height
=
"70
px"
/><
/NavbarBrand
>
<
NavbarBrand
href
=
"#"
><
img
src
=
"logo-visionet.png"
alt
=
"visionet"
width
=
"1
60px"
height
=
"45
px"
/><
/NavbarBrand
>
<
NavbarToggler
onClick
=
{
this
.
toggle
}
/
>
<
Collapse
isOpen
=
{
this
.
state
.
isOpen
}
navbar
>
<
Nav
className
=
"mr-auto"
navbar
>
...
...
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