Browse Source

[完善]优化更新失败列表

非煤矿业企业安全风险监测预警系统
邵佳豪 2 years ago
parent
commit
33f2d24fea
  1. 21
      src/app/system-management/condition-monitoring/condition-monitoring.component.ts

21
src/app/system-management/condition-monitoring/condition-monitoring.component.ts

@ -170,12 +170,16 @@ export class ConditionMonitoringComponent implements OnInit {
this.http.patch('/api/EdgeDevices/Commands', body, { params: { command: type } }).subscribe({
next: (data: any) => {
this.message.create('success', '通知边缘盒子成功,请过一段时间手动刷新尝试!');
console.log(data)
let str = '更新失败列表<br>'
if (data.failedItems.length != 0) {
data.failedItems.forEach(element => {
this.message.create('info', element.detail);
str += element.detail + '<br>'
});
this.message.create('info', str, {
nzDuration: 2000
});
}
this.setOfCheckedId.clear();
this.refreshCheckedStatus();
this.loading = null;
@ -204,11 +208,16 @@ export class ConditionMonitoringComponent implements OnInit {
next: (data: any) => {
resolve(data)
this.message.create('success', '通知边缘盒子成功,请过一段时间手动刷新尝试!');
let str = '更新失败列表<br>'
if (data.failedItems.length != 0) {
data.failedItems.forEach(element => {
this.message.create('info', element.detail);
str += element.detail + '<br>'
});
this.message.create('info', str, {
nzDuration: 2000
});
}
this.setOfCheckedId.clear();
this.refreshCheckedStatus();
this.loading = null;
@ -274,9 +283,13 @@ export class ConditionMonitoringComponent implements OnInit {
this.http.patch('/api/EdgeDevices/Commands/PushMonitorSettingsJson', body).subscribe({
next: (data: any) => {
this.message.create('success', '通知边缘盒子成功,请过一段时间手动刷新尝试!');
let str = '更新失败列表<br>'
if (data.failedItems.length != 0) {
data.failedItems.forEach(element => {
this.message.create('info', element.detail);
str += element.detail + '<br>'
});
this.message.create('info', str, {
nzDuration: 2000
});
}
this.setOfCheckedId.clear();

Loading…
Cancel
Save