Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ariela Ramdania
siplah-fe
Commits
5a12302d
Commit
5a12302d
authored
9 months ago
by
Ajeng Putri Kinasih
Browse files
Options
Download
Email Patches
Plain Diff
fixing eror
parent
a7f7bb75
main
ajeng
1 merge request
!66
fixing eror
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/components/Sidebar2.vue
+32
-67
src/components/Sidebar2.vue
src/layouts/default.vue
+1
-1
src/layouts/default.vue
src/pages/ajuan/time-off.vue
+1
-2
src/pages/ajuan/time-off.vue
src/pages/report/okr.vue
+6
-1
src/pages/report/okr.vue
with
40 additions
and
71 deletions
+40
-71
src/components/Sidebar.vue
→
src/components/Sidebar
2
.vue
View file @
5a12302d
...
...
@@ -16,53 +16,53 @@
<div
class=
"menu-inner-shadow"
></div>
<ul
class=
"menu-inner py-1"
>
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/' }">
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/' }">
<router-link
to=
"/"
class=
"menu-link"
>
<i
class=
"menu-icon tf-icons bx bx-home-circle"
></i>
<div>
Dashboard
</div>
</router-link>
</li>
<li
v-if=
"
isAuthorized('dataMaster'
)"
class=
"menu-item"
:class=
"
{ open: isDataMasterOpen }">
<li
v-if=
"
['HRD', 'CTO'].includes(auth.employee?.jabatan
)"
class=
"menu-item"
:class=
"
{ open: isDataMasterOpen }">
<a
class=
"menu-link menu-toggle"
@
click=
"toggleDropdown('dataMaster')"
>
<i
class=
"menu-icon tf-icons bx bx-cube-alt"
></i>
<div
data-i18n=
"Data Master"
>
Data Master
</div>
</a>
<ul
class=
"menu-sub"
v-show=
"isDataMasterOpen"
>
<li
v-if=
"isAuthorized('dataJabatan')"
class=
"menu-item"
:class=
"
{ active: $route.path === '/master/data-jabatan' }">
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/master/data-jabatan' }">
<router-link
to=
"/master/data-jabatan"
class=
"menu-link"
>
<div
class=
"fw-bolder"
>
Data Jabatan
</div>
</router-link>
</li>
<li
v-if=
"isAuthorized('dataKaryawan')"
class=
"menu-item"
:class=
"
{ active: $route.path === '/master/data-karyawan' }">
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/master/data-karyawan' }">
<router-link
to=
"/master/data-karyawan"
class=
"menu-link"
>
<div
class=
"fw-bolder"
>
Data Karyawan
</div>
</router-link>
</li>
<li
v-if=
"isAuthorized('dataProject')"
class=
"menu-item"
:class=
"
{ active: $route.path === '/master/data-project' }">
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/master/data-project' }">
<router-link
to=
"/master/data-project"
class=
"menu-link"
>
<div
class=
"fw-bolder"
>
Data Project
</div>
</router-link>
</li>
<li
v-if=
"
isAuthorized('dataKeyResult')
"
class=
"menu-item"
:class=
"
{ active: $route.path === '/master/key-result' }">
<li
v-if=
"
auth.employee?.jabatan !== 'CTO'
"
class=
"menu-item"
:class=
"
{ active: $route.path === '/master/key-result' }">
<router-link
to=
"/master/key-result"
class=
"menu-link"
>
<div>
Key Result
</div>
</router-link>
</li>
</ul>
</li>
<li
v-if=
"
isAuthorized('presensi')
"
class=
"menu-item"
:class=
"
{ active: $route.path === '/absensi/absensi' }">
<li
v-if=
"
auth.employee?.jabatan !== 'CTO'
"
class=
"menu-item"
:class=
"
{ active: $route.path === '/absensi/absensi' }">
<router-link
to=
"/absensi/absensi"
class=
"menu-link"
>
<i
class=
"menu-icon tf-icons bx bx-time"
></i>
<div
class=
"fw-bolder"
>
Presensi
</div>
</router-link>
</li>
<li
v-if=
"
isAuthorized('dailyReport')
"
class=
"menu-item"
:class=
"
{ active: $route.path === '/absensi/daily-report' }">
<li
v-if=
"
auth.employee?.jabatan !== 'CTO'
"
class=
"menu-item"
:class=
"
{ active: $route.path === '/absensi/daily-report' }">
<router-link
to=
"/absensi/daily-report"
class=
"menu-link"
>
<i
class=
"menu-icon tf-icons bx bxs-report"
></i>
<div
class=
"fw-bolder"
>
Daily Report
</div>
</router-link>
</li>
<li
v-if=
"
isAuthorized('pengajuanLembur')
"
class=
"menu-item"
:class=
"
{ active: $route.path === '/ajuan/overtime' }">
<li
v-if=
"
auth.employee?.jabatan !== 'CTO'
"
class=
"menu-item"
:class=
"
{ active: $route.path === '/ajuan/overtime' }">
<router-link
to=
"/ajuan/overtime"
class=
"menu-link"
>
<i
class=
"menu-icon tf-icons bx bxs-hourglass"
></i>
<div>
Lembur
</div>
...
...
@@ -74,41 +74,41 @@
<div>
Cuti
</div>
</router-link>
</li>
<li
v-if=
"
isAuthorized('kelolaAbsensi'
)"
class=
"menu-item"
:class=
"
{ open: isKelolaAbsensiOpen }">
<li
v-if=
"
['HRD', 'CTO', 'PM'].includes(auth.employee?.jabatan
)"
class=
"menu-item"
:class=
"
{ open: isKelolaAbsensiOpen }">
<a
class=
"menu-link menu-toggle"
@
click=
"toggleDropdown('dataAbsen')"
>
<i
class=
"menu-icon tf-icons bx bx-box"
></i>
<div
data-i18n=
"Kelola Absensi"
>
Kelola Absensi
</div>
</a>
<ul
class=
"menu-sub"
v-show=
"isKelolaAbsensiOpen"
>
<li
v-if=
"isAuthorized('readpresensi')"
class=
"menu-item"
:class=
"
{ active: $route.path === '/kelola/absensi' }">
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/kelola/absensi' }">
<router-link
to=
"/kelola/absensi"
class=
"menu-link"
>
<div
class=
"fw-bolder"
>
Absensi Karyawan
</div>
</router-link>
</li>
<li
v-if=
"isAuthorized('readdailyReport')"
class=
"menu-item"
:class=
"
{ active: $route.path === '/report/daily-report' }">
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/report/daily-report' }">
<router-link
to=
"/report/daily-report"
class=
"menu-link"
>
<div
class=
"fw-bolder"
>
Report Karyawan
</div>
</router-link>
</li>
<li
v-if=
"isAuthorized('lembur')"
class=
"menu-item"
:class=
"
{ active: $route.path === '/kelola/overtime' }">
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/kelola/overtime' }">
<router-link
to=
"/kelola/overtime"
class=
"menu-link"
>
<div>
Review Lembur
</div>
</router-link>
</li>
<li
v-if=
"isAuthorized('cuti')"
class=
"menu-item"
:class=
"
{ active: $route.path === '/kelola/time-off' }">
<li
class=
"menu-item"
:class=
"
{ active: $route.path === '/kelola/time-off' }">
<router-link
to=
"/kelola/time-off"
class=
"menu-link"
>
<div>
Ajuan Cuti
</div>
</router-link>
</li>
</ul>
</li>
<li
v-if=
"
isAuthorized('okr'
)"
class=
"menu-item"
:class=
"
{ active: $route.path === '/report/okr' }">
<li
v-if=
"
['HRD', 'PM', 'CTO'].includes(auth.employee?.jabatan
)"
class=
"menu-item"
:class=
"
{ active: $route.path === '/report/okr' }">
<router-link
to=
"/report/okr"
class=
"menu-link"
>
<i
class=
"menu-icon tf-icons bx bx-collection"
></i>
<div>
Review OKR
</div>
</router-link>
</li>
<li
v-if=
"
isAuthorized('meeting'
)"
class=
"menu-item"
:class=
"
{ active: $route.path === '/meeting/meeting' }">
<li
v-if=
"
['HRD', 'PM'].includes(auth.employee?.jabatan
)"
class=
"menu-item"
:class=
"
{ active: $route.path === '/meeting/meeting' }">
<router-link
to=
"/meeting/meeting"
class=
"menu-link"
>
<i
class=
"menu-icon tf-icons bx bx-calendar-event"
></i>
<div>
Meeting
</div>
...
...
@@ -118,61 +118,26 @@
</aside>
</
template
>
<
script
lang=
"ts"
>
import
{
d
ef
ineComponent
}
from
'
vue
'
;
<
script
setup
lang=
"ts"
>
import
{
r
ef
}
from
'
vue
'
;
import
{
useAuthStore
}
from
'
@/stores/api/authStore
'
;
export
default
defineComponent
({
data
()
{
return
{
isDataMasterOpen
:
false
,
isKelolaAbsensiOpen
:
false
,
};
},
methods
:
{
toggleDropdown
(
menu
:
string
)
{
if
(
menu
===
'
dataMaster
'
)
{
this
.
isDataMasterOpen
=
!
this
.
isDataMasterOpen
;
}
if
(
menu
===
'
dataAbsen
'
)
{
this
.
isKelolaAbsensiOpen
=
!
this
.
isKelolaAbsensiOpen
;
}
},
toggleMenu
()
{
// Logic to toggle the entire sidebar menu (e.g., for mobile view)
},
isAuthorized
(
menu
:
string
):
boolean
{
const
authStore
=
useAuthStore
();
const
employeeJabatan
=
authStore
.
employee
?.
jabatan
??
''
;
const
auth
=
useAuthStore
();
const
isDataMasterOpen
=
ref
(
false
);
const
isKelolaAbsensiOpen
=
ref
(
false
);
// Define the allowed roles for each menu item
const
rolePermissions
:
{
[
key
:
string
]:
string
[]
}
=
{
// dashboard: ['HRD', 'PM', 'CTO'],
dataMaster
:
[
'
HRD
'
,
'
CTO
'
],
dataJabatan
:
[
'
HRD
'
,
'
CTO
'
],
dataProject
:
[
'
HRD
'
,
'
CTO
'
],
dataKaryawan
:
[
'
HRD
'
,
'
CTO
'
],
dataKeyResult
:
[
'
HRD
'
],
presensi
:
[
'
HRD
'
,
'
PM
'
,
'
Frontend
'
,
'
Backend
'
,
'
UI/UX
'
],
dailyReport
:
[
'
HRD
'
,
'
Frontend
'
,
'
Backend
'
,
'
UI/UX
'
],
pengajuanLembur
:
[
'
HRD
'
,
'
UIUX
'
,
'
Frontend
'
,
'
PM
'
],
presensi
:
[
'
UIUX
'
,
'
HRD
'
,
'
PM
'
,
'
Frontend
'
],
dailyReport
:
[
'
UIUX
'
,
'
HRD
'
,
'
Frontend
'
],
function
toggleDropdown
(
menu
:
string
)
{
if
(
menu
===
'
dataMaster
'
)
{
isDataMasterOpen
.
value
=
!
isDataMasterOpen
.
value
;
}
if
(
menu
===
'
dataAbsen
'
)
{
isKelolaAbsensiOpen
.
value
=
!
isKelolaAbsensiOpen
.
value
;
}
}
readpresensi
:
[
'
HRD
'
,
'
PM
'
,
'
CTO
'
],
readdailyReport
:
[
'
HRD
'
,
'
PM
'
,
'
CTO
'
],
lembur
:
[
'
HRD
'
,
'
CTO
'
,
'
PM
'
],
cuti
:
[
'
HRD
'
,
'
CTO
'
,
'
PM
'
],
kelolaAbsensi
:
[
'
HRD
'
,
'
CTO
'
,
'
PM
'
],
okr
:
[
'
HRD
'
,
'
PM
'
,
'
CTO
'
],
meeting
:
[
'
HRD
'
,
'
PM
'
],
};
const
allowedRoles
=
rolePermissions
[
menu
];
return
allowedRoles
?
allowedRoles
.
includes
(
employeeJabatan
)
:
false
;
},
},
});
function
toggleMenu
()
{
// Logic to toggle the entire sidebar menu (e.g., for mobile view)
}
</
script
>
<
style
scoped
></
style
>
This diff is collapsed.
Click to expand it.
src/layouts/default.vue
View file @
5a12302d
<
script
setup
lang=
"ts"
>
import
{
RouterView
}
from
'
vue-router
'
import
Navbar
from
'
../components/Navbar.vue
'
;
import
Sidebar
from
'
../components/Sidebar.vue
'
;
import
Sidebar
from
'
../components/Sidebar
2
.vue
'
;
import
Footer
from
'
../components/Footer.vue
'
;
</
script
>
...
...
This diff is collapsed.
Click to expand it.
src/pages/ajuan/time-off.vue
View file @
5a12302d
...
...
@@ -346,8 +346,7 @@ const isImage = (url: string) => {
<select
id=
"type"
class=
"form-select"
v-model=
"formItem.type"
>
<option
value=
""
>
Pilih Tipe Cuti
</option>
<option
value=
"tahunan"
>
Cuti Tahunan
</option>
<option
value=
"menikah"
>
Cuti Menikah
</option>
<option
value=
"melahirkan"
>
Cuti Melahirkan
</option>
<option
value=
"khusus"
>
Cuti Khusus (Melahirkan, Menikah)
</option>
</select>
<div
class=
"d-block text-danger"
v-if=
"formErrors.type"
>
{{
formErrors
.
type
}}
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/pages/report/okr.vue
View file @
5a12302d
...
...
@@ -210,6 +210,11 @@ const deleteData = async () => {
const
handleExportToExcel
=
async
()
=>
{
await
apiAssessmentStore
.
exportToExcel
();
};
const
id_jabatan
=
[
1
,
2
,
4
];
const
filteredEmployees
=
computed
(()
=>
{
return
selectedEmployee
.
value
.
filter
((
employee
:
{
detail
:
{
id_jabatan
:
number
;
};
})
=>
!
id_jabatan
.
includes
(
employee
.
detail
.
id_jabatan
));
});
</
script
>
<
template
>
...
...
@@ -379,7 +384,7 @@ const handleExportToExcel = async () => {
<
label
for
=
"
employee
"
class
=
"
form-label
"
>
Karyawan
<
/label
>
<
select
v
-
model
=
"
formItem.id_employee
"
id
=
"
employee
"
class
=
"
form-select
"
>
<
option
value
=
"
0
"
disabled
>
Pilih
Karyawan
<
/option
>
<
option
v
-
for
=
"
employee in
select
edEmployee
"
:
key
=
"
employee.value
"
:
value
=
"
employee.value
"
>
<
option
v
-
for
=
"
employee in
filter
edEmployee
s
"
:
key
=
"
employee.value
"
:
value
=
"
employee.value
"
>
{{
employee
.
label
}}
<
/option
>
<
/select
>
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help