敲代码的猫 3 달 전
부모
커밋
4436254e9a

+ 34 - 73
src/components/VideoComponent/index.vue

@@ -54,15 +54,15 @@ export default {
   },
   methods: {
     //引入外部js文件
-    importJsFileNew () {
-      const linkData = {
-        type: "script",
-        url: "/videoComponent/v2.0.0/uvp.js"
-      };
-      let script = document.createElement('script');
-      script.src = linkData.url;
-      document.body.appendChild(script);
-    },
+    // importJsFileNew () {
+    //   const linkData = {
+    //     type: "script",
+    //     url: "/videoComponent/v2.0.0/uvp.js"
+    //   };
+    //   let script = document.createElement('script');
+    //   script.src = linkData.url;
+    //   document.body.appendChild(script);
+    // },
 
     //引入外部js文件
     importJsFile () {
@@ -138,31 +138,13 @@ export default {
       });
     },
 
-    //开始播放
-    // videoPlay(options) {
-    //   const that = this;
-    //   DataFunc.get('/uvp-micro-service/mediatranscode/api/v1/play', {
-    //     code: options.code,
-    //     sessionId: that.generateUUID(),
-    //     ak: that.cameraConfig.ak,
-    //     token: that.cameraConfig.token,
-    //     redirect:false,
-    //     timestamp: that.getCurrentTimestamp(),
-    //     nonce:that.generateUUID(),
-    //   },{location: true}).then(res => {
-    //     console.log("==获取的视频地址==",res.location);
-    //     if(res && res.location){
-    //       that.location = res.location;
-
-    //     }
-    //   });
-    // },
+    
 
     //开始播放
     videoPlay(options) {
       const that = this;
       if(!options || !options.code) {
-        console.log("==设备编码不全,无法播放==");
+        console.log("==设备编码不全,无法播放==");      
         return;
       }
       if(!that.nrUvpVideoObj) {
@@ -188,54 +170,33 @@ export default {
 
     // 云台控制
     videoControl(options) {
-      const that = this;
-      if(!options || !options.code) {
-        console.log("==设备编码不全,无法播放==");
-        return;
-      }
-      if(!that.nrUvpVideoObj) {
-        console.log("==创建播放器==");
-        that.nrUvpVideoObj = new UVPVideoObj({
-          id: that.clientId,
-          winNum: options.winNum,
-          ip: that.cameraConfig.ip,
-          port: that.cameraConfig.port,
-          token: that.cameraConfig.token,
-          ak: that.cameraConfig.ak,
-          callback: onEventNotify
-        });
-      }
-      console.log("==开始操作==>参数集: ",JSON.stringify(options));
-      that.nrUvpVideoObj.uvpVideoControl({
-        // winNum: options.winNum,
-        devCode: options.code,
-        cmd:options.control,
-        lspeed:5,
-        rspeed:5,
-      });
-    },
+    if (!options?.code) return;
+    // if (!this.nrUvpVideoObj) {
+    //   this.nrUvpVideoObj = new UVPVideoObj({
+    //       id: that.clientId,
+    //       winNum: options.winNum,
+    //       ip: that.cameraConfig.ip,
+    //       port: that.cameraConfig.port,
+    //       token: that.cameraConfig.token,
+    //       ak: that.cameraConfig.ak,
+    //       callback: onEventNotify
+    //   });
+    // }
+     console.log("==进入云台操作==>参数集: ",JSON.stringify(options));
+    this.nrUvpVideoObj.uvpVideoControl({
+      devCode: options.code,
+      cmd: options.control,
+      lspeed: 5,
+      rspeed: 5,
+    });
+  },
+
 
     // 视频截图
     capture(options){
-      const that = this;
-      if(!options || !options.code) {
-        console.log("==设备编码不全,无法播放==");
-        return;
-      }
-      if(!that.nrUvpVideoObj) {
-        console.log("==创建播放器==");
-        that.nrUvpVideoObj = new UVPVideoObj({
-          id: that.clientId,
-          winNum: options.winNum,
-          ip: that.cameraConfig.ip,
-          port: that.cameraConfig.port,
-          token: that.cameraConfig.token,
-          ak: that.cameraConfig.ak,
-          callback: onEventNotify
-        });
-      }
+       if (!options?.code) return;
       console.log("==开始截图==>参数集: ",JSON.stringify(options));
-      that.nrUvpVideoObj.uvpCapture({
+      this.nrUvpVideoObj.uvpCapture({
         winNum: options.winNum,
         fileName:"",
         fileType:1

+ 6 - 6
src/views/screen/building/energyRate.vue

@@ -15,7 +15,7 @@
                     <div class="num">{{ thisWeekElectricityList.total[0].num }}<span class="unit">kWh</span></div>
                   </div>
                  </div>
-                 <div class="left-list" style="margin-right: -28px;">
+                 <div class="left-list" style="margin-left: 15px;;">
                     <div class="left-info">
                     <div class="name">
                       <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -24,7 +24,7 @@
                     <div class="num">{{ thisWeekElectricityList.total[1].num }}<span class="unit">kWh</span></div>
                   </div>
                  </div>
-                 <div class="left-list" style="margin-right: -30px;">
+                 <div class="left-list" style="margin-left: -12px;">
                     <div class="left-info">
                     <div class="name">
                       <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -33,7 +33,7 @@
                     <div class="num">{{ thisWeekElectricityList.total[2].num }}<span class="unit">kWh</span></div>
                   </div>
                  </div>
-                 <div class="left-list" style="padding-right: 41px;">
+                 <div class="left-list" style="padding-right: 10px;">
                     <div class="left-info">
                     <div class="name">
                       <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -71,7 +71,7 @@
                     <div class="num">{{ thisWeekElectricityList.total[6].num }}<span class="unit">kWh</span></div>
                   </div>
                  </div>
-                 <div class="left-list" style="padding-right: 55px;">
+                 <div class="left-list" style="padding-right: 20px;">
                     <div class="left-info">
                     <div class="name">
                       <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -110,7 +110,7 @@
                     <div class="num">{{ thisWeekElectricityList.total[10].num }}<span class="unit">kWh</span></div>
                   </div>
                  </div>
-                 <div class="left-list" style="padding-right: 24px;">
+                 <div class="left-list" style="padding-right: 5px;">
                     <div class="left-info">
                     <div class="name">
                       <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -780,7 +780,7 @@ export default {
           display: block;
           width:25px;
           height:25px;
-          margin-right: 5px;
+          margin-right: 2px;
         }
         .left-info{
           padding-left:0px;

+ 9 - 9
src/views/screen/building/energyRateDialog.vue

@@ -21,7 +21,7 @@
                   <div class="num" @click="abnormalClick(1,'光伏用电量')" >{{ thisWeekElectricityList.total[0].num }}<span class="unit">kWh</span></div>
                 </div>
               </div>
-              <div class="left-list" style="margin-left: 22px;">
+              <div class="left-list" style="margin-left: 15px;">
                 <div class="left-info">
                   <div class="name">
                     <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -39,7 +39,7 @@
                   <div class="num" @click="abnormalClick(1,'充电桩用电量')">{{ thisWeekElectricityList.total[2].num }}<span class="unit">kWh</span></div>
                 </div>
               </div>
-              <div class="left-list" style="margin-right: 48px;">
+              <div class="left-list" style="margin-right: 18px;">
                 <div class="left-info">
                   <div class="name">
                     <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -60,7 +60,7 @@
                   <div class="num" @click="abnormalClick(1,'制冷机组用电量')">{{ thisWeekElectricityList.total[4].num }}<span class="unit">kWh</span></div>
                 </div>
               </div>
-              <div class="left-list" style="margin-left: -18px;">
+              <div class="left-list" style="margin-left: -20px;">
                 <div class="left-info">
                   <div class="name">
                     <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -78,7 +78,7 @@
                   <div class="num" @click="abnormalClick(1,'电梯用电量')">{{ thisWeekElectricityList.total[6].num }}<span class="unit">kWh</span></div>
                 </div>
               </div>
-              <div class="left-list" style="padding-right: 60px;">
+              <div class="left-list" style="padding-right: 28px;">
                 <div class="left-info">
                   <div class="name">
                     <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -99,7 +99,7 @@
                   <div class="num" @click="abnormalClick(1,'公共照明用电量')">{{ thisWeekElectricityList.total[8].num }}<span class="unit">kWh</span></div>
                 </div>
               </div>
-              <div class="left-list">
+              <div class="left-list" style="margin-left: -10px;">
                 <div class="left-info">
                   <div class="name">
                     <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -108,7 +108,7 @@
                   <div class="num" @click="abnormalClick(1,'供热设备用电量')">{{ thisWeekElectricityList.total[9].num }}<span class="unit">kWh</span></div>
                 </div>
               </div>
-              <div class="left-list">
+              <div class="left-list" style="margin-left: -10px;">
                 <div class="left-info">
                   <div class="name">
                     <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -117,7 +117,7 @@
                   <div class="num" @click="abnormalClick(1,'厨房用电量')">{{ thisWeekElectricityList.total[10].num }}<span class="unit">kWh</span></div>
                 </div>
               </div>
-              <div class="left-list" style="padding-right: 30px;">
+              <div class="left-list" >
                 <div class="left-info">
                   <div class="name">
                     <div> <img src="@/assets/images/service_new/quantity.png"></div>
@@ -2090,7 +2090,7 @@ export default {
   .leftNavList {
     display: flex;
     flex-wrap: wrap;
-    padding: 10px 10px 0px 10px;
+    padding: 10px 0px 0px 0px;
     justify-content: space-between;
 
     .left-list {
@@ -2102,7 +2102,7 @@ export default {
         display: block;
         width: 20px;
         height: 20px;
-        margin-right: 5px;
+        margin-right: 2px;
       }
 
       .left-info {

+ 80 - 78
src/views/screen/engineering/monitorLive.vue

@@ -11,25 +11,25 @@
         <video-component @videoLoad="playVideo"></video-component>
       </div>
     </div>
-    <div @click="upWord"  class="c1" style="right: 20px;top: 70px;" >
-      <img src="../../../assets/zhang/cameraScreen/leave.png" width="20px">
-    </div>
-    <div @click="shot"  class="c1" style="right: 20px;top: 120px;">
+    <div @click="shot"  class="c1" style="right: 20px;top: 140px;">
       <img src="../../../assets/zhang/cameraScreen/cut.png" width="20px">
     </div>
-    <div @click="amplify" class="c1" style="right: 20px;top: 170px;">
+    <div @click="amplify" class="c1" style="right: 20px;top: 190px;">
       <img src="../../../assets/zhang/cameraScreen/bigger.png" width="20px">
     </div>
-    <div @click="reduce" class="c1" style="right: 20px;top: 220px;">
+    <div @click="reduce" class="c1" style="right: 20px;top: 240px;">
       <img src="../../../assets/zhang/cameraScreen/smaller.png" width="20px">
     </div>
-    <div class="c2" style="right: 20px;top: 390px;">
+    <div class="c2" style="right: 40px;top: 400px;">
       <div @click="left" style="position: absolute;left: 0;">
         <img src="../../../assets/zhang/cameraScreen/left.png" width="60px">
       </div>
       <div @click="right" style="position: absolute;right: 0;">
         <img src="../../../assets/zhang/cameraScreen/right.png" width="60px">
       </div>
+      <div @click="upWord">
+      <img src="../../../assets/zhang/cameraScreen/leave.png" width="20px">
+    </div>
       <div @click="top" style="position: absolute;top: 0;">
         <img src="../../../assets/zhang/cameraScreen/up.png" width="80px">
       </div>
@@ -58,6 +58,7 @@ export default {
       videoObj: '',
       played: false,
       code: '',
+      direction:''
     };
   },
   watch: {
@@ -95,6 +96,7 @@ export default {
     // 播放器加载完毕
     playVideo(obj) {
       console.log(obj, '================================')
+      console.log("子组件实例方法列表:", Object.keys(obj));
       this.videoObj = obj;
       this.code = this.monitorInfo.code;
       if(!this.code) return;
@@ -107,113 +109,113 @@ export default {
       this.played = true;
     },
 
-    left(obj) {
-      console.log(obj, '================================')
-      this.videoObj = obj;
-      this.code = this.monitorInfo.code;
-      if(!this.code) return;
+    left() {
+      this.direction=0x0503
+      // alert(1)
+      console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
+      if (!this.videoObj)
+       return;
+      // alert(2)
       this.videoObj.videoControl({
-        winNum: this.winNum,
-        code: this.monitorInfo.code,
-        control:0x0504,
-      });
-      this.played = true;
-    },
-    right(obj) {
-      console.log(obj, '================================')
-      this.videoObj = obj;
-      this.code = this.monitorInfo.code;
-      if(!this.code) return;
+      winNum: this.winNum,
+      code: this.monitorInfo.code,
+      control: 0x0504, 
+    });
+    
+  },
+    
+    right() {
+      this.direction=0x0501
+      console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
+      if (!this.videoObj)
+       return;
+      // alert(2)
       this.videoObj.videoControl({
-        winNum: this.winNum,
-        code: this.monitorInfo.code,
-        control:0x0502,
+      winNum: this.winNum,
+      code: this.monitorInfo.code,
+      control: 0x0502, 
       });
-      this.played = true;
     },
-    top(obj) {
-      console.log(obj, '================================')
-      this.videoObj = obj;
-      this.code = this.monitorInfo.code;
-      if(!this.code) return;
+    top() {
+      this.direction=0x0401
+      console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
+      if (!this.videoObj)
+       return;
+      // alert(2)
       this.videoObj.videoControl({
-        winNum: this.winNum,
-        code: this.monitorInfo.code,
-        control:0x0402,
+      winNum: this.winNum,
+      code: this.monitorInfo.code,
+      control: 0x0402, 
       });
-      this.played = true;
     },
-    bottom(obj) {
-      console.log(obj, '================================')
-      this.videoObj = obj;
-      this.code = this.monitorInfo.code;
-      if(!this.code) return;
+    bottom() {
+      this.direction=0x0403
+      console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
+      if (!this.videoObj)
+       return;
+      // alert(2)
       this.videoObj.videoControl({
-        winNum: this.winNum,
-        code: this.monitorInfo.code,
-        control:0x0404,
+      winNum: this.winNum,
+      code: this.monitorInfo.code,
+      control: 0x0404, 
       });
-      this.played = true;
     },
 
 
-    upWord(obj) {
-      console.log(obj, '================================')
-      this.videoObj = obj;
-      this.code = this.monitorInfo.code;
-      if(!this.code) return;
+    upWord() {
+      // alert(this.direction)
+      console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
+      if (!this.videoObj)
+       return;
+      // alert(2)
       this.videoObj.videoControl({
-        winNum: this.winNum,
-        code: this.monitorInfo.code,
-        control:0x0401,
+      winNum: this.winNum,
+      code: this.monitorInfo.code,
+      control:  this.direction, 
       });
-      this.played = true;
     },
 
     //视频截图
-    shot(obj) {
-      console.log(obj, '================================')
-      this.videoObj = obj;
-      this.code = this.monitorInfo.code;
-      if(!this.code) return;
+    shot() {
+      console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
+      if (!this.videoObj)
+       return;
       this.videoObj.capture({
         winNum: this.winNum,
+        code: this.monitorInfo.code,
       });
-      this.played = true;
     },
 
-    amplify(obj) {
-      console.log(obj, '================================')
-      this.videoObj = obj;
-      this.code = this.monitorInfo.code;
-      if(!this.code) return;
+    amplify() {
+      console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
+      if (!this.videoObj)
+       return;
+      // alert(2)
       this.videoObj.videoControl({
-        winNum: this.winNum,
-        code: this.monitorInfo.code,
-        control:0x0304,
+      winNum: this.winNum,
+      code: this.monitorInfo.code,
+      control: 0x0304, 
       });
-      this.played = true;
     },
 
-    reduce(obj) {
-      console.log(obj, '================================')
-      this.videoObj = obj;
-      this.code = this.monitorInfo.code;
-      if(!this.code) return;
+    reduce() {
+      console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
+      if (!this.videoObj)
+       return;
+      // alert(2)
       this.videoObj.videoControl({
-        winNum: this.winNum,
-        code: this.monitorInfo.code,
-        control:0x0302,
+      winNum: this.winNum,
+      code: this.monitorInfo.code,
+      control: 0x0302, 
       });
-      this.played = true;
     },
 
   },