Quellcode durchsuchen

feat: jd related

Signed-off-by: carlos <568187512@qq.com>
carlos vor 2 Monaten
Ursprung
Commit
007c51a7b1

+ 0 - 2
src/app/pages/manager/risk/risk-list/risk-list.component.ts

@@ -152,8 +152,6 @@ export class RiskListComponent {
       this.loading = false;
     });
     this.list = res;
-    console.log(this.allTypes);
-
     this.resetSelected();
   }
 

+ 2 - 3
src/app/pages/manager/user/user-form/user-form.component.ts

@@ -44,7 +44,7 @@ export class UserFormComponent {
     empno: this.fb.control<string>('', {
       validators: [Validators.required, this.empnoValidator],
     }),
-    job: this.fb.control<string>('', {
+    job: this.fb.control<number | undefined>(undefined, {
       validators: [],
     }),
     jobGroup: this.fb.control<string>('', {
@@ -128,7 +128,7 @@ export class UserFormComponent {
         id: string;
         department: number;
         line: string;
-        job: string;
+        job: number;
         jobGroup: string;
         gender: string;
         empno: string;
@@ -153,7 +153,6 @@ export class UserFormComponent {
   }
   onDepartmentChange() {
     this.validateForm.get('job')?.reset();
-    debugger;
   }
   resetForm() {
     this.validateForm.reset();

+ 3 - 3
src/app/pages/manager/user/user-table/user-table.component.html

@@ -21,7 +21,7 @@
       <th>姓名</th>
       <th>公司</th>
       <th>角色</th>
-      <th>线路</th>
+      <th>部门</th>
       <th>岗位</th>
       <th class="text-nowrap">用户状态</th>
       <!-- <th>登录时间</th>
@@ -45,8 +45,8 @@
             <nz-tag class="rounded" [nzColor]="'blue'">{{ role }}</nz-tag>
           }
         </td>
-        <td>{{ data.line }}</td>
-        <td>{{ data.job }}</td>
+        <td>{{ getDepartmentName(data.department) }}</td>
+        <td>{{ getJobName(data.job) }}</td>
 
         <td>
           <nz-tag class="rounded" [nzColor]="data.status === 0 ? 'green' : 'red'">{{

+ 9 - 0
src/app/pages/manager/user/user-table/user-table.component.ts

@@ -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();

+ 1 - 1
src/app/services/apis/basic.ts

@@ -97,7 +97,7 @@ export class BasicApi extends _BaseApi {
     requestDone(data);
   }
   async removeDepartment(id: number): Promise<void> {
-    return this.http.delete('/hr/department/remove', { id });
+    return this.http.get('/hr/department/remove', { id });
   }
 
   @Get('/basic/job/all')

+ 1 - 1
src/types/auth.d.ts

@@ -27,7 +27,7 @@ declare namespace Auth {
     id: string;
     department: number;
     company: string;
-    job: string;
+    job: number;
     line: string;
     jobGroup: string;
     createDate: string;