| | |
| | | import { getCameraInfo } from "@/api/camera"; |
| | | import { getCameraInfo,getGB28181CameraInfo } from "@/api/camera"; |
| | | import { getAllPolygon } from "@/api/polygon"; |
| | | import { getDirDetails, findAllFileByStackId } from "@/api/localVedio"; |
| | | import { getCameraSceneRule } from '@/api/scene' |
| | |
| | | public selectResolution: string; |
| | | public hasCtrlC: boolean; |
| | | |
| | | constructor(id: string) { |
| | | constructor(id: string,isGB:boolean) { |
| | | this.loading = false; |
| | | this.baseImg = ""; |
| | | this.cameraId = id ? id : ""; |
| | |
| | | this.rules = []; |
| | | |
| | | if (id && id !== "") { |
| | | this.update(); |
| | | this.update(isGB); |
| | | } |
| | | |
| | | this.resolutionOption = [ |
| | |
| | | this.hasCtrlC = false |
| | | } |
| | | |
| | | public async update() { |
| | | await this.getInfo(); |
| | | public async update(isGB) { |
| | | await this.getInfo(isGB); |
| | | await this.getSceneRule(); |
| | | await this.getPolygon(); |
| | | } |
| | | |
| | | public async getInfo() { |
| | | public async getInfo(isGB) { |
| | | // 判断选中的是摄像机还是数据栈 |
| | | if (this.cameraId.indexOf("stack") === -1) { |
| | | try { |
| | | const rsp: any = await getCameraInfo(this.cameraId); |
| | | |
| | | //处理国标摄像机 |
| | | if(isGB) { |
| | | try { |
| | | const rsp: any = await getGB28181CameraInfo(this.cameraId); |
| | | if (rsp.success) { |
| | | this.cameraName = rsp.data.name ? rsp.data.name : ""; |
| | | } |
| | | } catch { |
| | | this.cameraName = ""; |
| | | } |
| | | } |
| | | |
| | | else { |
| | | try { |
| | | const rsp: any = await getCameraInfo(this.cameraId); |
| | | if (rsp.success) { |
| | | this.cameraName = rsp.data.name ? rsp.data.name : ""; |
| | | } |
| | | } catch { |
| | | this.cameraName = ""; |
| | | } |
| | | } |
| | | |
| | | |
| | | } else { |
| | | const rsp: any = await findAllFileByStackId({ stackId: this.cameraId }); |
| | | if (rsp.success && rsp.data.dataList.length) { |