Commit 959e1ddc by Nattana Chaiyamat

แก้เปลี่ยนหน้าให้เมนูยังเปิดอยู่ scrollขึ้นบนสุด และแก้คำ แผนพัฒนาบุคคลากร >> แผนพัฒนาบุคลากร

parent 1ae0651b
...@@ -88,7 +88,7 @@ const routes: Routes = [ ...@@ -88,7 +88,7 @@ const routes: Routes = [
{ path: "admin/edit-group-competencies", title: 'แก้ไขกลุ่มสมรรถนะ', component: EditGroupCompetenciesComponent }, { path: "admin/edit-group-competencies", title: 'แก้ไขกลุ่มสมรรถนะ', component: EditGroupCompetenciesComponent },
{ path: "admin/evaluation-cycle-manager", title: 'การจัดการรอบการประเมิน', component: EvaluationCycleManagerComponent }, { path: "admin/evaluation-cycle-manager", title: 'การจัดการรอบการประเมิน', component: EvaluationCycleManagerComponent },
{ path: "admin/setting-competency", title: 'การตั้งค่า', component: SettingCompetencyComponent }, { path: "admin/setting-competency", title: 'การตั้งค่า', component: SettingCompetencyComponent },
{ path: "ess/idp-development-plan", title: 'เเผนพัฒนา IDP', component: IdpDevelopmentPlanComponent }, { path: "admin/idp-development-plan", title: 'เเผนพัฒนา IDP', component: IdpDevelopmentPlanComponent },
{ path: "admin/job-competency", title: 'ความรู้ ทักษะ ความสามารถในตำเเหน่งงาน', component: JobCompetencyComponent }, { path: "admin/job-competency", title: 'ความรู้ ทักษะ ความสามารถในตำเเหน่งงาน', component: JobCompetencyComponent },
{ path: "admin/job-qualifications", title: 'คุณสมบัติที่จำเป็นต่อการปฏิบัติหน้าที่', component: JobQualificationsComponent }, { path: "admin/job-qualifications", title: 'คุณสมบัติที่จำเป็นต่อการปฏิบัติหน้าที่', component: JobQualificationsComponent },
{ path: "admin/job-detail", title: 'รายละเอียดของงาน', component: JobDetailComponent }, { path: "admin/job-detail", title: 'รายละเอียดของงาน', component: JobDetailComponent },
......
...@@ -422,7 +422,7 @@ ...@@ -422,7 +422,7 @@
<div class="box-header"> <div class="box-header">
<div class="flex flex-row gap-2"> <div class="flex flex-row gap-2">
<ng-container <ng-container
*ngFor="let item of ['ข้อมูลการประเมิน','แบบประเมินสมรรถนะ','ประเมินผลการปฏิบัติงาน','สรุปคะแนนและข้อเสนอแนะ','แผนพัฒนาบุคลากร']"> *ngFor="let item of ['ข้อมูลการประเมิน','แบบประเมินสมรรถนะ','ประเมินผลการปฏิบัติงาน','สรุปคะแนนและข้อเสนอแนะ','แผนพัฒนาบุคลากร']">
<button type="button" class="flex-1 flex flex-row border bg-white p-2 justify-center" <button type="button" class="flex-1 flex flex-row border bg-white p-2 justify-center"
style="border-radius:20px" (click)="currentTap=item" style="border-radius:20px" (click)="currentTap=item"
[ngClass]="{'!bg-primary text-white':currentTap==item}"> [ngClass]="{'!bg-primary text-white':currentTap==item}">
...@@ -483,7 +483,7 @@ ...@@ -483,7 +483,7 @@
(kpiForm)="compentency.data.pms=$event" (scrollToMenuId)="scrollToMenu($event)" (kpiForm)="compentency.data.pms=$event" (scrollToMenuId)="scrollToMenu($event)"
[compentencyFormRemain]="compentencyFormRemain"></app-pms-kpi> [compentencyFormRemain]="compentencyFormRemain"></app-pms-kpi>
</div> </div>
<div class="min-height: calc(100vh - 406px);" [class.hidden]="currentTap!='แผนพัฒนาบุคลากร'"> <div class="min-height: calc(100vh - 406px);" [class.hidden]="currentTap!='แผนพัฒนาบุคลากร'">
<app-pms-idp [currentTap]="currentTap" [canSave]="canSave" [appraisalIdp]="compentency.data.idp" <app-pms-idp [currentTap]="currentTap" [canSave]="canSave" [appraisalIdp]="compentency.data.idp"
[evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId" [evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId"
[canEdit]="evaluationForm=='sup'?canEdit:false" [currentStep]="compentency.data.currentStep" [canEdit]="evaluationForm=='sup'?canEdit:false" [currentStep]="compentency.data.currentStep"
......
...@@ -7,6 +7,7 @@ import { checkHoriMenu, switcherArrowFn } from './sidebar'; ...@@ -7,6 +7,7 @@ import { checkHoriMenu, switcherArrowFn } from './sidebar';
import { ConfigPermissionService } from '../../services/config-permission.service'; import { ConfigPermissionService } from '../../services/config-permission.service';
import { ConfigPermissionModel, MenuBodyModel, MyConfigPermissionModel } from '../../model/config-permission.model'; import { ConfigPermissionModel, MenuBodyModel, MyConfigPermissionModel } from '../../model/config-permission.model';
import { TokenService } from '../../services/token.service'; import { TokenService } from '../../services/token.service';
import { ViewportScroller } from '@angular/common';
@Component({ @Component({
selector: 'app-sidebar', selector: 'app-sidebar',
...@@ -80,7 +81,8 @@ export class SidebarComponent { ...@@ -80,7 +81,8 @@ export class SidebarComponent {
private elementRef: ElementRef, private elementRef: ElementRef,
private configPermissionService: ConfigPermissionService, private configPermissionService: ConfigPermissionService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private tokenService: TokenService private tokenService: TokenService,
private viewScroller: ViewportScroller
) { ) {
this.screenWidth = window.innerWidth; this.screenWidth = window.innerWidth;
this.user_level = this.tokenService.getUser()?.user_level this.user_level = this.tokenService.getUser()?.user_level
...@@ -181,7 +183,10 @@ export class SidebarComponent { ...@@ -181,7 +183,10 @@ export class SidebarComponent {
changeMenu() { changeMenu() {
if (this.isESSRoute) { if (this.isESSRoute) {
this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => { this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => {
this.menuItems = this.navServices.getCustomerMenu(); if (!this.previousUrl.includes('/self-evaluation') && !this.previousUrl.includes('/supervisor-evaluation')) {
this.menuItems = this.navServices.getCustomerMenu();
this.ParentActive()
}
}); });
// if(this.tokenService.getUser().role=='manager'){ // if(this.tokenService.getUser().role=='manager'){
// this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => { // this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => {
...@@ -193,14 +198,14 @@ export class SidebarComponent { ...@@ -193,14 +198,14 @@ export class SidebarComponent {
// this.menuItems = this.navServices.getProjectEmpMenu(); // this.menuItems = this.navServices.getProjectEmpMenu();
// }); // });
// } // }
} else {
}
else {
this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => { this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => {
this.menuItems = this.navServices.getAdminMenu(); if (!this.previousUrl.includes('/admin/') && !this.previousUrl.includes('/dashboard')) {
this.menuItems = this.navServices.getAdminMenu();
this.ParentActive()
}
}); });
} }
this.ParentActive()
} }
getConfigPermissionByUserLevel() { getConfigPermissionByUserLevel() {
this.configPermission.loading = true this.configPermission.loading = true
...@@ -267,9 +272,11 @@ export class SidebarComponent { ...@@ -267,9 +272,11 @@ export class SidebarComponent {
//Active Nav State //Active Nav State
setNavActive(item: any) { setNavActive(item: any) {
this.viewScroller.scrollToPosition([0, 0]);
this.menuItems?.filter((menuItem: Menu) => { this.menuItems?.filter((menuItem: Menu) => {
if (menuItem !== item) { if (menuItem !== item) {
menuItem.active = false; menuItem.active = false;
menuItem.selected = false;
this.navServices.collapseSidebar = false; this.navServices.collapseSidebar = false;
} }
if (menuItem.children && menuItem.children.includes(item)) { if (menuItem.children && menuItem.children.includes(item)) {
...@@ -342,30 +349,30 @@ export class SidebarComponent { ...@@ -342,30 +349,30 @@ export class SidebarComponent {
} }
ParentActive() { ParentActive() {
this.menuItems.map((element: any) => { // this.menuItems.map((element: any) => {
if (element.children) { // if (element.children) {
element.active = false; // element.active = false;
element.selected = false; // element.selected = false;
element.children.map((ele: any) => { // element.children.map((ele: any) => {
if (ele.path == this.router.url) { // if (ele.path == this.router.url) {
element.active = true; // element.active = true;
element.selected = true; // element.selected = true;
} // }
if (ele.children) { // if (ele.children) {
ele.active = false; // ele.active = false;
ele.children.map((child1: any) => { // ele.children.map((child1: any) => {
if (child1.path == this.router.url) { // if (child1.path == this.router.url) {
element.active = true; // element.active = true;
element.selected = true; // element.selected = true;
ele.active = true; // ele.active = true;
ele.selected = true; // ele.selected = true;
} // }
}); // });
} // }
}); // });
} // }
}); // });
} }
@ViewChild('iconContainer', { static: true }) iconContainer!: ElementRef; @ViewChild('iconContainer', { static: true }) iconContainer!: ElementRef;
......
...@@ -130,8 +130,8 @@ export class NavService implements OnDestroy { ...@@ -130,8 +130,8 @@ export class NavService implements OnDestroy {
{ {
title: 'Dashboard', title: 'Dashboard',
type: 'link', type: 'link',
selected: false, selected: true,
active: false, active: true,
path: '/dashboard/projects', path: '/dashboard/projects',
id: 'm0', id: 'm0',
show: true, show: true,
......
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