Browse Source

[新增]进入配置页新增接口

非煤矿业企业安全风险监测预警系统
邵佳豪 2 years ago
parent
commit
e8f530a0b9
  1. 39
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts
  2. 11
      src/app/system-management/host-config/host-config.component.ts

39
src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts

@ -223,20 +223,37 @@ export class AnalysisOfTheHostComponent implements OnInit {
config(data) {
this.isVisible = true;
this.configdata = data;
// this.router.navigate([`/system/host/camera`], {
// queryParams: {
// hostId: this.configdata.id,
// orId: this.selectedOilStation.id,
// type: '交大',
// },
// });
}
handleOk(): void {
this.isVisible = false;
setTimeout(() => {
this.router.navigate([`/system/host/camera`], {
queryParams: {
hostId: this.configdata.id,
orId: this.selectedOilStation.id,
type: this.radioValue,
},
});
}, 0);
let deviceProvider = this.radioValue === '交大' ? 0 : 1;
let body = {
deviceProvider: deviceProvider,
};
this.http.put(`/api/EdgeDevices/${this.configdata.id}`, body).subscribe({
next: (data) => {
this.isVisible = false;
setTimeout(() => {
this.router.navigate([`/system/host/camera`], {
queryParams: {
hostId: this.configdata.id,
orId: this.selectedOilStation.id,
type: this.radioValue,
},
});
}, 0);
},
error: (err) => {
this.message.create('error', '更新边缘设备失败');
},
});
}
handleCancel(): void {

11
src/app/system-management/host-config/host-config.component.ts

@ -103,15 +103,18 @@ export class HostConfigComponent implements OnInit {
};
this.isLoading = true;
this.http.get('/api/Cameras', { params: params }).subscribe((data: any) => {
console.log('摄像头列表', data.items);
data.items.forEach((element) => {
element.dimensionedPointsObj = JSON.parse(element.dimensionedPoints);
element.dimensionedPointsHuanghaiObj = JSON.parse(
element.dimensionedPointsHuanghai
);
if(element.dimensionedPointsHuanghai){
element.dimensionedPointsHuanghaiObj = JSON.parse(
element.dimensionedPointsHuanghai
);
}
});
this.listOfData = data.items;
this.isLoading = false;
console.log('摄像头列表', data.items);
});
}
addCamera() {

Loading…
Cancel
Save