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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
96 additions
and
44 deletions
+96
-44
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
+0
-0
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 @@
...
@@ -32,12 +32,27 @@
work correctly both with client-side routing and a non-root public URL.
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`.
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>
<title>
Document Management
</title>
</head>
</head>
<body>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div
id=
"root"
></div>
<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.
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
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 {
...
@@ -8,6 +8,9 @@ export class DataTableApprovalDocument extends Component {
componentDidMount
=
()
=>
{
componentDidMount
=
()
=>
{
this
.
$el
=
$
(
this
.
el
)
this
.
$el
=
$
(
this
.
el
)
var
table
=
this
.
$el
.
DataTable
({
var
table
=
this
.
$el
.
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
props
.
data
,
data
:
this
.
props
.
data
,
columns
:
[
columns
:
[
{
title
:
"No"
,
width
:
30
},
{
title
:
"No"
,
width
:
30
},
...
...
src/DataTableHome.js
View file @
d86e9c9a
...
@@ -7,6 +7,9 @@ export class DataTableHome extends Component {
...
@@ -7,6 +7,9 @@ export class DataTableHome extends Component {
componentDidMount
=
()
=>
{
componentDidMount
=
()
=>
{
this
.
$el
=
$
(
this
.
el
)
this
.
$el
=
$
(
this
.
el
)
var
table
=
this
.
$el
.
DataTable
({
var
table
=
this
.
$el
.
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
props
.
data
,
data
:
this
.
props
.
data
,
columns
:
[
columns
:
[
{
title
:
"No"
,
width
:
30
},
{
title
:
"No"
,
width
:
30
},
...
...
src/DataTableManageUser.js
View file @
d86e9c9a
...
@@ -8,6 +8,9 @@ export class DataTableManageUser extends Component {
...
@@ -8,6 +8,9 @@ export class DataTableManageUser extends Component {
componentDidMount
=
()
=>
{
componentDidMount
=
()
=>
{
this
.
$el
=
$
(
this
.
el
)
this
.
$el
=
$
(
this
.
el
)
var
table
=
this
.
$el
.
DataTable
({
var
table
=
this
.
$el
.
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
props
.
data
,
data
:
this
.
props
.
data
,
columns
:
[
columns
:
[
{
title
:
"No"
,
width
:
30
},
{
title
:
"No"
,
width
:
30
},
...
...
src/DataTableMyDocument.js
View file @
d86e9c9a
...
@@ -8,6 +8,9 @@ export class DataTableMyDocument extends Component {
...
@@ -8,6 +8,9 @@ export class DataTableMyDocument extends Component {
componentDidMount
=
()
=>
{
componentDidMount
=
()
=>
{
this
.
$el
=
$
(
this
.
el
)
this
.
$el
=
$
(
this
.
el
)
var
table
=
this
.
$el
.
DataTable
({
var
table
=
this
.
$el
.
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
props
.
data
,
data
:
this
.
props
.
data
,
columns
:
[
columns
:
[
{
title
:
"No"
,
width
:
30
},
{
title
:
"No"
,
width
:
30
},
...
...
src/FormApproverDocument.js
View file @
d86e9c9a
This diff is collapsed.
Click to expand it.
src/FormCreateDocument.js
View file @
d86e9c9a
...
@@ -6,6 +6,7 @@ import './DocumentManagement.css';
...
@@ -6,6 +6,7 @@ import './DocumentManagement.css';
const
$
=
require
(
'jquery'
);
const
$
=
require
(
'jquery'
);
$
.
DataTable
=
require
(
'datatables.net'
);
$
.
DataTable
=
require
(
'datatables.net'
);
var
tableScope
,
tableReference
;
class
FormCreate
extends
Component
{
class
FormCreate
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -17,6 +18,8 @@ class FormCreate extends Component {
...
@@ -17,6 +18,8 @@ class FormCreate extends Component {
optionScopes
:
[
"All Department"
],
optionScopes
:
[
"All Department"
],
pageScope
:
false
,
pageScope
:
false
,
pageReference
:
false
,
pageReference
:
false
,
isTableScopeDraw
:
false
,
isTableReferenceDraw
:
false
,
businessUnit
:
JSON
.
parse
(
localStorage
.
getItem
(
'dataLogin'
)).
user_dpt
[
0
],
//doc
businessUnit
:
JSON
.
parse
(
localStorage
.
getItem
(
'dataLogin'
)).
user_dpt
[
0
],
//doc
documentType
:
""
,
//doc
documentType
:
""
,
//doc
revisionCode
:
"R0"
,
//doc
revisionCode
:
"R0"
,
//doc
...
@@ -91,7 +94,10 @@ class FormCreate extends Component {
...
@@ -91,7 +94,10 @@ class FormCreate extends Component {
this
.
state
.
dataReferences
.
push
(
datarow
);
this
.
state
.
dataReferences
.
push
(
datarow
);
}
}
}
}
var
tableScope
=
$
(
'#tableScope'
).
DataTable
({
tableScope
=
$
(
'#tableScope'
).
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
state
.
dataScopes
,
data
:
this
.
state
.
dataScopes
,
columns
:
[
columns
:
[
{
title
:
"Department"
},
{
title
:
"Department"
},
...
@@ -112,8 +118,7 @@ class FormCreate extends Component {
...
@@ -112,8 +118,7 @@ class FormCreate extends Component {
return
"<input type='checkbox' name='listAddScope[]' value='"
+
data
+
"'/>"
;
return
"<input type='checkbox' name='listAddScope[]' value='"
+
data
+
"'/>"
;
}
}
}
}
],
]
lengthMenu
:
[[
25
,
50
,
75
,
100
],
[
25
,
50
,
75
,
100
]]
})
})
tableScope
.
on
(
"change"
,
"input"
,
function
(
e
)
{
tableScope
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -153,7 +158,10 @@ class FormCreate extends Component {
...
@@ -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
,
data
:
this
.
state
.
dataReferences
,
columns
:
[
columns
:
[
{
title
:
"Code"
},
{
title
:
"Code"
},
...
@@ -198,8 +206,7 @@ class FormCreate extends Component {
...
@@ -198,8 +206,7 @@ class FormCreate extends Component {
return
"<input type='checkbox' name='listReference[]' value='"
+
data
+
"'/>"
;
return
"<input type='checkbox' name='listReference[]' value='"
+
data
+
"'/>"
;
}
}
}
}
],
]
lengthMenu
:
[[
25
,
50
,
75
,
100
],
[
25
,
50
,
75
,
100
]]
})
})
tableReference
.
on
(
"change"
,
"input"
,
function
(
e
)
{
tableReference
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -517,12 +524,16 @@ class FormCreate extends Component {
...
@@ -517,12 +524,16 @@ class FormCreate extends Component {
}
}
}
}
}
}
changePageScope
=
()
=>
{
changePageScope
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageScope
=
this
.
state
.
pageScope
;
let
clonePageScope
=
this
.
state
.
pageScope
;
clonePage
[
1
]
=
!
this
.
state
.
page
[
1
];
clonePage
[
1
]
=
!
this
.
state
.
page
[
1
];
clonePageScope
=
!
this
.
state
.
pageScope
;
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
//fungsi halaman add scope
handleSubmitScope
=
async
()
=>
{
handleSubmitScope
=
async
()
=>
{
...
@@ -589,12 +600,16 @@ class FormCreate extends Component {
...
@@ -589,12 +600,16 @@ class FormCreate extends Component {
}
}
}
}
}
}
changePageReference
=
()
=>
{
changePageReference
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageReference
=
this
.
state
.
pageReference
;
let
clonePageReference
=
this
.
state
.
pageReference
;
clonePage
[
2
]
=
!
this
.
state
.
page
[
2
];
clonePage
[
2
]
=
!
this
.
state
.
page
[
2
];
clonePageReference
=
!
this
.
state
.
pageReference
;
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
)
=>
{
handleAddCode
=
(
subject
)
=>
{
let
code
;
let
code
;
...
@@ -1119,13 +1134,11 @@ class FormCreate extends Component {
...
@@ -1119,13 +1134,11 @@ class FormCreate extends Component {
}
}
<
/div
>
<
/div
>
<
div
hidden
=
{
!
this
.
state
.
pageScope
}
>
<
div
hidden
=
{
!
this
.
state
.
pageScope
}
>
<
div
className
=
"form-group"
>
<
table
className
=
"display"
width
=
"100%"
id
=
"tableScope"
><
/table
>
<
table
className
=
"display"
width
=
"100%"
id
=
"tableScope"
><
/table
>
<
/div
>
<
div
className
=
"form-group row"
>
<
div
className
=
"form-group row"
>
<
div
className
=
"col-xl-12 col-lg-12 col-md-12 col-sm-12 text-right"
>
<
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
=
"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
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -1181,9 +1194,7 @@ class FormCreate extends Component {
...
@@ -1181,9 +1194,7 @@ class FormCreate extends Component {
}
}
<
/div
>
<
/div
>
<
div
hidden
=
{
!
this
.
state
.
pageReference
}
>
<
div
hidden
=
{
!
this
.
state
.
pageReference
}
>
<
div
className
=
"form-group"
>
<
table
className
=
"display"
width
=
"100%"
id
=
"tableReference"
><
/table
>
<
table
className
=
"display"
width
=
"100%"
id
=
"tableReference"
><
/table
>
<
/div
>
<
div
className
=
"form-group row"
>
<
div
className
=
"form-group row"
>
<
div
className
=
"col-xl-12 col-lg-12 col-md-12 col-sm-12 text-right"
>
<
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>  
;
<
Button
color
=
"danger"
onClick
=
{()
=>
this
.
changePageReference
()}
>&
nbsp
;
Cancel
&
nbsp
;
<
/Button>  
;
...
...
src/FormLogin.js
View file @
d86e9c9a
...
@@ -91,7 +91,7 @@ class FormLogin extends Component {
...
@@ -91,7 +91,7 @@ class FormLogin extends Component {
return
(
return
(
<
div
>
<
div
>
<
Navbar
color
=
"dark"
dark
expand
=
"lg"
>
<
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
>
<
/Navbar
>
<
div
className
=
"login-form"
>
<
div
className
=
"login-form"
>
<
div
className
=
"container"
>
<
div
className
=
"container"
>
...
...
src/FormRevisionDocument.js
View file @
d86e9c9a
...
@@ -9,6 +9,7 @@ import './DocumentManagement.css';
...
@@ -9,6 +9,7 @@ import './DocumentManagement.css';
const
$
=
require
(
'jquery'
);
const
$
=
require
(
'jquery'
);
$
.
DataTable
=
require
(
'datatables.net'
);
$
.
DataTable
=
require
(
'datatables.net'
);
var
tableScope
,
tableReference
;
class
FormRevision
extends
Component
{
class
FormRevision
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -24,6 +25,8 @@ class FormRevision extends Component {
...
@@ -24,6 +25,8 @@ class FormRevision extends Component {
optionScopes
:
[
"All Department"
],
optionScopes
:
[
"All Department"
],
pageScope
:
false
,
pageScope
:
false
,
pageReference
:
false
,
pageReference
:
false
,
isTableScopeDraw
:
false
,
isTableReferenceDraw
:
false
,
dataRevisionHistory
:
[],
dataRevisionHistory
:
[],
dataAuditTrail
:
[],
dataAuditTrail
:
[],
remark
:
""
,
remark
:
""
,
...
@@ -129,7 +132,7 @@ class FormRevision extends Component {
...
@@ -129,7 +132,7 @@ class FormRevision extends Component {
if
(
revisionDate
.
includes
(
"+00:00"
))
{
if
(
revisionDate
.
includes
(
"+00:00"
))
{
revisionDate
=
revisionDate
.
replace
(
"+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
=
"-"
;
revisionDate
=
"-"
;
}
}
if
(
effectiveDate
.
includes
(
"+00:00"
))
{
if
(
effectiveDate
.
includes
(
"+00:00"
))
{
...
@@ -218,9 +221,9 @@ class FormRevision extends Component {
...
@@ -218,9 +221,9 @@ class FormRevision extends Component {
}
}
}
}
if
(
checked
)
{
if
(
checked
)
{
datarow
.
push
(
1
);
datarow
.
push
(
dataDepartmentList
[
i
].
DepartmentCode
[
0
]
+
"-"
+
dataDepartmentList
[
i
].
Department
[
0
]
+
" true"
);
}
else
{
}
else
{
datarow
.
push
(
0
);
datarow
.
push
(
dataDepartmentList
[
i
].
DepartmentCode
[
0
]
+
"-"
+
dataDepartmentList
[
i
].
Department
[
0
]
+
" false"
);
}
}
this
.
state
.
dataScopes
.
push
(
datarow
);
this
.
state
.
dataScopes
.
push
(
datarow
);
}
}
...
@@ -245,16 +248,18 @@ class FormRevision extends Component {
...
@@ -245,16 +248,18 @@ class FormRevision extends Component {
}
}
}
}
if
(
checked
)
{
if
(
checked
)
{
datarow
.
push
(
1
);
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]
+
" true"
);
}
else
{
}
else
{
datarow
.
push
(
0
);
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]
+
" false"
);
}
}
datarow
.
push
(
dataReferences
[
i
].
subject
[
0
]);
this
.
state
.
dataReferences
.
push
(
datarow
);
this
.
state
.
dataReferences
.
push
(
datarow
);
}
}
}
}
}
}
var
tableScope
=
$
(
'#tableScope'
).
DataTable
({
tableScope
=
$
(
'#tableScope'
).
DataTable
({
scrollY
:
"250px"
,
scrollCollapse
:
true
,
paging
:
false
,
data
:
this
.
state
.
dataScopes
,
data
:
this
.
state
.
dataScopes
,
columns
:
[
columns
:
[
{
title
:
"Department"
},
{
title
:
"Department"
},
...
@@ -267,16 +272,15 @@ class FormRevision extends Component {
...
@@ -267,16 +272,15 @@ class FormRevision extends Component {
return
"<a class='text-decoration-none text-dark' href='#'>"
+
data
+
"</a>"
;
return
"<a class='text-decoration-none text-dark' href='#'>"
+
data
+
"</a>"
;
}
}
},
},
{
{
className
:
'select-checkbox'
,
className
:
'select-checkbox'
,
orderable
:
false
,
orderable
:
false
,
targets
:
1
,
targets
:
1
,
render
:
function
(
data
,
type
,
row
)
{
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
)
{
tableScope
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -298,17 +302,17 @@ class FormRevision extends Component {
...
@@ -298,17 +302,17 @@ class FormRevision extends Component {
let
data
=
tableScope
.
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
let
data
=
tableScope
.
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
let
listAddScope
=
document
.
getElementsByName
(
"listAddScope[]"
);
let
listAddScope
=
document
.
getElementsByName
(
"listAddScope[]"
);
for
(
let
i
=
0
;
i
<
listAddScope
.
length
;
i
++
)
{
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
)
{
if
(
listAddScope
[
i
].
checked
)
{
listAddScope
[
i
].
checked
=
false
;
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
);
self
.
state
.
copyScopes
.
splice
(
j
,
1
);
if
(
self
.
state
.
copyScopes
.
length
==
0
)
{
if
(
self
.
state
.
copyScopes
.
length
==
0
)
{
self
.
state
.
validAddScope
=
false
;
self
.
state
.
validAddScope
=
false
;
}
}
}
else
{
}
else
{
listAddScope
[
i
].
checked
=
true
;
listAddScope
[
i
].
checked
=
true
;
self
.
state
.
copyScopes
.
push
(
listAddScope
[
i
].
value
);
self
.
state
.
copyScopes
.
push
(
data
[
0
]
);
self
.
state
.
validAddScope
=
true
;
self
.
state
.
validAddScope
=
true
;
}
}
self
.
setState
({
validAddScope
:
self
.
state
.
validAddScope
});
self
.
setState
({
validAddScope
:
self
.
state
.
validAddScope
});
...
@@ -316,7 +320,10 @@ class FormRevision extends Component {
...
@@ -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
,
data
:
this
.
state
.
dataReferences
,
columns
:
[
columns
:
[
{
title
:
"Code"
},
{
title
:
"Code"
},
...
@@ -358,11 +365,10 @@ class FormRevision extends Component {
...
@@ -358,11 +365,10 @@ class FormRevision extends Component {
orderable
:
false
,
orderable
:
false
,
targets
:
4
,
targets
:
4
,
render
:
function
(
data
,
type
,
row
)
{
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
)
{
tableReference
.
on
(
"change"
,
"input"
,
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -384,17 +390,17 @@ class FormRevision extends Component {
...
@@ -384,17 +390,17 @@ class FormRevision extends Component {
let
data
=
tableReference
.
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
let
data
=
tableReference
.
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
let
listReference
=
document
.
getElementsByName
(
"listReference[]"
);
let
listReference
=
document
.
getElementsByName
(
"listReference[]"
);
for
(
let
i
=
0
;
i
<
listReference
.
length
;
i
++
)
{
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
)
{
if
(
listReference
[
i
].
checked
)
{
listReference
[
i
].
checked
=
false
;
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
);
self
.
state
.
copyReferences
.
splice
(
j
,
1
);
if
(
self
.
state
.
copyReferences
.
length
==
0
)
{
if
(
self
.
state
.
copyReferences
.
length
==
0
)
{
self
.
state
.
validAddReference
=
false
;
self
.
state
.
validAddReference
=
false
;
}
}
}
else
{
}
else
{
listReference
[
i
].
checked
=
true
;
listReference
[
i
].
checked
=
true
;
self
.
state
.
copyReferences
.
push
(
listReference
[
i
].
value
);
self
.
state
.
copyReferences
.
push
(
data
[
1
]
);
self
.
state
.
validAddReference
=
true
;
self
.
state
.
validAddReference
=
true
;
}
}
self
.
setState
({
validAddReference
:
self
.
state
.
validAddReference
});
self
.
setState
({
validAddReference
:
self
.
state
.
validAddReference
});
...
@@ -687,12 +693,16 @@ class FormRevision extends Component {
...
@@ -687,12 +693,16 @@ class FormRevision extends Component {
}
}
}
}
}
}
changePageScope
=
()
=>
{
changePageScope
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageScope
=
this
.
state
.
pageScope
;
let
clonePageScope
=
this
.
state
.
pageScope
;
clonePage
[
2
]
=
!
this
.
state
.
page
[
2
];
clonePage
[
2
]
=
!
this
.
state
.
page
[
2
];
clonePageScope
=
!
this
.
state
.
pageScope
;
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
//fungsi halaman add scope
handleSubmitScope
=
async
()
=>
{
handleSubmitScope
=
async
()
=>
{
...
@@ -759,12 +769,16 @@ class FormRevision extends Component {
...
@@ -759,12 +769,16 @@ class FormRevision extends Component {
}
}
}
}
}
}
changePageReference
=
()
=>
{
changePageReference
=
async
()
=>
{
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePage
=
this
.
state
.
page
.
slice
();
let
clonePageReference
=
this
.
state
.
pageReference
;
let
clonePageReference
=
this
.
state
.
pageReference
;
clonePage
[
3
]
=
!
this
.
state
.
page
[
3
];
clonePage
[
3
]
=
!
this
.
state
.
page
[
3
];
clonePageReference
=
!
this
.
state
.
pageReference
;
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
)
=>
{
handleAddCode
=
(
subject
)
=>
{
let
code
;
let
code
;
...
...
src/Navbar.js
View file @
d86e9c9a
...
@@ -132,7 +132,7 @@ class Navbar1 extends Component {
...
@@ -132,7 +132,7 @@ class Navbar1 extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
Navbar
color
=
"dark"
dark
expand
=
"lg"
>
<
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
}
/
>
<
NavbarToggler
onClick
=
{
this
.
toggle
}
/
>
<
Collapse
isOpen
=
{
this
.
state
.
isOpen
}
navbar
>
<
Collapse
isOpen
=
{
this
.
state
.
isOpen
}
navbar
>
<
Nav
className
=
"mr-auto"
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