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/pages/cameraAccess/components/CameraInfo.vue |  129 ++++++++++++++++++++++++++++++-------------
 1 files changed, 90 insertions(+), 39 deletions(-)

diff --git a/src/pages/cameraAccess/components/CameraInfo.vue b/src/pages/cameraAccess/components/CameraInfo.vue
index 0b5fc59..00b0eda 100644
--- a/src/pages/cameraAccess/components/CameraInfo.vue
+++ b/src/pages/cameraAccess/components/CameraInfo.vue
@@ -230,6 +230,7 @@
   createCamera,
   updateCameraInfo,
   getCameraInfo,
+  getGB28181CameraInfo,
   delCamera,
 } from "@/api/camera";
 import { getSoundList } from "@/api/event";
@@ -367,49 +368,99 @@
       this.$refs.addForm.resetFields();
       this.voice = null;
 
+      console.log(node);
+
       // this.initFormData();
       // this.$refs.addForm.clearValidate();
       if (node.type === "4") {
-        getCameraInfo(node.id).then((res) => {
-          if (res.success) {
-            // console.log(res, '鑾峰彇鎽勫儚鏈轰俊鎭�')
-            if (res.data.resolutions) {
-              let list = res.data.resolutions.map((i) => {
-                let obj = {};
-                if (i.width == 0 && i.height == 0) {
-                  obj.label = "鏈満鍒嗚鲸鐜�";
-                  obj.value = "0*0";
-                } else {
-                  obj.label = i.width + "*" + i.height;
-                  obj.value = i.width + "*" + i.height;
-                }
-                return obj;
-              });
-              this.resolutionList = list;
-              this.sensors = res.data.sensors;
-              console.log(list);
-            }
-
-            this.$nextTick(() => {
-              this.initFormData();
-              Object.assign(this.form, res.data);
-
-              this.soundList.forEach((element) => {
-                if (this.form.voiceId == element.id) {
-                  this.voice = element;
-                }
-              });
-
-              if (this.form.run_type !== -1) {
-                this.form.isAI = true;
-              } else {
-                this.form.isAI = false;
+        // 鍥芥爣鎽勫儚鏈�
+        if (node.cameraType === 1) {
+          getGB28181CameraInfo(node.id).then((res) => {
+            if (res.success) {
+              // console.log(res, '鑾峰彇鎽勫儚鏈轰俊鎭�')
+              if (res.data.resolutions) {
+                let list = res.data.resolutions.map((i) => {
+                  let obj = {};
+                  if (i.width == 0 && i.height == 0) {
+                    obj.label = "鏈満鍒嗚鲸鐜�";
+                    obj.value = "0*0";
+                  } else {
+                    obj.label = i.width + "*" + i.height;
+                    obj.value = i.width + "*" + i.height;
+                  }
+                  return obj;
+                });
+                this.resolutionList = list;
+                this.sensors = res.data.sensors;
+                console.log(list);
               }
-              this.form.resolution =
-                this.form.resolution_width + "*" + this.form.resolution_height;
-            });
-          }
-        });
+
+              this.$nextTick(() => {
+                this.initFormData();
+                Object.assign(this.form, res.data);
+
+                this.soundList.forEach((element) => {
+                  if (this.form.voiceId == element.id) {
+                    this.voice = element;
+                  }
+                });
+
+                if (this.form.run_type !== -1) {
+                  this.form.isAI = true;
+                } else {
+                  this.form.isAI = false;
+                }
+                this.form.resolution =
+                  this.form.resolution_width +
+                  "*" +
+                  this.form.resolution_height;
+              });
+            }
+          });
+        } else {
+          getCameraInfo(node.id).then((res) => {
+            if (res.success) {
+              // console.log(res, '鑾峰彇鎽勫儚鏈轰俊鎭�')
+              if (res.data.resolutions) {
+                let list = res.data.resolutions.map((i) => {
+                  let obj = {};
+                  if (i.width == 0 && i.height == 0) {
+                    obj.label = "鏈満鍒嗚鲸鐜�";
+                    obj.value = "0*0";
+                  } else {
+                    obj.label = i.width + "*" + i.height;
+                    obj.value = i.width + "*" + i.height;
+                  }
+                  return obj;
+                });
+                this.resolutionList = list;
+                this.sensors = res.data.sensors;
+                console.log(list);
+              }
+
+              this.$nextTick(() => {
+                this.initFormData();
+                Object.assign(this.form, res.data);
+
+                this.soundList.forEach((element) => {
+                  if (this.form.voiceId == element.id) {
+                    this.voice = element;
+                  }
+                });
+
+                if (this.form.run_type !== -1) {
+                  this.form.isAI = true;
+                } else {
+                  this.form.isAI = false;
+                }
+                this.form.resolution =
+                  this.form.resolution_width +
+                  "*" +
+                  this.form.resolution_height;
+              });
+            }
+          });
+        }
       }
     },
     // 淇濆瓨

--
Gitblit v1.8.0