Commit 959e1ddc by Nattana Chaiyamat

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

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