Commit 38b859c0 by DESKTOP-E3GSHH7\myhr

เเก้ ติดลูปหน้า sidebar

parent 46062c6e
...@@ -110,6 +110,7 @@ export class SidebarComponent { ...@@ -110,6 +110,7 @@ export class SidebarComponent {
this.isCommonRoute = this.currentUrl.includes('/admin'); this.isCommonRoute = this.currentUrl.includes('/admin');
this.isInstallerRoute = this.currentUrl.includes('/company'); this.isInstallerRoute = this.currentUrl.includes('/company');
this.isMyportalRoute = this.currentUrl.includes('/myportal'); this.isMyportalRoute = this.currentUrl.includes('/myportal');
this.isMylearnRoute = this.currentUrl.includes('/mylearn')
this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => { this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => {
this.changeMenu() this.changeMenu()
}); });
...@@ -206,11 +207,11 @@ export class SidebarComponent { ...@@ -206,11 +207,11 @@ export class SidebarComponent {
} else if (this.isMylearnRoute){ } else if (this.isMylearnRoute){
this.menuItems = this.navServices.getMylearnMenu(); this.menuItems = this.navServices.getMylearnMenu();
}else{ }else{
this.menuItems = this.navServices.getCommonMenu(); this.menuItems = this.navServices.getCommonMenu()
} }
// เพิ่มรายการรายงาน Excel เข้าไปในเมนู หากมีข้อมูลและยังไม่ได้เพิ่ม // เพิ่มรายการรายงาน Excel เข้าไปในเมนู หากมีข้อมูลและยังไม่ได้เพิ่ม
if (this.submenuExcel.length > 0) { if ((this.isMyportalRoute||this.isInstallerRoute)&&this.submenuExcel.length > 0) {
const excelMenuExists = this.menuItems.some(item => item.title === 'รายงาน Excel'); const excelMenuExists = this.menuItems.some(item => item.title === 'รายงาน Excel');
if (!excelMenuExists) { if (!excelMenuExists) {
...@@ -342,7 +343,7 @@ export class SidebarComponent { ...@@ -342,7 +343,7 @@ export class SidebarComponent {
element.selected = true; element.selected = true;
} }
// ตรวจสอบ path สำหรับ Excel Report ที่มี query parameters // ตรวจสอบ path สำหรับ Excel Report ที่มี query parameters
if (ele.path && this.currentUrl.startsWith(ele.path.split('?')[0])) { if ((this.isMyportalRoute||this.isInstallerRoute)&&ele.path && this.currentUrl.startsWith(ele.path.split('?')[0])) {
const currentUrlBase = this.currentUrl.split('?')[0]; const currentUrlBase = this.currentUrl.split('?')[0];
const elePathBase = ele.path.split('?')[0]; const elePathBase = ele.path.split('?')[0];
if (currentUrlBase === elePathBase) { if (currentUrlBase === elePathBase) {
...@@ -363,7 +364,7 @@ export class SidebarComponent { ...@@ -363,7 +364,7 @@ export class SidebarComponent {
ele.selected = true; ele.selected = true;
} }
// ตรวจสอบ path สำหรับ Excel Report ที่มี query parameters ในระดับที่ 3 // ตรวจสอบ path สำหรับ Excel Report ที่มี query parameters ในระดับที่ 3
if (child1.path && this.currentUrl.startsWith(child1.path.split('?')[0])) { if ((this.isMyportalRoute||this.isInstallerRoute)&&child1.path && this.currentUrl.startsWith(child1.path.split('?')[0])) {
const currentUrlBase = this.currentUrl.split('?')[0]; const currentUrlBase = this.currentUrl.split('?')[0];
const child1PathBase = child1.path.split('?')[0]; const child1PathBase = child1.path.split('?')[0];
if (currentUrlBase === child1PathBase) { if (currentUrlBase === child1PathBase) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment