diff --git a/src/app/system-management/push/edit-push-item/edit-push-item.component.html b/src/app/system-management/push/edit-push-item/edit-push-item.component.html index cef01fe..d3c0f8f 100644 --- a/src/app/system-management/push/edit-push-item/edit-push-item.component.html +++ b/src/app/system-management/push/edit-push-item/edit-push-item.component.html @@ -1,20 +1,32 @@
- 推送范围 + 推送范围 - + + - - 处置范围 + + + 短信范围 + + + + diff --git a/src/app/system-management/push/edit-push-item/edit-push-item.component.ts b/src/app/system-management/push/edit-push-item/edit-push-item.component.ts index e94cce6..e0edf7f 100644 --- a/src/app/system-management/push/edit-push-item/edit-push-item.component.ts +++ b/src/app/system-management/push/edit-push-item/edit-push-item.component.ts @@ -11,26 +11,24 @@ export class EditPushItemComponent implements OnInit { @Input() data?: any; @Input() pushRoleIds?: any; - @Input() handleRoleIds?: any; + // @Input() handleRoleIds?: any; + @Input() noteRoleIds?: any; + validateForm!: FormGroup; constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } multiplePushValue: any multipleHandleValue: any - pushList - handleList + multipleNoteValue: any ngOnInit(): void { - this.pushList = this.pushRoleIds; - this.handleList = this.handleRoleIds; - console.log(this.pushRoleIds) - console.log(this.handleRoleIds) this.multiplePushValue = this.data.pushRoleIds - this.multipleHandleValue = this.data.handleRoleIds - + // this.multipleHandleValue = this.data.handleRoleIds + this.multipleNoteValue = this.data.smsPushRoleIds this.validateForm = this.fb.group({ - push: [null, [Validators.required]], - handle: [null, [Validators.required]] + push: [null], + // handle: [null] + note: [null], }); } } diff --git a/src/app/system-management/push/push.component.html b/src/app/system-management/push/push.component.html index 7125fd5..c5ad69b 100644 --- a/src/app/system-management/push/push.component.html +++ b/src/app/system-management/push/push.component.html @@ -24,17 +24,21 @@ 预警类别 预警/分析事件 预警推送范围 - 预警处置范围 + + 短信推送范围 操作 {{item.violationType}} {{item.eventSystemName}} - {{i}} + {{i}} - + + + {{i}} 编辑 diff --git a/src/app/system-management/push/push.component.ts b/src/app/system-management/push/push.component.ts index c257a62..5ed8aa1 100644 --- a/src/app/system-management/push/push.component.ts +++ b/src/app/system-management/push/push.component.ts @@ -21,7 +21,8 @@ export class PushComponent implements OnInit { }); await this.getPutRoles() - await this.getHandleRoles() + // await this.getHandleRoles() + await this.getNoteRoles() this.getViolation() this.getSetting() } @@ -45,13 +46,15 @@ export class PushComponent implements OnInit { } this.http.post('/api/services/app/Configuration/SetSetting', '', { params: params }).subscribe((data: any) => { // console.log('设置短信推送状态成功', data) - if(e){ + if (e) { this.message.create('success', '开启成功!'); - }else{ + } else { this.message.create('success', '关闭成功!'); } }) } + + //获取预警类型 list: any getViolation() { @@ -66,11 +69,19 @@ export class PushComponent implements OnInit { } }); }); - element.handleRoleNames = [] - element.handleRoleIds.forEach(item => { - this.handleRoleIds.forEach(i => { + // element.handleRoleNames = [] + // element.handleRoleIds.forEach(item => { + // this.handleRoleIds.forEach(i => { + // if (i.id == item) { + // element.handleRoleNames.push(i.displayName) + // } + // }); + // }); + element.noteRoleNames = [] + element.smsPushRoleIds.forEach(item => { + this.noteRoleIds.forEach(i => { if (i.id == item) { - element.handleRoleNames.push(i.displayName) + element.noteRoleNames.push(i.displayName) } }); }); @@ -79,6 +90,8 @@ export class PushComponent implements OnInit { console.log('预警类型', this.list) }) } + + //获取推送的角色列表 pushRoleIds async getPutRoles() { @@ -90,20 +103,34 @@ export class PushComponent implements OnInit { }) }) } - handleRoleIds + // handleRoleIds + // //获取处置的角色列表 + // async getHandleRoles() { + // await new Promise((resolve, reject) => { + // this.http.get('/api/services/app/Violation/GetHandleRoles').subscribe((data: any) => { + // this.handleRoleIds = data.result + // resolve(data) + // console.log('处置角色', data) + // }) + // }) + // } + noteRoleIds //获取处置的角色列表 - async getHandleRoles() { + async getNoteRoles() { await new Promise((resolve, reject) => { - this.http.get('/api/services/app/Violation/GetHandleRoles').subscribe((data: any) => { - this.handleRoleIds = data.result + this.http.get('/api/services/app/Violation/GetSmsPutRoles').subscribe((data: any) => { + this.noteRoleIds = data.result resolve(data) - console.log('处置角色', data) + console.log('短信角色', data) }) }) - } + + + edititem(item) { + console.log(item) const modal = this.modal.create({ nzTitle: '编辑推送设置', nzContent: EditPushItemComponent, @@ -112,7 +139,8 @@ export class PushComponent implements OnInit { nzComponentParams: { data: item, pushRoleIds: this.pushRoleIds, - handleRoleIds: this.handleRoleIds + noteRoleIds: this.noteRoleIds, + // handleRoleIds: this.handleRoleIds }, nzOnOk: async () => { if (instance.validateForm.valid) { @@ -121,7 +149,8 @@ export class PushComponent implements OnInit { let body = { id: item.id, pushRoleIds: instance.validateForm.value.push, - handleRoleIds: instance.validateForm.value.handle, + // handleRoleIds: instance.validateForm.value.handle, + smsPushRoleIds: instance.validateForm.value.note } this.http.put('/api/services/app/Violation/UpdateRoles', body).subscribe(data => { resolve(data) diff --git a/src/app/system-management/role/addrole/addrole.component.html b/src/app/system-management/role/addrole/addrole.component.html index 0dcca76..3351bb6 100644 --- a/src/app/system-management/role/addrole/addrole.component.html +++ b/src/app/system-management/role/addrole/addrole.component.html @@ -9,7 +9,7 @@ - 权限 + 权限 diff --git a/src/app/system-management/role/addrole/addrole.component.ts b/src/app/system-management/role/addrole/addrole.component.ts index e65d39c..2761af5 100644 --- a/src/app/system-management/role/addrole/addrole.component.ts +++ b/src/app/system-management/role/addrole/addrole.component.ts @@ -25,7 +25,7 @@ export class AddroleComponent implements OnInit { this.loadMore(); this.validateForm = this.fb.group({ name: [null, [Validators.required]], - power: [null, [Validators.required]], + power: [null], menus: [null] }); } diff --git a/src/app/system-management/role/editrole/editrole.component.html b/src/app/system-management/role/editrole/editrole.component.html index 0f3e2ac..45f7104 100644 --- a/src/app/system-management/role/editrole/editrole.component.html +++ b/src/app/system-management/role/editrole/editrole.component.html @@ -9,7 +9,7 @@ - 权限 + 权限 diff --git a/src/app/system-management/role/editrole/editrole.component.ts b/src/app/system-management/role/editrole/editrole.component.ts index 3f9b4ee..b77cfff 100644 --- a/src/app/system-management/role/editrole/editrole.component.ts +++ b/src/app/system-management/role/editrole/editrole.component.ts @@ -23,7 +23,7 @@ export class EditroleComponent implements OnInit { this.getMenus() this.validateForm = this.fb.group({ name: [null, [Validators.required]], - power: [null, [Validators.required]], + power: [null], menus: [null] }); if (this.optionList.length == 0) {