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/CameraInfo/index.vue |   80 +++++++++++++++++----------------------
 1 files changed, 35 insertions(+), 45 deletions(-)

diff --git a/src/views/hashrate/CameraManage/CameraInfo/index.vue b/src/views/hashrate/CameraManage/CameraInfo/index.vue
index b4d7ca1..62665ae 100644
--- a/src/views/hashrate/CameraManage/CameraInfo/index.vue
+++ b/src/views/hashrate/CameraManage/CameraInfo/index.vue
@@ -77,33 +77,6 @@
           <el-form-item label="浜嬩欢澹伴煶">
             <div class="flex-wrap">
               <el-switch v-model="form.voiceEnable" :width="56"></el-switch>
-              <!-- 灞忚斀澹伴煶閫夋嫨,璋冩暣鍒板満鏅� -->
-              <!-- <el-select
-                v-model="voice"
-                placeholder="閫夋嫨澹伴煶"
-                size="small"
-                value-key="id"
-                @change="selSound"
-              >
-                <el-option
-                  v-for="item in soundList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item"
-                ></el-option>
-              </el-select>
-              <span class="player-btn" @click="togglePlayer" style="cursor:pointer;">
-                <i
-                  v-if="togglePlay"
-                  class="el-icon-video-play"
-                  style="font-size:26px; vertical-align:middle; color:#409eff"
-                ></i>
-                <i
-                  v-else
-                  class="el-icon-video-pause"
-                  style="font-size:26px; vertical-align:middle; color:#409eff"
-                ></i>
-              </span>-->
             </div>
           </el-form-item>
         </div>
@@ -118,7 +91,7 @@
           </el-form-item>
         </div>
 
-        <div class="row">
+        <!--   <div class="row">
           <el-form-item label="鎵�灞為泦缇�">
             <el-select
               v-model="form.cluster"
@@ -134,7 +107,7 @@
               ></el-option>
             </el-select>
           </el-form-item>
-        </div>
+        </div> -->
 
         <!-- 娣诲姞浼犳劅鍣� -->
         <CameraInfoEditor
@@ -277,6 +250,9 @@
       type: Array,
     },
   },
+  created() {
+    document.querySelector("html").style["min-width"] = "1280px";
+  },
   data() {
     return {
       videoItem: null,
@@ -350,7 +326,7 @@
       getSoundList()
         .then((res) => {
           if (res.success) {
-            this.soundList = res.data;
+            this.soundList = res.data.voices;
           }
         })
         .catch((e) => console.log(e));
@@ -396,16 +372,9 @@
       this.$refs.addForm.resetFields();
       this.voice = null;
 
-      // this.initFormData();
-      // this.$refs.addForm.clearValidate();
       if (node.type === "4") {
-        console.log(getCameraInfo);
-
         getCameraInfo(node.id).then((res) => {
           if (res.success) {
-            // console.log(res, '鑾峰彇鎽勫儚鏈轰俊鎭�')
-            console.log(5555555);
-
             if (res.data.resolutions) {
               let list = res.data.resolutions.map((i) => {
                 let obj = {};
@@ -438,7 +407,7 @@
                 this.form.isAI = false;
               }
               this.form.resolution =
-                this.form.resolution_width + "*" + this.form.resolution_height;
+                this.form.resolutionWidth + "*" + this.form.resolutionHeight;
             });
           }
         });
@@ -459,10 +428,10 @@
             ? 0
             : parseFloat(this.form.longitude);
           this.form.sensors = list;
-          this.form.resolution_width = Number(
+          this.form.resolutionWidth = Number(
             this.form.resolution.split("*")[0]
           );
-          this.form.resolution_height = Number(
+          this.form.resolutionHeight = Number(
             this.form.resolution.split("*")[1]
           );
           let _this = this;
@@ -473,7 +442,16 @@
               this.isGb28182
             );
             console.log(this.TreeDataPool.selectedNode);
-            updateCameraInfo(this.form)
+
+            let tem = {
+              camera: this.form,
+              sensors: this.form.sensors,
+              areaid: this.form.areaid,
+            };
+            tem.camera.clusterId = this.TreeDataPool.clusterId;
+            tem.camera.devId = this.TreeDataPool.devId;
+
+            updateCameraInfo(tem)
               .then((rsp) => {
                 if (rsp.success) {
                   this.$notify({
@@ -506,7 +484,15 @@
               });
           } else {
             this.form.areaid = this.addParentId;
-            createCamera(this.form)
+
+            let tem = {
+              camera: this.form,
+              sensors: this.form.sensors,
+              areaid: this.form.areaid,
+            };
+            tem.camera.clusterId = this.TreeDataPool.clusterId;
+            tem.camera.devId = this.TreeDataPool.devId;
+            createCamera(tem)
               .then((rsp) => {
                 if (rsp.success) {
                   this.$notify({
@@ -543,11 +529,11 @@
           name: this.form.name,
           rtsp: this.form.rtsp,
           id: this.form.id,
-          isRunning: this.form.run_enable,
+          isRunning: this.form.runEnable,
           cameraType: this.form.type,
         };
 
-        console.log(this.videoItem.rtsp);
+        console.log(this.videoItem);
       });
     },
     // * 楠岃瘉蹇呴�夐」
@@ -574,7 +560,11 @@
         cancelButtonClass: "comfirm-class-cancle",
         confirmButtonClass: "comfirm-class-sure",
       }).then(() => {
-        delCamera(this.form.id).then((res) => {
+        delCamera({
+          id: this.form.id,
+          clusterId: this.TreeDataPool.clusterId,
+          devId: this.TreeDataPool.devId,
+        }).then((res) => {
           if (res.success) {
             this.initFormData();
             this.$notify({

--
Gitblit v1.8.0