Browse Source

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

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

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

@ -223,11 +223,23 @@ export class AnalysisOfTheHostComponent implements OnInit {
config(data) { config(data) {
this.isVisible = true; this.isVisible = true;
this.configdata = data; this.configdata = data;
// this.router.navigate([`/system/host/camera`], {
// queryParams: {
// hostId: this.configdata.id,
// orId: this.selectedOilStation.id,
// type: '交大',
// },
// });
} }
handleOk(): void { handleOk(): void {
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; this.isVisible = false;
setTimeout(() => { setTimeout(() => {
this.router.navigate([`/system/host/camera`], { this.router.navigate([`/system/host/camera`], {
queryParams: { queryParams: {
@ -237,6 +249,11 @@ export class AnalysisOfTheHostComponent implements OnInit {
}, },
}); });
}, 0); }, 0);
},
error: (err) => {
this.message.create('error', '更新边缘设备失败');
},
});
} }
handleCancel(): void { handleCancel(): void {

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

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

Loading…
Cancel
Save