Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mySkill-x
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
mySkill-x
Commits
8874d017
Commit
8874d017
authored
Mar 19, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
กำหนดสิทธิการเข้าใช้งาน
parent
57aa19ab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
role-permission-config.component.html
...e-permission-config/role-permission-config.component.html
+0
-0
sidebar.component.ts
src/app/shared/components/sidebar/sidebar.component.ts
+23
-14
No files found.
src/app/components/company-components/account-settings/role-permission-config/role-permission-config.component.html
View file @
8874d017
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,25 +116,32 @@ export class SidebarComponent {
this
.
configPermission
.
data
=
new
MyConfigPermissionModel
(
response
)
this
.
menuItems
.
forEach
(
x
=>
{
// เปิดทุกเมนู
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.show = true
// x.children?.forEach(y => {
// const configChildren = configMenu.children.find(z => z.id == y.id)
// if (configChildren) {
// y.show = configChildren.show
// }
// 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
=>
{
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
)
{
...
...
@@ -142,6 +150,7 @@ export class SidebarComponent {
})
}
})
}
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