Commit 1ae0bac7 by Nattana Chaiyamat

หน้า report

parent dd78ece5
...@@ -296,12 +296,13 @@ ...@@ -296,12 +296,13 @@
<label (click)="toggleMenuItemsShow(menuBody.path)" class="text-xl cursor-pointer user-select-none"> <label (click)="toggleMenuItemsShow(menuBody.path)" class="text-xl cursor-pointer user-select-none">
{{menuBody.title}} {{menuBody.title}}
</label> </label>
<i [class.ti-chevron-down]="menuItemsShow.get(menuBody.path+menuBody.title)" <i *ngIf="menuBody.children.length"
[class.ti-chevron-down]="menuItemsShow.get(menuBody.path+menuBody.title)"
[class.ti-chevron-up]="!menuItemsShow.get(menuBody.path+menuBody.title)" [class.ti-chevron-up]="!menuItemsShow.get(menuBody.path+menuBody.title)"
class="ti cursor-pointer i-gray fs-l px-1 align-self-center" class="ti cursor-pointer i-gray fs-l px-1 align-self-center"
(click)="toggleMenuItemsShow(menuBody.path+menuBody.title)"></i> (click)="toggleMenuItemsShow(menuBody.path+menuBody.title)"></i>
</div> </div>
<ng-container *ngIf="menuItemsShow.get(menuBody.path+menuBody.title)"> <ng-container *ngIf="menuItemsShow.get(menuBody.path+menuBody.title) ">
<div class="ml-5rem flex" *ngFor="let children of menuBody.children; let i=index"> <div class="ml-5rem flex" *ngFor="let children of menuBody.children; let i=index">
<input type="checkbox" class="ti-form-checkbox align-self-center mr-10px cursor-pointer" <input type="checkbox" class="ti-form-checkbox align-self-center mr-10px cursor-pointer"
[id]="'checkbox'+children.path+children.title" [(ngModel)]="children.show"> [id]="'checkbox'+children.path+children.title" [(ngModel)]="children.show">
......
...@@ -17,7 +17,7 @@ export class RolePermissionConfigComponent { ...@@ -17,7 +17,7 @@ export class RolePermissionConfigComponent {
currentModal: 'add' | 'edit' | 'delete' | 'updateMenu' = "add" currentModal: 'add' | 'edit' | 'delete' | 'updateMenu' = "add"
setMenuPage = false setMenuPage = true
configPermission: { loading: boolean, select: ConfigPermissionModel, dataList: ConfigPermissionModel[] } = { loading: false, select: new MyConfigPermissionModel(), dataList: [] } configPermission: { loading: boolean, select: ConfigPermissionModel, dataList: ConfigPermissionModel[] } = { loading: false, select: new MyConfigPermissionModel(), dataList: [] }
menuItems: MenuBodyModel[] = [] menuItems: MenuBodyModel[] = []
menuItemsShow: Map<string, boolean> = new Map(); menuItemsShow: Map<string, boolean> = new Map();
...@@ -50,7 +50,7 @@ export class RolePermissionConfigComponent { ...@@ -50,7 +50,7 @@ export class RolePermissionConfigComponent {
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private navServices: NavService, private navServices: NavService,
private configPermissionService: ConfigPermissionService) { private configPermissionService: ConfigPermissionService) {
this.navServices.items.subscribe((items) => { this.navServices.itemsBack.subscribe((items) => {
this.menuItems = items.map(x => new MyMenuBodyModel(x as any)) this.menuItems = items.map(x => new MyMenuBodyModel(x as any))
}); });
this.companyId = this.decodeJWT(sessionStorage.getItem("accessToken") || '').companyid this.companyId = this.decodeJWT(sessionStorage.getItem("accessToken") || '').companyid
...@@ -96,6 +96,7 @@ export class RolePermissionConfigComponent { ...@@ -96,6 +96,7 @@ export class RolePermissionConfigComponent {
this.configPermission.select = new MyConfigPermissionModel(data) this.configPermission.select = new MyConfigPermissionModel(data)
const menuBody: MenuBodyModel[] = JSON.parse(JSON.stringify(this.configPermission.select.menuBody)) const menuBody: MenuBodyModel[] = JSON.parse(JSON.stringify(this.configPermission.select.menuBody))
this.configPermission.select.menuBody = this.menuItems.map(x => new MyMenuBodyModel(x)) this.configPermission.select.menuBody = this.menuItems.map(x => new MyMenuBodyModel(x))
console.log(" 🐒 this.configPermission.select.menuBody:", this.configPermission.select.menuBody)
this.clearDataMenu() this.clearDataMenu()
this.configPermission.select.menuBody.forEach(x => { this.configPermission.select.menuBody.forEach(x => {
const configMenu = menuBody.find(y => y.id == x.id) const configMenu = menuBody.find(y => y.id == x.id)
......
...@@ -46,6 +46,12 @@ import { PmsFormEmployeeComponent } from '../performance-evaluation/pms-form-emp ...@@ -46,6 +46,12 @@ import { PmsFormEmployeeComponent } from '../performance-evaluation/pms-form-emp
import { EmployeeSelfServiceComponent } from '../employee-self-service/employee-self-service.component'; import { EmployeeSelfServiceComponent } from '../employee-self-service/employee-self-service.component';
import { MySkillXModuleComponent } from '../my-skill-x-module/my-skill-x-module.component'; import { MySkillXModuleComponent } from '../my-skill-x-module/my-skill-x-module.component';
import { DashboardEvaluationComponent } from './projects/dashboard-evaluation.component'; import { DashboardEvaluationComponent } from './projects/dashboard-evaluation.component';
import { ReportCom1Component } from '../report-component/report-com/report-com-1/report-com-1.component';
import { ReportCom2Component } from '../report-component/report-com/report-com-2/report-com-2.component';
import { ReportCom3Component } from '../report-component/report-com/report-com-3/report-com-3.component';
import { ReportPms1Component } from '../report-component/report-pms/report-pms-1/report-pms-1.component';
import { ReportPms2Component } from '../report-component/report-pms/report-pms-2/report-pms-2.component';
import { ReportPms3Component } from '../report-component/report-pms/report-pms-3/report-pms-3.component';
...@@ -102,7 +108,13 @@ const routes: Routes = [ ...@@ -102,7 +108,13 @@ const routes: Routes = [
{ path: "admin/time-attendance", title: 'ทะเบียนการประเมินเวลาทำงาน', component: TimeAttendanceComponent }, { path: "admin/time-attendance", title: 'ทะเบียนการประเมินเวลาทำงาน', component: TimeAttendanceComponent },
{ path: "admin/role-permission-config", title: 'กำหนดสิทธิการเข้าใช้งาน', component: RolePermissionConfigComponent }, { path: "admin/role-permission-config", title: 'กำหนดสิทธิการเข้าใช้งาน', component: RolePermissionConfigComponent },
{ path: "ess/employee-self-service", title: 'employee-self-service', component: EmployeeSelfServiceComponent }, { path: "ess/employee-self-service", title: 'employee-self-service', component: EmployeeSelfServiceComponent },
{ path: "ess/my-skill-x-module", title: 'my-skill-x-module', component: MySkillXModuleComponent }
{ path: "admin/report-com-1", title: 'report-com-1', component: ReportCom1Component },
{ path: "admin/report-com-2", title: 'report-com-2', component: ReportCom2Component },
{ path: "admin/report-com-3", title: 'report-com-3', component: ReportCom3Component },
{ path: "admin/report-pms-1", title: 'report-pms-1', component: ReportPms1Component },
{ path: "admin/report-pms-2", title: 'report-pms-2', component: ReportPms2Component },
{ path: "admin/report-pms-3", title: 'report-pms-3', component: ReportPms3Component }
] ]
} }
]; ];
......
...@@ -180,6 +180,12 @@ import { EmployeeSelfServiceComponent } from '../employee-self-service/employee- ...@@ -180,6 +180,12 @@ import { EmployeeSelfServiceComponent } from '../employee-self-service/employee-
import { MySkillXModuleComponent } from '../my-skill-x-module/my-skill-x-module.component'; import { MySkillXModuleComponent } from '../my-skill-x-module/my-skill-x-module.component';
import { DashboardEvaluationComponent } from './projects/dashboard-evaluation.component'; import { DashboardEvaluationComponent } from './projects/dashboard-evaluation.component';
import { NgxEchartsModule } from 'ngx-echarts'; import { NgxEchartsModule } from 'ngx-echarts';
import { ReportCom1Component } from '../report-component/report-com/report-com-1/report-com-1.component';
import { ReportCom2Component } from '../report-component/report-com/report-com-2/report-com-2.component';
import { ReportCom3Component } from '../report-component/report-com/report-com-3/report-com-3.component';
import { ReportPms1Component } from '../report-component/report-pms/report-pms-1/report-pms-1.component';
import { ReportPms2Component } from '../report-component/report-pms/report-pms-2/report-pms-2.component';
import { ReportPms3Component } from '../report-component/report-pms/report-pms-3/report-pms-3.component';
export const MY_DATE_FORMATS = { export const MY_DATE_FORMATS = {
parse: { parse: {
...@@ -343,7 +349,7 @@ export class CustomDateAdapter extends NativeDateAdapter { ...@@ -343,7 +349,7 @@ export class CustomDateAdapter extends NativeDateAdapter {
BarRatingModule, BarRatingModule,
NgxEchartsModule.forRoot({ // ✅ โหลด ECharts เพียงครั้งเดียว NgxEchartsModule.forRoot({ // ✅ โหลด ECharts เพียงครั้งเดียว
echarts: () => import('echarts') echarts: () => import('echarts')
}) })
], ],
providers: [ providers: [
Bu1Service, Bu1Service,
...@@ -392,6 +398,12 @@ export class CustomDateAdapter extends NativeDateAdapter { ...@@ -392,6 +398,12 @@ export class CustomDateAdapter extends NativeDateAdapter {
EmpStatusService, EmpStatusService,
ConfigPermissionService, ConfigPermissionService,
TokenService, TokenService,
ReportCom1Component,
ReportCom2Component,
ReportCom3Component,
ReportPms1Component,
ReportPms2Component,
ReportPms3Component
{ {
provide: HTTP_INTERCEPTORS, provide: HTTP_INTERCEPTORS,
useClass: HttpRequestInterceptor, useClass: HttpRequestInterceptor,
......
import { Component } from '@angular/core';
@Component({
selector: 'app-report-com-1',
templateUrl: './report-com-1.component.html',
styleUrls: ['./report-com-1.component.scss']
})
export class ReportCom1Component {
}
import { Component } from '@angular/core';
@Component({
selector: 'app-report-com-2',
templateUrl: './report-com-2.component.html',
styleUrls: ['./report-com-2.component.scss']
})
export class ReportCom2Component {
}
import { Component } from '@angular/core';
@Component({
selector: 'app-report-com-3',
templateUrl: './report-com-3.component.html',
styleUrls: ['./report-com-3.component.scss']
})
export class ReportCom3Component {
}
import { Component } from '@angular/core';
@Component({
selector: 'app-report-pms-1',
templateUrl: './report-pms-1.component.html',
styleUrls: ['./report-pms-1.component.scss']
})
export class ReportPms1Component {
}
import { Component } from '@angular/core';
@Component({
selector: 'app-report-pms-2',
templateUrl: './report-pms-2.component.html',
styleUrls: ['./report-pms-2.component.scss']
})
export class ReportPms2Component {
}
import { Component } from '@angular/core';
@Component({
selector: 'app-report-pms-3',
templateUrl: './report-pms-3.component.html',
styleUrls: ['./report-pms-3.component.scss']
})
export class ReportPms3Component {
}
...@@ -108,7 +108,7 @@ export class NavService implements OnDestroy { ...@@ -108,7 +108,7 @@ export class NavService implements OnDestroy {
// { id: 'm12', path: 'ess/supervisor-evaluation', title: 'ประเมินโดยหัวหน้า', type: 'link', show: true }, // { id: 'm12', path: 'ess/supervisor-evaluation', title: 'ประเมินโดยหัวหน้า', type: 'link', show: true },
// ], // ],
}, },
{ {
title: 'ประเมินโดยหัวหน้า', title: 'ประเมินโดยหัวหน้า',
type: 'link', type: 'link',
selected: false, selected: false,
...@@ -205,7 +205,6 @@ export class NavService implements OnDestroy { ...@@ -205,7 +205,6 @@ export class NavService implements OnDestroy {
{ id: 'm46', path: 'admin/idp-development-plan', title: 'แผนพัฒนา IDP', type: 'link', show: true }, { id: 'm46', path: 'admin/idp-development-plan', title: 'แผนพัฒนา IDP', type: 'link', show: true },
{ id: 'm47', path: 'admin/competency-management', title: 'การจัดการสมรรถนะ', type: 'link', show: true }, { id: 'm47', path: 'admin/competency-management', title: 'การจัดการสมรรถนะ', type: 'link', show: true },
{ id: 'm48', path: 'admin/evaluation-cycle-manager', title: 'การจัดการรอบการประเมิน', type: 'link', show: true }, { id: 'm48', path: 'admin/evaluation-cycle-manager', title: 'การจัดการรอบการประเมิน', type: 'link', show: true },
{ id: 'm49', path: 'admin/setting-competency', title: 'การตั้งค่า', type: 'link', show: true }
], ],
}, },
{ {
...@@ -227,10 +226,29 @@ export class NavService implements OnDestroy { ...@@ -227,10 +226,29 @@ export class NavService implements OnDestroy {
{ id: 'm57', path: 'admin/evaluation-cycle-performance', title: 'รอบการประเมิน', type: 'link', show: true } { id: 'm57', path: 'admin/evaluation-cycle-performance', title: 'รอบการประเมิน', type: 'link', show: true }
], ],
}, },
{
title: 'รายงาน',
type: 'sub',
selected: false,
active: false,
path: '',
id: 'm6',
show: true,
icon: 'assets/img/icons-menu/com-self.png',
children: [
{ id: 'm61', path: 'admin/report-com-1', title: 'รายงาย Competency 1', type: 'link', show: true },
{ id: 'm62', path: 'admin/report-com-2', title: 'รายงาย Competency 2', type: 'link', show: true },
{ id: 'm63', path: 'admin/report-com-3', title: 'รายงาย Competency 3', type: 'link', show: true },
{ id: 'm64', path: 'admin/report-pms-1', title: 'รายงาย PMS 1', type: 'link', show: true },
{ id: 'm65', path: 'admin/report-pms-2', title: 'รายงาย PMS 2', type: 'link', show: true },
{ id: 'm66', path: 'admin/report-pms-3', title: 'รายงาย PMS 3', type: 'link', show: true },
],
},
] ]
} }
// Array // Array
items = new BehaviorSubject<Menu[]>(this.MENUITEMS); items = new BehaviorSubject<Menu[]>(this.MENUITEMS);
itemsBack = new BehaviorSubject<Menu[]>(this.getAdminMenu());
private menuItemsSubject = new BehaviorSubject<Menu[]>(this.MENUITEMS); private menuItemsSubject = new BehaviorSubject<Menu[]>(this.MENUITEMS);
menuItems$ = this.menuItemsSubject.asObservable(); menuItems$ = this.menuItemsSubject.asObservable();
......
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