|
|
|
@ -42,6 +42,7 @@ export class UserComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
this.getAllOrganization() |
|
|
|
|
this.getAllRoles() |
|
|
|
|
this.getAllRoles2() |
|
|
|
|
} |
|
|
|
|
nzSelectedKeys: any[] = [] |
|
|
|
|
defaultExpandedKeys = []; |
|
|
|
@ -61,7 +62,8 @@ export class UserComponent implements OnInit {
|
|
|
|
|
SkipCount: String(this.SkipCount), |
|
|
|
|
MaxResultCount: String(this.MaxResultCount), |
|
|
|
|
OrganizationUnitId: this.OrganizationUnitId, |
|
|
|
|
IsContainsChildren: String(this.IsContainsChildren) |
|
|
|
|
IsContainsChildren: String(this.IsContainsChildren), |
|
|
|
|
// Sorting: 'BuildingBasicInfo.Id asc'
|
|
|
|
|
} |
|
|
|
|
this.http.get(this.getAllUrl, { |
|
|
|
|
params: params |
|
|
|
@ -80,12 +82,12 @@ export class UserComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
listOfData: any = [] |
|
|
|
|
listOfData2: any = [] |
|
|
|
|
//获取角色列表
|
|
|
|
|
async getAllRoles() { |
|
|
|
|
let params = { |
|
|
|
|
SkipCount: '0', |
|
|
|
|
MaxResultCount: '999', |
|
|
|
|
ContainsBuiltins: 'true' |
|
|
|
|
MaxResultCount: '999' |
|
|
|
|
} |
|
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get('/api/services/app/Role/GetAll', { |
|
|
|
@ -96,6 +98,21 @@ export class UserComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
async getAllRoles2() { |
|
|
|
|
let params = { |
|
|
|
|
SkipCount: '0', |
|
|
|
|
MaxResultCount: '999', |
|
|
|
|
IsViolationRoles:'true' |
|
|
|
|
} |
|
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get('/api/services/app/Role/GetAll', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
resolve(data) |
|
|
|
|
this.listOfData2 = data.result.items |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//获取所有组织机构
|
|
|
|
|
nodes: any = [] |
|
|
|
|
async getAllOrganization() { |
|
|
|
@ -119,7 +136,7 @@ export class UserComponent implements OnInit {
|
|
|
|
|
let params = { |
|
|
|
|
OrganizationUnitId: OrganizationUnitId, |
|
|
|
|
IsContainsChildren: "true", |
|
|
|
|
IsUsersCountContainsChildren:String(this.IsContainsChildren) |
|
|
|
|
IsUsersCountContainsChildren: String(this.IsContainsChildren) |
|
|
|
|
} |
|
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get(this.CountsByOrganizations, { |
|
|
|
@ -134,7 +151,7 @@ export class UserComponent implements OnInit {
|
|
|
|
|
products: data ? data : false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let index = 0; index < arrs.length; index++) { |
|
|
|
|
if (arrs[index].id == OrganizationUnitId) { |
|
|
|
|
arrs[index].parentId = null |
|
|
|
@ -173,7 +190,7 @@ export class UserComponent implements OnInit {
|
|
|
|
|
nzTitle: '新增用户', |
|
|
|
|
nzContent: AdduserComponent, |
|
|
|
|
nzViewContainerRef: this.viewContainerRef, |
|
|
|
|
nzWidth: 450, |
|
|
|
|
nzWidth: 460, |
|
|
|
|
nzMaskClosable: false, |
|
|
|
|
nzComponentParams: { |
|
|
|
|
title: '', |
|
|
|
@ -182,11 +199,12 @@ export class UserComponent implements OnInit {
|
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
if (instance.validateForm.valid) { |
|
|
|
|
await new Promise(resolve => { |
|
|
|
|
let roleNames = [...instance.validateForm.value.role, ...instance.validateForm.value.role2] |
|
|
|
|
let body = { |
|
|
|
|
userName: instance.validateForm.value.account, |
|
|
|
|
name: instance.validateForm.value.name, |
|
|
|
|
organizationUnitId: Number(instance.validateForm.value.organization), |
|
|
|
|
roleNames: instance.validateForm.value.role, |
|
|
|
|
roleNames: roleNames, |
|
|
|
|
phoneNumber: instance.validateForm.value.phonenum, |
|
|
|
|
isActive: true |
|
|
|
|
} |
|
|
|
@ -220,22 +238,24 @@ export class UserComponent implements OnInit {
|
|
|
|
|
nzTitle: '编辑用户', |
|
|
|
|
nzContent: EdituserComponent, |
|
|
|
|
nzViewContainerRef: this.viewContainerRef, |
|
|
|
|
nzWidth: 450, |
|
|
|
|
nzWidth: 460, |
|
|
|
|
nzMaskClosable: false, |
|
|
|
|
nzComponentParams: { |
|
|
|
|
data: data, |
|
|
|
|
listOfData: this.listOfData, |
|
|
|
|
listOfData2: this.listOfData2, |
|
|
|
|
nodes: this.nodes |
|
|
|
|
}, |
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
if (instance.validateForm.valid) { |
|
|
|
|
await new Promise(resolve => { |
|
|
|
|
let roleNames = [...instance.validateForm.value.role, ...instance.validateForm.value.role2] |
|
|
|
|
let body = { |
|
|
|
|
id: data.id, |
|
|
|
|
userName: instance.validateForm.value.account, |
|
|
|
|
name: instance.validateForm.value.name, |
|
|
|
|
organizationUnitId: instance.validateForm.value.organization, |
|
|
|
|
roleNames: instance.validateForm.value.role, |
|
|
|
|
roleNames: roleNames, |
|
|
|
|
phoneNumber: instance.validateForm.value.phonenum, |
|
|
|
|
isActive: true |
|
|
|
|
} |
|
|
|
|