Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myAppraisal
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
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
angular
myAppraisal
Commits
8874d017
Commit
8874d017
authored
Mar 19, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
กำหนดสิทธิการเข้าใช้งาน
parent
57aa19ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
26 deletions
+35
-26
role-permission-config.component.html
...e-permission-config/role-permission-config.component.html
+6
-6
sidebar.component.ts
src/app/shared/components/sidebar/sidebar.component.ts
+29
-20
No files found.
src/app/components/company-components/account-settings/role-permission-config/role-permission-config.component.html
View file @
8874d017
...
...
@@ -248,11 +248,11 @@
</ng-container>
<ng-container
*
ngIf=
"currentModal == 'delete'"
>
<ng-container
*
ngIf=
"numDataListChecked"
>
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
<ng-container
*
ngIf=
"!numDataListChecked"
>
เลือกข้อมูลที่ต้องการลบ
</ng-container>
!
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
<ng-container
*
ngIf=
"!numDataListChecked"
>
เลือกข้อมูลที่ต้องการลบ
</ng-container>
!
</ng-container>
</p>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
...
...
@@ -276,7 +276,7 @@
</button>
<a
class=
"ti-btn ti-btn-danger"
href=
"javascript:void(0);"
data-hs-overlay=
"#role-permission-config-alert-modal"
(
click
)="
updateConfigPermission
('
delete
')"
*
ngIf=
"numDataListChecked"
>
(
click
)="
updateConfigPermission
('
delete
')"
*
ngIf=
"numDataListChecked"
>
ลบข้อมูล
</a>
</ng-container>
...
...
src/app/shared/components/sidebar/sidebar.component.ts
View file @
8874d017
...
...
@@ -85,6 +85,7 @@ export class SidebarComponent {
this
.
getConfigPermissionByUserLevel
()
this
.
ParentActive
();
this
.
router
.
events
.
subscribe
((
event
)
=>
{
sessionStorage
.
setItem
(
'currentUrl'
,
this
.
router
.
url
)
if
(
event
instanceof
NavigationEnd
)
{
this
.
ParentActive
();
}
...
...
@@ -115,33 +116,41 @@ export class SidebarComponent {
this
.
configPermission
.
data
=
new
MyConfigPermissionModel
(
response
)
this
.
menuItems
.
forEach
(
x
=>
{
// เปิดทุกเมนู
x
.
show
=
true
x
.
children
?.
forEach
(
y
=>
{
y
.
show
=
true
})
//
x.show = true
//
x.children?.forEach(y => {
//
y.show = true
//
})
// เปิดตาม config
// const configMenu = this.configPermission.data.menuBody.find(y => y.id == x.id)
// if (configMenu) {
// x.show = configMenu.show
// x.children?.forEach(y => {
// const configChildren = configMenu.children.find(z => z.id == y.id)
// if (configChildren) {
// y.show = configChildren.show
// }
// })
// }
})
let
path404check
=
'/404page'
this
.
menuItems
.
forEach
(
x
=>
{
if
(
x
.
show
&&
path404check
==
'/404page'
)
{
const
configMenu
=
this
.
configPermission
.
data
.
menuBody
.
find
(
y
=>
y
.
id
==
x
.
id
)
if
(
configMenu
)
{
x
.
show
=
configMenu
.
show
x
.
children
?.
forEach
(
y
=>
{
if
(
y
.
show
)
{
path404check
=
y
.
path
||
'404page'
const
configChildren
=
configMenu
.
children
.
find
(
z
=>
z
.
id
==
y
.
id
)
if
(
configChildren
)
{
y
.
show
=
configChildren
.
show
}
})
}
})
let
path404check
=
'/404page'
this
.
menuItems
.
forEach
(
x
=>
{
const
children
=
x
.
children
?.
find
(
y
=>
y
.
path
==
sessionStorage
.
getItem
(
'currentUrl'
))
if
(
children
?.
show
&&
path404check
==
'/404page'
)
{
path404check
=
children
.
path
||
'/404page'
}
})
if
(
path404check
==
'/404page'
)
{
this
.
menuItems
.
forEach
(
x
=>
{
if
(
x
.
show
&&
path404check
==
'/404page'
)
{
x
.
children
?.
forEach
(
y
=>
{
if
(
y
.
show
)
{
path404check
=
y
.
path
||
'404page'
}
})
}
})
}
this
.
router
.
navigate
([
path404check
]);
this
.
configPermission
.
loading
=
false
this
.
cdr
.
detectChanges
()
...
...
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