From 58bf48cea61c6c5b4381a4b8ff5b4a39eb4671eb Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期五, 10 六月 2022 09:36:03 +0800 Subject: [PATCH] 国标摄像机信息接口 --- src/Pool/VideoRuleData.ts | 33 +++++++++++++++++++++++++-------- 1 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/Pool/VideoRuleData.ts b/src/Pool/VideoRuleData.ts index 5824a73..22dface 100644 --- a/src/Pool/VideoRuleData.ts +++ b/src/Pool/VideoRuleData.ts @@ -1,4 +1,4 @@ -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' @@ -23,7 +23,7 @@ public selectResolution: string; public hasCtrlC: boolean; - constructor(id: string) { + constructor(id: string,isGB:boolean) { this.loading = false; this.baseImg = ""; this.cameraId = id ? id : ""; @@ -44,7 +44,7 @@ this.rules = []; if (id && id !== "") { - this.update(); + this.update(isGB); } this.resolutionOption = [ @@ -65,23 +65,40 @@ 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) { -- Gitblit v1.8.0