Browse Source

[完善]预警接收级别字段

beijing
邵佳豪 2 years ago
parent
commit
f33a00f808
  1. 2
      src/app/pages/plan-admin/oil-station-list/oil-station-list.component.ts
  2. 10
      src/app/system-management/user/adduser/adduser.component.html
  3. 23
      src/app/system-management/user/adduser/adduser.component.ts
  4. 9
      src/app/system-management/user/edituser/edituser.component.html
  5. 28
      src/app/system-management/user/edituser/edituser.component.ts
  6. 2
      src/app/system-management/user/user.component.html
  7. 38
      src/app/system-management/user/user.component.ts

2
src/app/pages/plan-admin/oil-station-list/oil-station-list.component.ts

@ -130,7 +130,7 @@ export class OilStationListComponent implements OnInit {
IsContainsChildren: 'true',
SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount,
Sorting: ' BuildingBasicInfo.Id asc'
Sorting: 'BuildingBasicInfo.Id asc'
}
this.tableSpin = true
await new Promise((resolve, reject) => {

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

@ -43,6 +43,15 @@
</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-control>
<nz-select formControlName="role2" nzPlaceHolder="请选择预警接收级别" nzMode="multiple">
<nz-option *ngFor="let item of listOfData2" [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-control>
@ -51,5 +60,6 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
</form>
</div>

23
src/app/system-management/user/adduser/adduser.component.ts

@ -20,11 +20,13 @@ export class AdduserComponent implements OnInit {
account: [null, [Validators.required]],
name: [null, [Validators.required]],
organization: [null, [Validators.required]],
role: [null, [Validators.required]],
role: [null],
role2: [null],
phonenum: [null, [Validators.required]]
});
this.getAllRoles()
this.getAllRoles2()
this.getAllOrganization()
}
destroyModal(): void {
@ -32,13 +34,12 @@ export class AdduserComponent implements OnInit {
}
listOfData: any[] = [];
listOfData2: any[] = [];
//获取角色列表
getAllRoles() {
let params = {
SkipCount: '0',
MaxResultCount: '999',
ContainsBuiltins: 'true'
MaxResultCount: '999'
}
this.http.get('/api/services/app/Role/GetAll', {
params: params
@ -47,6 +48,20 @@ export class AdduserComponent implements OnInit {
this.listOfData = data.result.items
})
}
//获取角色列表
getAllRoles2() {
let params = {
SkipCount: '0',
MaxResultCount: '999',
IsViolationRoles:'true'
}
this.http.get('/api/services/app/Role/GetAll', {
params: params
}).subscribe((data: any) => {
// console.log('角色列表', data.result.items)
this.listOfData2 = data.result.items
})
}
//获取所有组织机构
nodes: any = []
getAllOrganization() {

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

@ -43,6 +43,15 @@
</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-control>
<nz-select [(ngModel)]="data.roleNames" formControlName="role2" nzPlaceHolder="请选择预警接收级别" nzMode="multiple">
<nz-option *ngFor="let item of listOfData2" [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-control>

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

@ -13,6 +13,7 @@ export class EdituserComponent implements OnInit {
@Input() data?: any;
@Input() listOfData?: any;
@Input() listOfData2?: any;
@Input() nodes?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
@ -22,12 +23,16 @@ export class EdituserComponent implements OnInit {
account: [null, [Validators.required]],
name: [null, [Validators.required]],
organization: [null, [Validators.required]],
role: [null, [Validators.required]],
role: [null],
role2: [null],
phonenum: [null, [Validators.required]]
});
if (this.listOfData.length == 0) {
this.getAllRoles()
}
if (this.listOfData2.length == 0) {
this.getAllRoles2()
}
if (this.nodes.length == 0) {
this.getAllOrganization()
}
@ -41,8 +46,7 @@ export class EdituserComponent implements OnInit {
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', {
@ -53,6 +57,22 @@ export class EdituserComponent 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
})
})
}
//获取所有组织机构
async getAllOrganization() {
@ -77,5 +97,5 @@ export class EdituserComponent implements OnInit {
})
})
}
}

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

@ -67,7 +67,7 @@
<th></th>
<th>账号</th>
<th>姓名</th>
<th [width]="'30%'">角色</th>
<th [width]="'30%'">角色/预警接收级别</th>
<th>所属机构</th>
<th *ngIf="level == 2">审核状态</th>
<th>用户状态</th>

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

@ -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
}

Loading…
Cancel
Save