From 81ba0bc869ed0fd9974d5e47e194d5a3fc5d8224 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期四, 16 六月 2022 16:57:42 +0800 Subject: [PATCH] check car no --- 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