王通 %!s(int64=2) %!d(string=hai) anos
pai
achega
d766b72599
Modificáronse 4 ficheiros con 186 adicións e 1 borrados
  1. 8 0
      src/api/forest.js
  2. 14 0
      src/api/monitor.js
  3. 136 0
      src/components/TVWall.vue
  4. 28 1
      src/views/eventdetailsdialog.vue

+ 8 - 0
src/api/forest.js

@@ -297,3 +297,11 @@ export function eventHandling(id,eventCode) {
     data: {id:id,eventCode:eventCode,dataStatus:"1"}
   })
 }
+export function initByCameras(param) {
+  return request({
+    url: '/center-monitor/TVWallController/initByCameras',
+    method: 'get',
+    params:param
+  })
+
+}

+ 14 - 0
src/api/monitor.js

@@ -29,3 +29,17 @@ export function getRegionalFlag(id) {
     method: 'get',
   })
 }
+//转到固定点位
+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
+    }
+  })
+}

+ 136 - 0
src/components/TVWall.vue

@@ -36,6 +36,8 @@
 import { getDahuaVideoServer, getTVWallList } from '@/api/dahua/dahua'
 import { tvCameraList } from '@/api/haikang/haikang'
 import DHWs from '@/dahua/lib/DHWs'
+import { rotation } from '@/api/monitor'
+
 
 /** ----------------------------------摄像头预览结束------------------------------------- */
 export default {
@@ -281,6 +283,140 @@ 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=[]
+                if (tvListJson!=null)
+                {
+                  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){
+      console.log(list)
+      rotation(lng,lat,list).then(res => {
+      })
+    },
     showTVWall() {
       // let that=this;
       /** ----------------------------------大华摄像头预览开始------------------------------------- */

+ 28 - 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>
@@ -978,6 +979,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>
 
@@ -985,6 +987,7 @@
 import html2canvas from 'html2canvas'//截图组件
 import supermapDialog from '@/components/supermap' //超图
 import vheader from '@/components/v-header.vue' //一体化共用头部
+import TVWall from '@/components/TVWall.vue' //电视墙弹窗
 import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
 import eventLogUpload from '@/views/eventLogUpload.vue' //日志上传文件
 import areaSupermap from '@/components/supermap'//区域标记地图
@@ -1006,7 +1009,8 @@ import {
   dutysystemAdd,
   dutysystemRemove,
   userFeginlist,
-  eventHandling
+  eventHandling,
+  initByCameras
 } from '@/api/forest'
 import {
   treeselectAll as deptTreeselect
@@ -1033,6 +1037,7 @@ export default {
   },
   components: {
     vheader,
+    TVWall,
     vBottomMenu,
     supermapDialog,
     eventLogUpload,
@@ -1381,6 +1386,28 @@ export default {
       this.eventDialog = false;
       this.$emit('getFirespread', this.eventCode);
     },
+    showTVWallDiaLog() {
+      this.initByCameras()
+      // this.$refs.TVWall.showTVWall();
+
+    },
+    initByCameras()
+    {
+      const params=Object.assign({})
+      params.longitude=this.longitude;
+      params.latitude=this.latitude;
+      params.type='8'
+      initByCameras(params).then(res=>
+      {
+        console.log(2222222222222,res.data)
+        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
+      })
+
+    },
     showUpdateYjYuAn() {
       listYuAn().then(res => {
         //关联预案列表