Browse Source

获取具体摄像头信息

develop
陈鹏飞 3 years ago
parent
commit
a5cf5c095f
  1. 3
      src/app/system-management/host-config/host-config.component.ts
  2. 34
      src/app/system-management/image-label2/image-label2.component.ts

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

@ -134,10 +134,9 @@ export class HostConfigComponent implements OnInit {
}
label(item) {
this.router.navigate(['/system/host/camera/imageLabel'],{queryParams: {id : item.id, type: item.type}})
this.router.navigate(['/system/host/camera/imageLabel'],{queryParams: {id : item.id}})
}
connect() {
let ids = []
this.listOfData.forEach((item: any) => {

34
src/app/system-management/image-label2/image-label2.component.ts

@ -12,7 +12,8 @@ export class ImageLabel2Component implements OnInit {
constructor(private route: ActivatedRoute, private http: HttpClient, private message: NzMessageService) { }
imgItem: any;
camerasData: any; //摄像头Data
imgItem: any; //图片 URL
canvasWidth: number = 0;
canvasHeight: number = 0;
copyCanvas: any; //拷贝 canvas底图
@ -42,20 +43,23 @@ export class ImageLabel2Component implements OnInit {
let that = this
return new Promise((resolve, reject) => {
that.route.queryParams.subscribe(parmas => {
parmas.type != undefined? that.markType = Number(parmas.type) : null;
const httpOptions = {
responseType: 'blob' as 'json',
params: {cameraId: parmas.id}
};
that.http.get(`/api/Cameras/Images`,httpOptions).subscribe({
next: (data) => {
resolve(data)
},
error: (err) => {
reject('error')
},
})
})
that.http.get(`/api/Cameras/${parmas.id}`).subscribe((info: any)=>{
that.camerasData = info
that.markType = info.type
const httpOptions = {
responseType: 'blob' as 'json',
params: {cameraId: parmas.id}
};
that.http.get(`/api/Cameras/Images`,httpOptions).subscribe({
next: (data) => {
resolve(data)
},
error: (err) => {
reject('error')
},
}) //get
}) //get
}) //route
})
}

Loading…
Cancel
Save