|
@@ -1,5 +1,6 @@
|
|
|
import { Component, EventEmitter, Input, Output, SimpleChanges } from '@angular/core';
|
|
|
import { CommonNzModule } from '../../../../common.nz.module';
|
|
|
+import { BasicDataService } from '../../../../services/basic.service';
|
|
|
import { USER_ROLE_OPTIONS, UserRole } from '../user.const';
|
|
|
|
|
|
@Component({
|
|
@@ -28,6 +29,7 @@ export class UserTableComponent {
|
|
|
@Input() roleOptions: Option<string>[] = [];
|
|
|
@Input() statusOptions: Option<number>[] = [];
|
|
|
|
|
|
+ constructor(private basic: BasicDataService) {}
|
|
|
ngOnChanges(changes: SimpleChanges) {
|
|
|
if (changes['list']) {
|
|
|
this.refreshCheckedStatus();
|
|
@@ -44,6 +46,13 @@ export class UserTableComponent {
|
|
|
this.checkedIds.delete(id);
|
|
|
}
|
|
|
}
|
|
|
+ getJobName(jobId: number) {
|
|
|
+ return this.basic.jobs.find(j => j.id === jobId)?.name;
|
|
|
+ }
|
|
|
+ getDepartmentName(departmentId: number) {
|
|
|
+ return this.basic.departments.find(d => d.id === departmentId)?.name;
|
|
|
+ }
|
|
|
+
|
|
|
onItemChecked(id: string, checked: boolean): void {
|
|
|
this.updateCheckedSet(id, checked);
|
|
|
this.refreshCheckedStatus();
|