Commit 3d8e88bc by Ooh-Ao

เมนู

parent d0c25ed2
...@@ -321,6 +321,17 @@ export class HomeComponent implements OnInit { ...@@ -321,6 +321,17 @@ export class HomeComponent implements OnInit {
isVisible: true, isVisible: true,
category: 'system', category: 'system',
permissions: { view: true, create: true, edit: true, delete: true, export: true, import: true } permissions: { view: true, create: true, edit: true, delete: true, export: true, import: true }
},
{
id: 'my-portal',
name: 'my-portal',
displayName: 'my-Portal',
description: 'ระบบจัดการเอกสารและเมนูกลางสำหรับแอปพลิเคชันต่างๆ',
icon: './assets/images/icons/portal.png',
path: '/portal-manage/my-portal',
isVisible: true,
category: 'system',
permissions: { view: true, create: true, edit: true, delete: true, export: true, import: true }
} }
]; ];
} }
......
import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
@Component({
selector: 'app-my-portal',
standalone: true,
imports: [CommonModule, RouterModule],
template: `
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0">
<i class="ri-upload-cloud-2-line me-2"></i>
my-Portal - ระบบจัดการเอกสารและเมนูกลาง
</h4>
<p class="text-muted mb-0">จัดการเอกสารและเมนูกลางสำหรับแอปพลิเคชันต่างๆ</p>
</div>
<div class="card-body">
<div class="row">
<!-- การจัดการหมวดหมู่ -->
<div class="col-md-6 col-lg-4 mb-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center">
<div class="mb-3">
<i class="ri-folder-3-line text-primary" style="font-size: 3rem;"></i>
</div>
<h5 class="card-title">จัดการหมวดหมู่</h5>
<p class="card-text text-muted">สร้างและจัดการหมวดหมู่เอกสาร</p>
<a routerLink="create-category" class="btn btn-primary">
<i class="ri-add-line me-1"></i>
สร้างหมวดหมู่
</a>
</div>
</div>
</div>
<!-- รายการหมวดหมู่ -->
<div class="col-md-6 col-lg-4 mb-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center">
<div class="mb-3">
<i class="ri-list-check text-success" style="font-size: 3rem;"></i>
</div>
<h5 class="card-title">รายการหมวดหมู่</h5>
<p class="card-text text-muted">ดูและจัดการรายการหมวดหมู่ทั้งหมด</p>
<a routerLink="category-list" class="btn btn-success">
<i class="ri-list-line me-1"></i>
ดูรายการ
</a>
</div>
</div>
</div>
<!-- อนุมัติเอกสาร -->
<div class="col-md-6 col-lg-4 mb-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center">
<div class="mb-3">
<i class="ri-check-double-line text-warning" style="font-size: 3rem;"></i>
</div>
<h5 class="card-title">อนุมัติเอกสาร</h5>
<p class="card-text text-muted">อนุมัติเอกสารที่รอการตรวจสอบ</p>
<a routerLink="category-list-approve" class="btn btn-warning">
<i class="ri-check-line me-1"></i>
อนุมัติ
</a>
</div>
</div>
</div>
<!-- รายการที่อนุมัติแล้ว -->
<div class="col-md-6 col-lg-4 mb-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center">
<div class="mb-3">
<i class="ri-checkbox-circle-line text-info" style="font-size: 3rem;"></i>
</div>
<h5 class="card-title">รายการที่อนุมัติแล้ว</h5>
<p class="card-text text-muted">ดูเอกสารที่อนุมัติแล้ว</p>
<a routerLink="approved-list" class="btn btn-info">
<i class="ri-eye-line me-1"></i>
ดูรายการ
</a>
</div>
</div>
</div>
<!-- จัดการ Excel -->
<div class="col-md-6 col-lg-4 mb-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center">
<div class="mb-3">
<i class="ri-file-excel-2-line text-success" style="font-size: 3rem;"></i>
</div>
<h5 class="card-title">จัดการ Excel</h5>
<p class="card-text text-muted">อัพโหลดและจัดการไฟล์ Excel</p>
<a routerLink="excel-list" class="btn btn-success">
<i class="ri-file-excel-line me-1"></i>
จัดการ Excel
</a>
</div>
</div>
</div>
<!-- รายงาน Excel -->
<div class="col-md-6 col-lg-4 mb-4">
<div class="card h-100 border-0 shadow-sm">
<div class="card-body text-center">
<div class="mb-3">
<i class="ri-bar-chart-line text-primary" style="font-size: 3rem;"></i>
</div>
<h5 class="card-title">รายงาน Excel</h5>
<p class="card-text text-muted">สร้างและดูรายงานจาก Excel</p>
<a routerLink="excel-report" class="btn btn-primary">
<i class="ri-bar-chart-line me-1"></i>
สร้างรายงาน
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`,
styles: [`
.card {
transition: transform 0.2s ease-in-out;
}
.card:hover {
transform: translateY(-2px);
}
.btn {
border-radius: 8px;
}
`]
})
export class MyPortalComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
import { Routes } from '@angular/router';
import { MyPortalComponent } from './my-portal.component';
import { moduleAccessGuard } from '../../core/guards/module-access.guard';
// Import components (you may need to adjust these imports based on actual component names)
// import { CreateCategoryComponent } from './create-category/create-category.component';
// import { CategoryListComponent } from './category-list/category-list.component';
// import { CategoryListApproveComponent } from './category-list-approve/category-list-approve.component';
// import { ApprovedListComponent } from './approved-list/approved-list.component';
// import { ExcelListComponent } from './excel-list/excel-list.component';
// import { ExcelReportComponent } from './excel-report/excel-report.component';
// import { ExcelReportToggleComponent } from './excel-report-toggle/excel-report-toggle.component';
// import { ViewListExcelComponent } from './view-list-excel/view-list-excel.component';
// import { OpenImageComponent } from './open-image/open-image.component';
// import { DatasourceTableComponent } from './datasource-table/datasource-table.component';
// import { AlertModalComponent } from './alert-modal/alert-modal.component';
export const MY_PORTAL_ROUTES: Routes = [
{
path: '',
component: MyPortalComponent,
canActivate: [moduleAccessGuard]
},
// {
// path: 'create-category',
// component: CreateCategoryComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'category-list',
// component: CategoryListComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'category-list-approve',
// component: CategoryListApproveComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'approved-list',
// component: ApprovedListComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'excel-list',
// component: ExcelListComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'excel-report',
// component: ExcelReportComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'excel-report-toggle',
// component: ExcelReportToggleComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'view-list-excel',
// component: ViewListExcelComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'open-image',
// component: OpenImageComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'datasource-table',
// component: DatasourceTableComponent,
// canActivate: [moduleAccessGuard]
// },
// {
// path: 'alert-modal',
// component: AlertModalComponent,
// canActivate: [moduleAccessGuard]
// }
];
...@@ -109,6 +109,13 @@ export const portalManageRoutes: Routes = [ ...@@ -109,6 +109,13 @@ export const portalManageRoutes: Routes = [
canActivate: [moduleAccessGuard] canActivate: [moduleAccessGuard]
}, },
// my-Portal Module
{
path: 'my-portal',
canActivate: [moduleAccessGuard],
loadChildren: () => import('./my-portal/my-portal.routes').then(m => m.MY_PORTAL_ROUTES)
},
// === Generic App Routes === // === Generic App Routes ===
// These routes are for simple apps that don't need special module-level services. // These routes are for simple apps that don't need special module-level services.
......
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
</button> </button>
<div <div
class="p-4 main-header-dropdown !-mt-3 hs-dropdown-menu ti-dropdown-menu !w-[22rem] border-0 border-defaultborder hidden" class="p-4 main-header-dropdown !-mt-3 hs-dropdown-menu ti-dropdown-menu !w-[24rem] !max-h-[28rem] border-0 border-defaultborder hidden"
aria-labelledby="dropdown-apps"> aria-labelledby="dropdown-apps">
<div class="p-4"> <div class="p-4">
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
</div> </div>
</div> </div>
<div class="dropdown-divider mb-0"></div> <div class="dropdown-divider mb-0"></div>
<div class="ti-dropdown-divider divide-y divide-gray-200 dark:divide-white/10 main-header-shortcuts p-2" <div class="ti-dropdown-divider divide-y divide-gray-200 dark:divide-white/10 main-header-shortcuts p-2 overflow-y-auto"
id="header-shortcut-scroll"> id="header-shortcut-scroll">
<!-- Home Button --> <!-- Home Button -->
...@@ -312,151 +312,114 @@ ...@@ -312,151 +312,114 @@
</div> </div>
<!-- Applications Grid --> <!-- Applications Grid -->
<div class="grid grid-cols-3 gap-2"> <div class="grid grid-cols-4 gap-3 min-h-0">
<!-- myHR-Plus -->
<div class=""> <div class="">
<a (click)="checkAppToken('myhr-plus')" <a (click)="checkAppToken('myhr-plus')"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/logoallHR/myhr-plus.jpg" alt="myHR-Plus" <img src="./assets/images/logoallHR/myhr-plus.jpg" alt="myHR-Plus"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myHR-Plus</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myHR-Plus</div>
</a> </a>
</div> </div>
<!-- myHR-Lite -->
<div class=""> <div class="">
<a (click)="checkAppToken('myhr-lite')" <a (click)="checkAppToken('myhr-lite')"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/logoallHR/myHR-Lite-logo-new.png" alt="myHR-Lite" <img src="./assets/images/logoallHR/myHR-Lite-logo-new.png" alt="myHR-Lite"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myHR-Lite</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myHR-Lite</div>
</a> </a>
</div> </div>
<!-- Zeeme Plus -->
<div class=""> <div class="">
<a (click)="checkAppToken('zeeme')" <a (click)="checkAppToken('zeeme')"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/logoallHR/zeemePlus.png" alt="Zeeme Plus" <img src="./assets/images/logoallHR/zeemePlus.png" alt="Zeeme Plus"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Zeeme Plus</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Zeeme Plus</div>
</a> </a>
</div> </div>
<!-- myFace -->
<div class=""> <div class="">
<a (click)="checkAppToken('myface')" <a (click)="checkAppToken('myface')"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/logoallHR/logo_myface.png" alt="myFace" <img src="./assets/images/logoallHR/logo_myface.png" alt="myFace"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myFace</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myFace</div>
</a> </a>
</div> </div>
<!-- myLearn -->
<div class=""> <div class="">
<a (click)="checkAppToken('mylearn')" <a (click)="checkAppToken('mylearn')"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/logoallHR/mylearn-logo.png" alt="myLearn" <img src="./assets/images/logoallHR/mylearn-logo.png" alt="myLearn"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myLearn</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myLearn</div>
</a> </a>
</div> </div>
<!-- myJob -->
<div class=""> <div class="">
<a (click)="checkAppToken('myjob')" <a (click)="checkAppToken('myjob')"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/logoallHR/logo_myjob.png" alt="myJob" <img src="./assets/images/logoallHR/logo_myjob.png" alt="myJob"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myJob</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">myJob</div>
</a> </a>
</div> </div>
<!-- mySkill-X -->
<div class=""> <div class="">
<a (click)="checkAppToken('myskill-x')" <a (click)="checkAppToken('myskill-x')"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/logoallHR/mySkill-x.png" alt="mySkill-X" <img src="./assets/images/logoallHR/mySkill-x.png" alt="mySkill-X"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">mySkill-X</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">mySkill-X</div>
</a>
</div>
<!-- Dashboard -->
<div class="">
<a routerLink="/portal-manage/dashboard"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/dashboard.png" alt="Dashboard"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Dashboard</div>
</a> </a>
</div> </div>
<!-- Meeting Booking --> <!-- Meeting Booking -->
<div class=""> <div class="">
<a routerLink="/portal-manage/meeting-booking" <a routerLink="/portal-manage/meeting-booking"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/calendar.png" alt="Meeting Booking" <img src="./assets/images/icons/calendar.png" alt="Meeting Booking"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Meeting</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Meeting</div>
</a>
</div>
<!-- System Management -->
<div class="">
<a routerLink="/portal-manage/permission-management"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/widget.png" alt="Permission Management"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Permission</div>
</a>
</div>
<div class="">
<a routerLink="/portal-manage/role-management"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/users.png" alt="Role Management"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Role</div>
</a>
</div>
<div class="">
<a routerLink="/portal-manage/company-management"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/building.png" alt="Company Management"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Company</div>
</a> </a>
</div> </div>
<!-- my-Portal -->
<div class=""> <div class="">
<a routerLink="/portal-manage/widget-management" <a routerLink="/portal-manage/my-portal"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/widget.png" alt="Widget Management" <img src="./assets/images/icons/portal.png" alt="my-Portal"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Widget</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">my-Portal</div>
</a> </a>
</div> </div>
<!-- Permission Management -->
<div class=""> <div class="">
<a routerLink="/portal-manage/menu-permission-management" <a routerLink="/portal-manage/permission-management"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/menu.png" alt="Menu Permission" <img src="./assets/images/icons/widget.png" alt="Permission Management"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Menu</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Permission</div>
</a> </a>
</div> </div>
<!-- Dashboard Management -->
<div class=""> <div class="">
<a routerLink="/portal-manage/dashboard-management" <a routerLink="/portal-manage/dashboard-management"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20"> class="p-3 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/dashboard.png" alt="Dashboard Management" <img src="./assets/images/icons/dashboard.png" alt="Dashboard Management"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto"> class="leading-[1.5] text-2xl !h-[1.5rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Dashboard Mgt</div> <div class="text-[0.7rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Dashboard Mgt</div>
</a>
</div>
<div class="">
<a routerLink="/portal-manage/widget-stock"
class="p-4 items-center related-app block text-center rounded-sm hover:bg-gray-50 dark:hover:bg-black/20">
<img src="./assets/images/icons/widget.png" alt="Widget Stock"
class="leading-[1.75] text-2xl !h-[1.75rem] align-middle flex justify-center mx-auto">
<div class="text-[0.75rem] text-defaulttextcolor dark:text-[#8c9097] dark:text-white/50 mt-1">Widget Stock</div>
</a> </a>
</div> </div>
......
...@@ -70,12 +70,18 @@ export class SidebarComponent { ...@@ -70,12 +70,18 @@ export class SidebarComponent {
isCommonRoute: boolean = false; isCommonRoute: boolean = false;
isInstallerRoute: boolean = false; isInstallerRoute: boolean = false;
isMyportalRoute: boolean = false; isMyportalRoute: boolean = false;
isMyPortalRoute: boolean = false;
isMylearnRoute: boolean = false; isMylearnRoute: boolean = false;
isMyJobRoute: boolean = false; isMyJobRoute: boolean = false;
isMyhrLiteRoute: boolean = false; isMyhrLiteRoute: boolean = false;
isMyFaceRoute: boolean = false; isMyFaceRoute: boolean = false;
isZeemeRoute: boolean = false; isZeemeRoute: boolean = false;
isMyhrPlusRoute: boolean = false; isMyhrPlusRoute: boolean = false;
isDashboardManagementRoute: boolean = false;
isPermissionManagementRoute: boolean = false;
isMenuPermissionManagementRoute: boolean = false;
isWidgetManagementRoute: boolean = false;
isMeetingBookingRoute: boolean = false;
previousUrl: string = ''; previousUrl: string = '';
currentUrl: string = ''; currentUrl: string = '';
...@@ -115,12 +121,18 @@ export class SidebarComponent { ...@@ -115,12 +121,18 @@ 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('/myskill-x'); this.isMyportalRoute = this.currentUrl.includes('/myskill-x');
this.isMyPortalRoute = this.currentUrl.includes('/my-portal');
this.isMylearnRoute = this.currentUrl.includes('/mylearn'); this.isMylearnRoute = this.currentUrl.includes('/mylearn');
this.isMyJobRoute = this.currentUrl.includes('/myjob'); this.isMyJobRoute = this.currentUrl.includes('/myjob');
this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite'); this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite');
this.isMyFaceRoute = this.currentUrl.includes('/myface'); this.isMyFaceRoute = this.currentUrl.includes('/myface');
this.isZeemeRoute = this.currentUrl.includes('/zeeme'); this.isZeemeRoute = this.currentUrl.includes('/zeeme');
this.isMyhrPlusRoute = this.currentUrl.includes('/myhr-plus'); this.isMyhrPlusRoute = this.currentUrl.includes('/myhr-plus');
this.isDashboardManagementRoute = this.currentUrl.includes('/dashboard-management');
this.isPermissionManagementRoute = this.currentUrl.includes('/permission-management');
this.isMenuPermissionManagementRoute = this.currentUrl.includes('/menu-permission-management');
this.isWidgetManagementRoute = this.currentUrl.includes('/widget-management');
this.isMeetingBookingRoute = this.currentUrl.includes('/meeting-booking');
this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => { this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => {
this.changeMenu() this.changeMenu()
}); });
...@@ -150,23 +162,35 @@ export class SidebarComponent { ...@@ -150,23 +162,35 @@ 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('/myskill-x'); this.isMyportalRoute = this.currentUrl.includes('/myskill-x');
this.isMyPortalRoute = this.currentUrl.includes('/my-portal');
this.isMylearnRoute = this.currentUrl.includes('/mylearn'); this.isMylearnRoute = this.currentUrl.includes('/mylearn');
this.isMyJobRoute = this.currentUrl.includes('/myjob'); this.isMyJobRoute = this.currentUrl.includes('/myjob');
this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite'); this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite');
this.isMyFaceRoute = this.currentUrl.includes('/myface'); this.isMyFaceRoute = this.currentUrl.includes('/myface');
this.isZeemeRoute = this.currentUrl.includes('/zeeme'); this.isZeemeRoute = this.currentUrl.includes('/zeeme');
this.isMyhrPlusRoute = this.currentUrl.includes('/myhr-plus'); this.isMyhrPlusRoute = this.currentUrl.includes('/myhr-plus');
this.isDashboardManagementRoute = this.currentUrl.includes('/dashboard-management');
this.isPermissionManagementRoute = this.currentUrl.includes('/permission-management');
this.isMenuPermissionManagementRoute = this.currentUrl.includes('/menu-permission-management');
this.isWidgetManagementRoute = this.currentUrl.includes('/widget-management');
this.isMeetingBookingRoute = this.currentUrl.includes('/meeting-booking');
this.checkUrlChanges() this.checkUrlChanges()
// Log to console for verification // Log to console for verification
console.log('Initial URL:', this.currentUrl); console.log('Initial URL:', this.currentUrl);
console.log('Is Common Route:', this.isCommonRoute); console.log('Is Common Route:', this.isCommonRoute);
console.log('Is Installer Route:', this.isInstallerRoute); console.log('Is Installer Route:', this.isInstallerRoute);
console.log('Is Myskill-X Route:', this.isMyportalRoute); console.log('Is Myskill-X Route:', this.isMyportalRoute);
console.log('Is my-Portal Route:', this.isMyPortalRoute);
console.log('mylearn routes',this.isMylearnRoute); console.log('mylearn routes',this.isMylearnRoute);
console.log('myhrlite routes',this.isMyhrLiteRoute); console.log('myhrlite routes',this.isMyhrLiteRoute);
console.log('myface routes',this.isMyFaceRoute); console.log('myface routes',this.isMyFaceRoute);
console.log('zeeme routes',this.isZeemeRoute); console.log('zeeme routes',this.isZeemeRoute);
console.log('myhrplus routes',this.isMyhrPlusRoute); console.log('myhrplus routes',this.isMyhrPlusRoute);
console.log('dashboard-management routes',this.isDashboardManagementRoute);
console.log('permission-management routes',this.isPermissionManagementRoute);
console.log('menu-permission-management routes',this.isMenuPermissionManagementRoute);
console.log('widget-management routes',this.isWidgetManagementRoute);
console.log('meeting-booking routes',this.isMeetingBookingRoute);
} }
...@@ -198,12 +222,18 @@ export class SidebarComponent { ...@@ -198,12 +222,18 @@ 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('/myskill-x'); this.isMyportalRoute = this.currentUrl.includes('/myskill-x');
this.isMyPortalRoute = this.currentUrl.includes('/my-portal');
this.isMylearnRoute = this.currentUrl.includes('/mylearn'); this.isMylearnRoute = this.currentUrl.includes('/mylearn');
this.isMyJobRoute = this.currentUrl.includes('/myjob'); this.isMyJobRoute = this.currentUrl.includes('/myjob');
this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite'); this.isMyhrLiteRoute = this.currentUrl.includes('/myhr-lite');
this.isMyFaceRoute = this.currentUrl.includes('/myface'); this.isMyFaceRoute = this.currentUrl.includes('/myface');
this.isZeemeRoute = this.currentUrl.includes('/zeeme'); this.isZeemeRoute = this.currentUrl.includes('/zeeme');
this.isMyhrPlusRoute = this.currentUrl.includes('/myhr-plus'); this.isMyhrPlusRoute = this.currentUrl.includes('/myhr-plus');
this.isDashboardManagementRoute = this.currentUrl.includes('/dashboard-management');
this.isPermissionManagementRoute = this.currentUrl.includes('/permission-management');
this.isMenuPermissionManagementRoute = this.currentUrl.includes('/menu-permission-management');
this.isWidgetManagementRoute = this.currentUrl.includes('/widget-management');
this.isMeetingBookingRoute = this.currentUrl.includes('/meeting-booking');
// Log to console for verification // Log to console for verification
console.log('Current URL:', this.currentUrl); console.log('Current URL:', this.currentUrl);
...@@ -230,6 +260,8 @@ export class SidebarComponent { ...@@ -230,6 +260,8 @@ export class SidebarComponent {
this.menuItems = this.navServices.getCompanyMenu(); this.menuItems = this.navServices.getCompanyMenu();
}else if (this.isMyportalRoute){ }else if (this.isMyportalRoute){
this.menuItems = this.navServices.getMyportalMenu(); this.menuItems = this.navServices.getMyportalMenu();
} else if (this.isMyPortalRoute){
this.menuItems = this.navServices.getMyPortalMenu();
} else if (this.isMylearnRoute){ } else if (this.isMylearnRoute){
this.menuItems = this.navServices.getMylearnMenu(); this.menuItems = this.navServices.getMylearnMenu();
} else if (this.isMyJobRoute){ } else if (this.isMyJobRoute){
...@@ -242,10 +274,20 @@ export class SidebarComponent { ...@@ -242,10 +274,20 @@ export class SidebarComponent {
this.menuItems = this.navServices.getZeemeMenu(); this.menuItems = this.navServices.getZeemeMenu();
} else if (this.isMyhrPlusRoute){ } else if (this.isMyhrPlusRoute){
this.menuItems = this.navServices.getMyhrPlusMenu(); this.menuItems = this.navServices.getMyhrPlusMenu();
} else if (this.isDashboardManagementRoute){
this.menuItems = this.navServices.getSystemManagementMenu();
} else if (this.isPermissionManagementRoute){
this.menuItems = this.navServices.getSystemManagementMenu();
} else if (this.isMenuPermissionManagementRoute){
this.menuItems = this.navServices.getSystemManagementMenu();
} else if (this.isWidgetManagementRoute){
this.menuItems = this.navServices.getSystemManagementMenu();
} else if (this.isMeetingBookingRoute){
this.menuItems = this.navServices.getSystemManagementMenu();
} }
// เพิ่มรายการรายงาน Excel เข้าไปในเมนู หากมีข้อมูลและยังไม่ได้เพิ่ม // เพิ่มรายการรายงาน Excel เข้าไปในเมนู หากมีข้อมูลและยังไม่ได้เพิ่ม
if ((this.isMyportalRoute||this.isInstallerRoute)&&this.submenuExcel.length > 0) { if ((this.isMyportalRoute||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) {
...@@ -389,7 +431,7 @@ export class SidebarComponent { ...@@ -389,7 +431,7 @@ export class SidebarComponent {
element.selected = true; element.selected = true;
} }
// ตรวจสอบ path สำหรับ Excel Report ที่มี query parameters // ตรวจสอบ path สำหรับ Excel Report ที่มี query parameters
if ((this.isMyportalRoute||this.isInstallerRoute)&&ele.path && this.currentUrl.startsWith(ele.path.split('?')[0])) { if ((this.isMyportalRoute||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) {
...@@ -410,7 +452,7 @@ export class SidebarComponent { ...@@ -410,7 +452,7 @@ export class SidebarComponent {
ele.selected = true; ele.selected = true;
} }
// ตรวจสอบ path สำหรับ Excel Report ที่มี query parameters ในระดับที่ 3 // ตรวจสอบ path สำหรับ Excel Report ที่มี query parameters ในระดับที่ 3
if ((this.isMyportalRoute||this.isInstallerRoute)&&child1.path && this.currentUrl.startsWith(child1.path.split('?')[0])) { if ((this.isMyportalRoute||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) {
......
...@@ -146,7 +146,7 @@ export class NavService implements OnDestroy { ...@@ -146,7 +146,7 @@ export class NavService implements OnDestroy {
type: 'sub', type: 'sub',
children: [ children: [
{ path: `/portal-manage/${appName}/excel-list`, title: 'เพิ่มรายงาน Excel', type: 'link' }, { path: `/portal-manage/${appName}/excel-list`, title: 'เพิ่มรายงาน Excel', type: 'link' },
{ path: `/${appName}/excel-report-toggle`, title: 'เปิด-ปิด การใช้รายงาน Excel', type: 'link' } { path: `/portal-manage/${appName}/excel-report-toggle`, title: 'เปิด-ปิด การใช้รายงาน Excel', type: 'link' }
], ],
}, },
{ {
...@@ -163,6 +163,53 @@ export class NavService implements OnDestroy { ...@@ -163,6 +163,53 @@ export class NavService implements OnDestroy {
},] },]
} }
// เมนูสำหรับ my-portal โดยเฉพาะ
getMyPortalMenu() {
return [
{ headTitle: 'my-Portal' },
{
title: 'แดชบอร์ด',
icon: 'dashboard',
path: '/portal-manage/my-portal',
type: 'link',
},
{
title: 'จัดการเอกสาร',
icon: 'file-text',
type: 'sub',
active: false,
children: [
{ path: '/portal-manage/my-portal/create-category', title: 'สร้างหมวดหมู่', type: 'link' },
{ path: '/portal-manage/my-portal/category-list', title: 'รายการหมวดหมู่', type: 'link' },
{ path: '/portal-manage/my-portal/category-list-approve', title: 'อนุมัติเอกสาร', type: 'link' },
{ path: '/portal-manage/my-portal/approved-list', title: 'รายการที่อนุมัติแล้ว', type: 'link' },
],
},
{
title: 'จัดการ Excel',
icon: 'file-excel',
type: 'sub',
active: false,
children: [
{ path: '/portal-manage/my-portal/excel-list', title: 'รายการ Excel', type: 'link' },
{ path: '/portal-manage/my-portal/excel-report', title: 'รายงาน Excel', type: 'link' },
{ path: '/portal-manage/my-portal/excel-report-toggle', title: 'เปิด-ปิด รายงาน Excel', type: 'link' },
],
},
{
title: 'เครื่องมือเสริม',
icon: 'tools',
type: 'sub',
active: false,
children: [
{ path: '/portal-manage/my-portal/datasource-table', title: 'DataSource Table', type: 'link' },
{ path: '/portal-manage/my-portal/view-list-excel', title: 'ดูรายการ Excel', type: 'link' },
{ path: '/portal-manage/my-portal/open-image', title: 'เปิดรูปภาพ', type: 'link' },
],
}
];
}
getCompanyMenu() { getCompanyMenu() {
...@@ -329,15 +376,39 @@ export class NavService implements OnDestroy { ...@@ -329,15 +376,39 @@ export class NavService implements OnDestroy {
type: 'link', type: 'link',
}, },
{ {
title: 'จัดการพนักงาน',
icon: 'user',
type: 'sub',
active: false,
children: [
{ path: '/portal-manage/myhr-lite/employee', title: 'ข้อมูลพนักงาน', type: 'link' },
{ path: '/portal-manage/myhr-lite/employee-profile', title: 'โปรไฟล์พนักงาน', type: 'link' },
{ path: '/portal-manage/myhr-lite/employee-documents', title: 'เอกสารพนักงาน', type: 'link' },
],
},
{
title: 'จัดการระบบ', title: 'จัดการระบบ',
icon: 'settings', icon: 'settings',
type: 'sub', type: 'sub',
active: false, active: false,
children: [ children: [
{ path: '/portal-manage/myhr-lite/employee', title: 'จัดการพนักงาน', type: 'link' }, { path: '/portal-manage/myhr-lite/company-settings', title: 'ตั้งค่าบริษัท', type: 'link' },
{ path: '/portal-manage/myhr-lite/reports', title: 'รายงาน', type: 'link' }, { path: '/portal-manage/myhr-lite/department-settings', title: 'ตั้งค่าแผนก', type: 'link' },
{ path: '/portal-manage/myhr-lite/position-settings', title: 'ตั้งค่าตำแหน่ง', type: 'link' },
], ],
} },
{
title: 'รายงาน',
icon: 'chart-bar',
type: 'sub',
active: false,
children: [
{ path: '/portal-manage/myhr-lite/reports', title: 'รายงานทั่วไป', type: 'link' },
{ path: '/portal-manage/myhr-lite/employee-reports', title: 'รายงานพนักงาน', type: 'link' },
{ path: '/portal-manage/myhr-lite/attendance-reports', title: 'รายงานการลงเวลา', type: 'link' },
],
},
...this.createPortalMenu('myhr-lite')
]; ];
} }
...@@ -360,7 +431,19 @@ export class NavService implements OnDestroy { ...@@ -360,7 +431,19 @@ export class NavService implements OnDestroy {
children: [ children: [
{ path: '/portal-manage/myface/face-recognition', title: 'ระบบจดจำใบหน้า', type: 'link' }, { path: '/portal-manage/myface/face-recognition', title: 'ระบบจดจำใบหน้า', type: 'link' },
{ path: '/portal-manage/myface/face-management', title: 'จัดการข้อมูลใบหน้า', type: 'link' }, { path: '/portal-manage/myface/face-management', title: 'จัดการข้อมูลใบหน้า', type: 'link' },
{ path: '/portal-manage/myface/attendance', title: 'ระบบลงเวลา', type: 'link' }, { path: '/portal-manage/myface/face-enrollment', title: 'ลงทะเบียนใบหน้า', type: 'link' },
{ path: '/portal-manage/myface/face-verification', title: 'ตรวจสอบใบหน้า', type: 'link' },
],
},
{
title: 'ระบบลงเวลา',
icon: 'time',
type: 'sub',
active: false,
children: [
{ path: '/portal-manage/myface/attendance', title: 'ลงเวลา', type: 'link' },
{ path: '/portal-manage/myface/attendance-settings', title: 'ตั้งค่าระบบลงเวลา', type: 'link' },
{ path: '/portal-manage/myface/attendance-location', title: 'สถานที่ลงเวลา', type: 'link' },
], ],
}, },
{ {
...@@ -371,8 +454,10 @@ export class NavService implements OnDestroy { ...@@ -371,8 +454,10 @@ export class NavService implements OnDestroy {
children: [ children: [
{ path: '/portal-manage/myface/attendance-report', title: 'รายงานการลงเวลา', type: 'link' }, { path: '/portal-manage/myface/attendance-report', title: 'รายงานการลงเวลา', type: 'link' },
{ path: '/portal-manage/myface/face-report', title: 'รายงานการจดจำใบหน้า', type: 'link' }, { path: '/portal-manage/myface/face-report', title: 'รายงานการจดจำใบหน้า', type: 'link' },
{ path: '/portal-manage/myface/security-report', title: 'รายงานความปลอดภัย', type: 'link' },
], ],
} },
...this.createPortalMenu('myface')
]; ];
} }
...@@ -396,6 +481,19 @@ export class NavService implements OnDestroy { ...@@ -396,6 +481,19 @@ export class NavService implements OnDestroy {
{ path: '/portal-manage/zeeme/time-tracking', title: 'ติดตามเวลา', type: 'link' }, { path: '/portal-manage/zeeme/time-tracking', title: 'ติดตามเวลา', type: 'link' },
{ path: '/portal-manage/zeeme/attendance', title: 'ระบบลงเวลา', type: 'link' }, { path: '/portal-manage/zeeme/attendance', title: 'ระบบลงเวลา', type: 'link' },
{ path: '/portal-manage/zeeme/overtime', title: 'การทำงานล่วงเวลา', type: 'link' }, { path: '/portal-manage/zeeme/overtime', title: 'การทำงานล่วงเวลา', type: 'link' },
{ path: '/portal-manage/zeeme/break-time', title: 'เวลาพัก', type: 'link' },
{ path: '/portal-manage/zeeme/shift-management', title: 'จัดการกะงาน', type: 'link' },
],
},
{
title: 'จัดการพนักงาน',
icon: 'user',
type: 'sub',
active: false,
children: [
{ path: '/portal-manage/zeeme/employee-schedule', title: 'ตารางงานพนักงาน', type: 'link' },
{ path: '/portal-manage/zeeme/leave-management', title: 'จัดการการลา', type: 'link' },
{ path: '/portal-manage/zeeme/approval-workflow', title: 'อนุมัติการลา', type: 'link' },
], ],
}, },
{ {
...@@ -407,8 +505,10 @@ export class NavService implements OnDestroy { ...@@ -407,8 +505,10 @@ export class NavService implements OnDestroy {
{ path: '/portal-manage/zeeme/attendance-report', title: 'รายงานการลงเวลา', type: 'link' }, { path: '/portal-manage/zeeme/attendance-report', title: 'รายงานการลงเวลา', type: 'link' },
{ path: '/portal-manage/zeeme/overtime-report', title: 'รายงานการทำงานล่วงเวลา', type: 'link' }, { path: '/portal-manage/zeeme/overtime-report', title: 'รายงานการทำงานล่วงเวลา', type: 'link' },
{ path: '/portal-manage/zeeme/summary-report', title: 'รายงานสรุป', type: 'link' }, { path: '/portal-manage/zeeme/summary-report', title: 'รายงานสรุป', type: 'link' },
{ path: '/portal-manage/zeeme/leave-report', title: 'รายงานการลา', type: 'link' },
], ],
} },
...this.createPortalMenu('zeeme')
]; ];
} }
...@@ -432,6 +532,12 @@ export class NavService implements OnDestroy { ...@@ -432,6 +532,12 @@ export class NavService implements OnDestroy {
return [ return [
{ headTitle: 'การตั้งค่าระบบ' }, { headTitle: 'การตั้งค่าระบบ' },
{ {
title: 'my-Portal',
icon: 'upload-cloud',
path: '/portal-manage/my-portal',
type: 'link',
},
{
title: 'จัดการสิทธิ์', title: 'จัดการสิทธิ์',
icon: 'shield', icon: 'shield',
type: 'sub', type: 'sub',
...@@ -514,6 +620,8 @@ export class NavService implements OnDestroy { ...@@ -514,6 +620,8 @@ export class NavService implements OnDestroy {
return this.getMyJobMenu(); return this.getMyJobMenu();
case 'myskill-x': case 'myskill-x':
return this.getMyportalMenu(); return this.getMyportalMenu();
case 'my-portal':
return this.getMyPortalMenu();
case 'company-management': case 'company-management':
return this.getCompanyMenu(); return this.getCompanyMenu();
case 'dashboard': case 'dashboard':
...@@ -541,6 +649,7 @@ export class NavService implements OnDestroy { ...@@ -541,6 +649,7 @@ export class NavService implements OnDestroy {
'mylearn': this.getMylearnMenu(), 'mylearn': this.getMylearnMenu(),
'myjob': this.getMyJobMenu(), 'myjob': this.getMyJobMenu(),
'myskill-x': this.getMyportalMenu(), 'myskill-x': this.getMyportalMenu(),
'my-portal': this.getMyPortalMenu(),
'company-management': this.getCompanyMenu(), 'company-management': this.getCompanyMenu(),
'dashboard': this.getDashboardMenu(), 'dashboard': this.getDashboardMenu(),
'meeting-booking': this.getSystemManagementMenu(), 'meeting-booking': this.getSystemManagementMenu(),
......
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