王通 2 lat temu
rodzic
commit
07e4dcf2e3
4 zmienionych plików z 184 dodań i 3 usunięć
  1. 11 1
      src/api/forest.js
  2. 14 1
      src/api/monitor.js
  3. 130 0
      src/components/TVWall.vue
  4. 29 1
      src/views/eventdetailsdialog.vue

+ 11 - 1
src/api/forest.js

@@ -294,6 +294,16 @@ export function eventHandling(id,eventCode) {
   return request({
     url: '/center-environment/VisuForestEventCenterController/eventHandling',
     method: 'post',
-    data: {id:id,eventCode:eventCode,dataStatus:"1"}
+    data: { id: id, eventCode: eventCode, dataStatus: "1" }
   })
 }
+  //范围摄像头
+  export function initByCameras(param) {
+    return request({
+      url: '/center-monitor/TVWallController/initByCameras',
+      method: 'get',
+      params:param
+    })
+
+
+}

+ 14 - 1
src/api/monitor.js

@@ -38,7 +38,20 @@ export function selectListDevice(param) {
     params:param
   })
 }
-
+//转到固定点位
+export function rotation(lng,lat,list) {
+  // lng = '124.41986560821533';
+  // lat = '43.08817137032747';
+  return request({
+    url: '/center-fire/VisuForestMonitorCenterController/rotation',
+    method: 'post',
+    data:{
+      lng:lng,
+      lat:lat,
+      list:list
+    }
+  })
+}
 /***********************************和上面方法目前一样只是入参不一样以后可能有不一样的地方 start  所以下面三个方法暂时没用到**********************/
 // // 获取环保污染源设备列表
 // export function selectListDevice(param) {

+ 130 - 0
src/components/TVWall.vue

@@ -35,6 +35,7 @@
 /** ----------------------------------摄像头预览开始------------------------------------- */
 import { getDahuaVideoServer, getTVWallList } from '@/api/dahua/dahua'
 import { tvCameraList } from '@/api/haikang/haikang'
+import { rotation } from '@/api/monitor'
 import DHWs from '@/dahua/lib/DHWs'
 
 /** ----------------------------------摄像头预览结束------------------------------------- */
@@ -281,6 +282,135 @@ export default {
           })
       }
     },
