彭宇 2 vuotta sitten
vanhempi
commit
08706b0820
2 muutettua tiedostoa jossa 24 lisäystä ja 103 poistoa
  1. 23 34
      src/components/TVWall.vue
  2. 1 69
      src/dahua/TVWalllib/DHWs.js

+ 23 - 34
src/components/TVWall.vue

@@ -3,26 +3,6 @@
     <el-dialog title="电视墙" :visible.sync="TVWallVisible" v-if="TVWallVisible" width="80%" @close="cancelEventLocationShow()">
       <div class="event-info">
         <div class="event-info-con">
-          <div class="e-location-left">
-            <el-tabs v-model="activeName">
-              <el-tab-pane label="视频列表" name="tv">
-                <div class="forthis">
-                  <div class="i-list-con overflow-y" style="height: 50vh;">
-                    <div class="d-l-con d-evnet-list-con" v-for="(item,index) in 5"
-                         v-on:click="preview()">
-                      <!-- <img :src="" v-if="item.picturePath!=null&&item.picturePath!=''" class="event-list-img"> -->
-                      <img :src="item.picturePath" v-if="item.picturePath!=null&&item.picturePath!=''"
-                           class="event-list-img">
-                      <img src="@/assets/images/visual/img-sample.png" v-else class="event-list-img">
-                      <div class="event-list-text">
-                        <h3>列表</h3>
-                      </div>
-                    </div>
-                  </div>
-                </div>
-              </el-tab-pane>
-            </el-tabs>
-          </div>
           <div  class="e-location-right" style="width:100%;height:350px;position:relative;">
             <div id="dom1" class="dom1"></div>
             <div id="dom2" class="dom2"></div>
@@ -37,7 +17,7 @@
 
 <script>
   /** ----------------------------------摄像头预览开始------------------------------------- */
-  import { getDahuaVideoServer } from '@/api/dahua/dahua'
+  import { getDahuaVideoServer,getTVWallList } from '@/api/dahua/dahua'
   import DHWs from '@/dahua/lib/DHWs'
 
   /** ----------------------------------摄像头预览结束------------------------------------- */
@@ -124,14 +104,6 @@
         activePanel: 'key1',
         isLogin: false,
         loginType: '1',
-        // loginIp: '10.1.240.10',
-        // userName: 'yanshi',
-        // userPwd: 'dahua123',
-        // loginPort: '8320',
-        loginIp: '202.111.178.254',
-        userName: 'system',
-        userPwd: 'Admin@123',
-        loginPort: '7902',
         token: '',
         ctrlType: 'playerWin',
         https: 1,
@@ -303,9 +275,11 @@
       cancelEventLocationShow() {
         this.activeName = 'tv'
         this.TVWallVisible=false
+        this.destroy()
       },
       showTVWall() {
         this.TVWallVisible = true
+        this.preview()
       },
       /** ----------------------------------摄像头预览开始------------------------------------- */
       alertLogin: function() {
@@ -340,7 +314,9 @@
                 if (res) {
                   this.alertLoginSuccess()
                   this.activePanel = 'key2'
-                  this.create()
+                  getTVWallList().then(newres=> {
+                    this.create(newres.data)
+                  });
                 } else {
                   this.alertLoginFailed()
                 }
@@ -352,7 +328,8 @@
         })
       },
 
-      create() { // 调用创建控件接口
+      create(tvListJson) { // 调用创建控件接口
+        console.log(tvListJson)
         debugger
         let _this = this;
         console.log(this.cutPosX,"this.cutPosX")
@@ -376,16 +353,16 @@
         this.setPos();
         _this.ws.createCtrl(params).then(res => {
           console.log(res);
-          _this.ws.customizeTree(this.tvListJson);
+          _this.ws.customizeTree(tvListJson);
         }).catch(e => {
           console.log(e);
         });
         _this.ws.on('createCtrlResult', (res) => {
           console.log(res);
-          _this.ws.customizeTree(this.tvListJson);
+          _this.ws.customizeTree(tvListJson);
           _this.ws.on('createCtrlResult', (res) => {
             console.log(res);
-            _this.ws.customizeTree(this.tvListJson);
+            _this.ws.customizeTree(tvListJson);
           });
         });
       },
@@ -404,6 +381,18 @@
           window.fireEvent("onresize");
         }
       },
+      destroy() { // 调用销毁控件接口
+        if (!this.isLogin) {
+          this.$Message.info('正在登陆客户端,请稍等......');
+          return false;
+        }
+        const ctrls = this.ws.ctrls.map(i => {
+          if (i.ctrlCode === this.ctrl) {
+            return i.ctrlCode;
+          }
+        });
+        this.ws.destroyCtrl(ctrls);
+      },
       /** ----------------------------------摄像头预览结束------------------------------------- */
     }
   }

+ 1 - 69
src/dahua/TVWalllib/DHWs.js

@@ -5812,75 +5812,7 @@
 	            loginIp,
 	            userCode,
 	            params: {
-	                array: [{
-							"switchTab": "1",
-							"treeLabels": [{
-									"labelCode": "123456",
-									"labelName": "视频场景",
-									"parentLabelCode": null
-								},
-								{
-									"labelCode": "5a81d1bd499b4940a21fc63ca51f4dfa",
-									"labelName": "标签2",
-									"parentLabelCode": 123456
-								},
-								{
-									"labelCode": "d941adbbd3e64dac92cc448dec5293cd",
-									"labelName": "标签1",
-									"parentLabelCode": 123456
-								}
-							],
-							"labelChannels": [{
-									"channelDates": [{
-											"channelCode": "6044981090191552",
-											"channelName": "复兴大桥中段-交通事故",
-											"channelSn": null,
-											"cameraType": 0,
-											"online": 1
-										},
-										{
-											"channelCode": "ZgVzqsjwA1DTF561VGHK5E",
-											"channelName": "北京7青羊东二路77号2通道1",
-											"channelSn": null,
-											"cameraType": 1,
-											"online": 1
-										}
-									],
-									"labelCode": "d941adbbd3e64dac92cc448dec5293cd"
-								},
-								{
-									"channelDates": [{
-										"channelCode": "ZgVzqsjwA1DTF561VGHKK7",
-										"channelName": "北京7青羊东二路77号2通道2",
-										"channelSn": null,
-										"cameraType": 2,
-										"online": 0
-									}],
-									"labelCode": "5a81d1bd499b4940a21fc63ca51f4dfa"
-								}
-							]
-						},
-						{
-							"switchTab": "2",
-							"labelChannels": [{
-								"channelDates": [{
-										"channelCode": "ZgVzqsjwA1DTF561VGHK5E",
-										"channelName": "北京7青羊东二路77号2通道1",
-										"channelSn": null,
-										"cameraType": 1,
-										"online": 1
-									},
-									{
-										"channelCode": "ZgVzqsjwA1DTF561VGHKK7",
-										"channelName": "北京7青羊东二路77号2通道2",
-										"channelSn": null,
-										"cameraType": 2,
-										"online": 0
-									}
-								]
-							}]
-						}
-					]
+	                array: [trees[0]]
 	            }
 	        });
 	    },