Browse Source

[修改]修改编辑用户bug

beijing
邵佳豪 3 years ago
parent
commit
3405162e3d
  1. 4
      src/app/http-interceptors/base-interceptor.ts
  2. 2
      src/app/pages/login/login.component.ts
  3. 4
      src/app/system-management/user/adduser/adduser.component.html
  4. 8
      src/app/system-management/user/edituser/edituser.component.html
  5. 17
      src/app/system-management/user/edituser/edituser.component.ts
  6. 2
      src/app/system-management/user/user.component.ts

4
src/app/http-interceptors/base-interceptor.ts

@ -84,13 +84,13 @@ export class BaseInterceptor implements HttpInterceptor {
}
if (error.status === 500) {
if(error.error.error.message){
this.message.create('error', `${error.error.error.message}`);
this.message.create('error', `${error.error.error.details || error.error.error.message}`);
}else{
this.message.create('error', `状态500`);
}
}
if (error.status === 404) {
this.message.create('error', `实体未找到!${error.error.error.message}`);
this.message.create('error', `${error.error.error.message}`);
}
if (error.error instanceof ErrorEvent) {
// 发生客户端或网络错误。相应处理。

2
src/app/pages/login/login.component.ts

@ -179,7 +179,7 @@ export class LoginComponent implements OnInit {
},
(err) => {
this.isLoading = false;
this.message.create('error', err.error.error.details);
// this.message.create('error', err.error.error.details);
}
)
}

4
src/app/system-management/user/adduser/adduser.component.html

@ -35,7 +35,7 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="角色">角色</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="角色">角色</nz-form-label>
<nz-form-control>
<nz-select formControlName="role" nzPlaceHolder="请选择角色" nzMode="multiple">
<nz-option *ngFor="let item of listOfData" [nzValue]="item.normalizedName" [nzLabel]="item.displayName">
@ -44,7 +44,7 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="预警接收级别">预警接收级别</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="预警接收级别">预警接收级别</nz-form-label>
<nz-form-control>
<nz-select formControlName="role2" nzPlaceHolder="请选择预警接收级别" nzMode="multiple">
<nz-option *ngFor="let item of listOfData2" [nzValue]="item.normalizedName" [nzLabel]="item.displayName">

8
src/app/system-management/user/edituser/edituser.component.html

@ -35,18 +35,18 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="角色">角色</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="角色">角色</nz-form-label>
<nz-form-control>
<nz-select [(ngModel)]="data.roleNames" formControlName="role" nzPlaceHolder="请选择角色" nzMode="multiple">
<nz-select formControlName="role" nzPlaceHolder="请选择角色" nzMode="multiple">
<nz-option *ngFor="let item of listOfData" [nzValue]="item.normalizedName" [nzLabel]="item.displayName">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="预警接收级别">预警接收级别</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="预警接收级别">预警接收级别</nz-form-label>
<nz-form-control>
<nz-select [(ngModel)]="data.roleNames" formControlName="role2" nzPlaceHolder="请选择预警接收级别" nzMode="multiple">
<nz-select formControlName="role2" nzPlaceHolder="请选择预警接收级别" nzMode="multiple">
<nz-option *ngFor="let item of listOfData2" [nzValue]="item.normalizedName" [nzLabel]="item.displayName">
</nz-option>
</nz-select>

17
src/app/system-management/user/edituser/edituser.component.ts

@ -19,12 +19,22 @@ export class EdituserComponent implements OnInit {
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
ngOnInit(): void {
console.log(this.data)
let roleData1 = []
let roleData2 = []
this.data.roleNames.forEach(element => {
if (element.indexOf('LEVEL') != -1) {
roleData2.push(element)
}else{
roleData1.push(element)
}
});
this.validateForm = this.fb.group({
account: [null, [Validators.required]],
name: [null, [Validators.required]],
organization: [null, [Validators.required]],
role: [null],
role2: [null],
role: [roleData1],
role2: [roleData2],
phonenum: [null, [Validators.required]]
});
if (this.listOfData.length == 0) {
@ -57,12 +67,13 @@ export class EdituserComponent implements OnInit {
})
})
}
//获取角色列表
async getAllRoles2() {
let params = {
SkipCount: '0',
MaxResultCount: '999',
IsViolationRoles:'true'
IsViolationRoles: 'true'
}
await new Promise<void>((resolve, reject) => {
this.http.get('/api/services/app/Role/GetAll', {

2
src/app/system-management/user/user.component.ts

@ -102,7 +102,7 @@ export class UserComponent implements OnInit {
let params = {
SkipCount: '0',
MaxResultCount: '999',
IsViolationRoles:'true'
IsViolationRoles: 'true'
}
await new Promise<void>((resolve, reject) => {
this.http.get('/api/services/app/Role/GetAll', {

Loading…
Cancel
Save