+    //火点联动电视墙调用
+    showTVWall1(longitude,latitude,tvListJson) {
+      // let that=this;
+      /** ----------------------------------大华摄像头预览开始------------------------------------- */
+      this.ws.addEventListener('connectStateChange', data => {
+        if (data) {
+          console.log('连接成功')
+        } else {
+          console.log('连接失败,下载客户端')
+          this.alertReinstall()
+          this.isShowTipe && this.$modal.confirm({
+            title: '下载客户端',
+            content: '检测到您未安装部分插件,将影响部分功能使用,请下载后使用?',
+            onOk: () => {
+              //这里写下载方法
+              this.isShowTipe = false
+            },
+            onCancel: () => {
+              this.isShowTipe = false
+            }
+          });
+        }
+      })
+      getDahuaVideoServer().then(newResponse => {
+        this.ws.detectConnectQt().then(res => {
+          if (res) { // 连接客户端成功
+            this.alertLogin()
+            this.ws.login({
+              loginIp: newResponse.loginIp,
+              loginPort: newResponse.loginPort,
+              userName: newResponse.userName,
+              userPwd: newResponse.userPwd,
+              // loginIp: '192.168.100.100',
+              // loginPort: 8314,
+              // userName: 'system',
+              // userPwd: 'Admin@123',
+              token: '',
+              https: 1
+            })
+            this.ws.on('loginState', (res) => {
+              this.isLogin = res
+              console.log('---res-----', res)
+              if (res) {
+                this.alertLoginSuccess()
+                this.activePanel = 'key2'
+                console.log(tvListJson)
+                const array=[]
+                const array1=[]
+                tvListJson[0].treeLabels.forEach((item,index)=>
+                {
+                  if (index!=0)
+                  {
+                    const param =Object.assign({})
+                    param.channelId=item.labelCode
+                    array.push(param)
+                    array1.push(item.labelCode)
+                  }
+
+                })
+                this.create1(longitude,latitude,tvListJson,array,array1)
+                // var obj=JSON.parse(tvListJson)
+              } else {
+                this.alertLoginFailed()
+              }
+            })
+          } else { // 连接客户端失败
+            this.alertReinstall()
+          }
+        })
+
+      })
+      /** ----------------------------------大华摄像头预览结束------------------------------------- */
+      /** ----------------------------------海康摄像头预览开始------------------------------------- */
+      // tvCameraList().then(response => {
+      //   this.cameraList=response.data
+      // })
+      // that.initPlugin()
+      // setTimeout(function() {
+      //   that.playhk();
+      // }, 5000)
+      // /** ----------------------------------海康摄像头预览结束------------------------------------- */
+      this.TVWallVisible = true
+
+    },
+    create1(longitude,latitude,tvListJson,array,array1) { // 调用创建控件接口
+      let _this = this
+      const params = [
+        {
+          'ctrlType': 'realMonitorUI',
+          'ctrlCode': 'ctrl1',
+          'ctrlProperty': {
+            'displayMode': 1,
+            'splitNum': 1,
+            'channelList': [
+              {
+                'channelId': ''
+              }
+            ]
+          },
+          'visible': true,
+          'domId': 'dom1'
+        }
+      ]
+      this.setPos()
+      this.customizeTree(tvListJson);
+      _this.ws.createCtrl(params);
+      _this.playRealMonitorVideo(array)
+      setTimeout(() => {
+        _this.rotation(longitude,latitude,array1)
+      }, 5000)
+
+    },
+    playRealMonitorVideo(array) { // 自定义设备树自动播放指定通道编码视频
+      const config = this.ws.config
+      const { loginIp, userCode } = config
+      this.ws.postMessage('playRealMonitorVideo', {
+        loginIp,
+        userCode,
+        params: {
+          ctrlCode: "ctrl1",
+          array: array
+        }
+      })
+
+    },
+    rotation(lng,lat,list){
+      rotation(lng,lat,list).then(res => {
+      })
+    },
     showTVWall() {
       // let that=this;
       /** ----------------------------------大华摄像头预览开始------------------------------------- */

+ 29 - 1
src/views/eventdetailsdialog.vue

@@ -59,6 +59,7 @@
                    </div> -->
                 <!-- 底部工具栏end -->
                 <div class="fire-m">
+                  <el-button size="small" icon="el-icon-s-grid" @click="showTVWallDiaLog()">火点联动</el-button>
                   <el-button size="small" icon="el-icon-upload" @click="showheatPlotting()">火灾蔓延
                   </el-button>
                 </div>
@@ -985,6 +986,7 @@
     <el-dialog title="人员选择" :visible.sync="showFindUserByDept" width="40%">
       <findUserByDept v-if="showFindUserByDept" ref="findUserByDept" :deptId="iconCurrentIndex" @addSelection="addSelection"></findUserByDept>
     </el-dialog>
+    <TVWall ref="TVWall"></TVWall>
   </div>
 </template>
 
@@ -1013,7 +1015,8 @@ import {
   dutysystemAdd,
   dutysystemRemove,
   userFeginlist,
-  eventHandling
+  eventHandling,
+  initByCameras
 } from '@/api/forest'
 import {
   treeselectAll as deptTreeselect
@@ -1030,6 +1033,7 @@ import {
 } from '@/api/dahua/dahua'
 import DHWs from '@/dahua/lib/DHWs'
 import { selectConfigKey } from "@/api/system/config";
+import TVWall from '@/components/TVWall.vue' //电视墙弹窗
 import Cookies from 'js-cookie';
 export default {
   dicts: ['task_source'],
@@ -1040,6 +1044,7 @@ export default {
   },
   components: {
     vheader,
+    TVWall,
     vBottomMenu,
     supermapDialog,
     eventLogUpload,
@@ -1658,6 +1663,29 @@ export default {
         cityAudit: null
       }
     },
+
+    showTVWallDiaLog() {
+      this.initByCameras()
+      // this.$refs.TVWall.showTVWall();
+
+    },
+    initByCameras()
+    {
+      const params=Object.assign({})
+      params.longitude=this.longitude;
+      params.latitude=this.latitude;
+      params.type='1'
+      initByCameras(params).then(res=>
+      {
+        this.$refs.TVWall.showTVWall1(this.longitude,this.latitude,res.data);
+        this.$refs.supermap.isEditableLayers = false
+        this.$refs.bottomMenu.showChild = false
+        this.$refs.bottomMenu.showBanChild = false
+        this.$refs.bottomMenu.showChangChild = false
+      })
+
+    },
+
     /**
      * eventStatusValue 事件状态
      * isSend 是否办理