|
|
|
@ -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() |
|
|
|
|
} |
|
|
|
@ -52,6 +53,8 @@ export class PushComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取预警类型
|
|
|
|
|
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<void>((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<void>((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) |
|
|
|
|