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

Loading…
Cancel
Save