From 994e5e08cba4e6b9ce321b7cf5cb1ec8d19dfa22 Mon Sep 17 00:00:00 2001 From: ZZJ <zzjdsg2300@163.com> Date: 星期二, 12 四月 2022 17:50:21 +0800 Subject: [PATCH] 摄像机管理 --- src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue | 37 ++++++++++++++++++++++++++----------- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue b/src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue index e666862..74bf857 100644 --- a/src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue +++ b/src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue @@ -35,15 +35,14 @@ </div> <div class="row"> <div class="label">鍒嗚鲸鐜�:</div> - <div - class="data" - v-if="camera.camearInfo.resolution_width != undefined" - > + <div class="data"> {{ - camera.camearInfo.resolution_width == 0 || - camera.camearInfo.resolution_height == 0 + !camera.camearInfo.resolutionWidth || + !camera.camearInfo.resolutionHeight || + camera.camearInfo.resolutionWidth == 0 || + camera.camearInfo.resolutionHeight == 0 ? "鏈満鍒嗚鲸鐜�" - : `${camera.camearInfo.resolution_width} * ${camera.camearInfo.resolution_height}` + : `${camera.camearInfo.resolutionWidth} * ${camera.camearInfo.resolutionHeight}` }} </div> </div> @@ -61,7 +60,7 @@ <script> import { changeRunType } from "@/api/pollConfig"; -import VideoRuleData from "@/Pool/VideoRuleData"; +import { getCameraInfo } from "@/api/camera"; export default { props: { @@ -184,12 +183,28 @@ }, getCameraInfo() { - this.cameras.forEach((id) => { - let newCamera = new VideoRuleData(id); - this.cameraArr.push(newCamera); + this.cameraArr = []; + this.cameras.forEach(async (id) => { + const rsp = await getCameraInfo(id); + if (rsp.success) { + this.cameraArr.push({ + cameraName: rsp.data.name ? rsp.data.name : "", + analytics: rsp.data.runType !== -1 ? true : false, + dealWay: rsp.data.runType !== 1 ? true : false, + camearInfo: { + resolutionWidth: rsp.data.resolutionWidth, + resolutionHeight: rsp.data.resolutionHeight, + }, + }); + } }); }, }, + watch: { + cameras() { + this.getCameraInfo(); + }, + }, }; </script> -- Gitblit v1.8.0