liwei19941102 1 rok temu
rodzic
commit
cdd32d0752

+ 5 - 1
src/components/Public/videoDiv.vue

@@ -15,6 +15,10 @@
             type: [String],
             default: "video-container"
         },
+        height:{
+            type: [Number],
+            default: "200"
+        }
     });
 
     const initVideo = (code) => {
@@ -23,7 +27,7 @@
         getCameraPlayerConfig(code).then(res => {
             console.log(res.data);
             var player = new EZUIKit.EZUIKitPlayer({
-                height: 200,
+                height: props.height,
                 template: "pcLive",
                 id: props.videoId, // 视频容器ID
                 ...res.data

+ 1 - 1
src/views/statics/passengerFlow.vue

@@ -490,7 +490,7 @@
             }
         }
         if (deptId.value != null) {
-            obj.params["ext1$dept"] = deptId.value
+            obj.params["ext1$deptId"] = deptId.value
         }
         liststaticFlow(obj).then(res => {
             total.value = res.total

+ 27 - 6
src/views/yunying/kdg/index.vue

@@ -359,6 +359,14 @@
       </div>
     </div>
 
+    <div style="position: absolute;top:10vh;left:30vw;z-index: 2000;" v-if="showVideo">
+      <el-icon color="black" @click="showVideo = false">
+        <Close />
+      </el-icon>
+      <videoDiv ref="videoPlayer" height="400" style="width: 30vw;">
+      </videoDiv>
+    </div>
+
     <el-dialog v-model="dialogVisible" title="添加设备" width="500">
       <el-form :model="formdata" ref="ruleForm" label-width="100px" class="demo-ruleForm">
         <el-form-item label="名称">
@@ -392,7 +400,7 @@
 </template>
 
 <script setup name="CarInfo" lang="ts">
-    import { listCountry, getCountry, delCountry, addCountry, updateCountry } from '@/api/country';
+  import { listCountry, getCountry, delCountry, addCountry, updateCountry } from '@/api/country';
   import { TreeNode } from "element-plus";
   import { useRoute, useRouter } from "vue-router";
   import EZUIKit from 'ezuikit-js';
@@ -402,6 +410,7 @@
   import { updateData, listData } from "@/api/system/dict/data";
   import imgulock from "@/assets/images/unlock@2x.png";
   import { getBoxInfo, getLock, openall } from "@/api/data"
+  import videoDiv from "@/components/Public/videoDiv.vue"
 
   const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
@@ -415,6 +424,10 @@
   const boxCode = ref(null)
   const showKdg = ref(false)
 
+  const videoData = ref(null)
+
+  const showVideo = ref(false)
+
 
   const formdata = ref({
     name: "",
@@ -482,12 +495,18 @@
   }
 
   const clickCabinet = (value, lockCode) => {
-    for (var index in boxData.value) {
-      if (boxData.value[index].box_name == value) {
-        //  console.log(boxData.value[index].box_lock_address)
-        openBox(value, boxData.value[index].box_lock_address);
-      }
+    if (videoData.value.length > 0) {
+      showVideo.value = true;
+      setTimeout(() => {
+        proxy.$refs.videoPlayer.initVideo(videoData.value[0].code)
+      }, 100);
     }
+    // for (var index in boxData.value) {
+    //   if (boxData.value[index].box_name == value) {
+    //     //  console.log(boxData.value[index].box_lock_address)
+    //     openBox(value, boxData.value[index].box_lock_address);
+    //   }
+    // }
     // ElMessage.success(value + "号柜远程开启成功");
   }
 
@@ -632,6 +651,8 @@
     tableData.value = JSON.parse((currentdata.value.remark == '' ? "[]" : currentdata.value.remark) ?? "[]")
     if (currentdata.value) {
       var cabinets = tableData.value.filter(i => i.type == 'cabinet');
+      videoData.value = tableData.value.filter(i => i.type == 'camera');
+      console.log(videoData.value)
       if (cabinets.length > 0) {
         boxCode.value = cabinets[0].code
         getBoxInfoData(cabinets[0].code)