瀏覽代碼

添加火点联动

JX.LI 2 年之前
父節點
當前提交
d3f68bec6e
共有 5 個文件被更改,包括 236 次插入6 次删除
  1. 8 0
      src/api/forest.js
  2. 24 0
      src/api/monitor.js
  3. 133 1
      src/components/TVWall.vue
  4. 68 0
      src/views/eventdetailsdialog.vue
  5. 3 5
      src/views/forest.vue

+ 8 - 0
src/api/forest.js

@@ -1,5 +1,13 @@
 import request from '@/utils/request'
 
+export function initByCameras(param) {
+  return request({
+    url: '/center-monitor/TVWallController/initByCameras',
+    method: 'get',
+    params:param
+  })
+
+}
 // 获取绑定的事件类型
 export function getMenuEventType() {
   return request({

+ 24 - 0
src/api/monitor.js

@@ -29,3 +29,27 @@ export function getRegionalFlag(id) {
     method: 'get',
   })
 }
+//获取点位周边摄像头
+export function findCameraByEventCoordinate(longitude,latitude) {
+  // longitude = '124.41986560821533';
+  // latitude = '43.08817137032747';
+  return request({
+    url: '/center-fire/VisuForestMonitorCenterController/findCameraByEventCoordinate?longitude='+longitude+"&latitude="+latitude+"&type=1",
+    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
+    }
+  })
+}

+ 133 - 1
src/components/TVWall.vue

@@ -36,9 +36,10 @@
 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 {
+  array:[],
   dicts: ['event_source'],
   components: {},
   data() {
@@ -281,6 +282,137 @@ export default {
           })
       }
     },
+    playRealMonitorVideo(array) { // 自定义设备树自动播放指定通道编码视频
+      const config = this.ws.config
+      const { loginIp, userCode } = config
+      this.ws.postMessage('playRealMonitorVideo', {
+        loginIp,
+        userCode,
+        params: {
+          ctrlCode: "ctrl1",
+          array: array
+        }
+      })
+
+    },
+
+    //火点联动电视墙调用
+    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
+
+    },
+    rotation(lng,lat,list){
+      rotation(lng,lat,list).then(res => {
+        console.log(res)
+
+      })
+    },
+    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)
+    },
     showTVWall() {
       // let that=this;
       /** ----------------------------------大华摄像头预览开始------------------------------------- */

+ 68 - 0
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>
@@ -977,6 +978,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>
 
@@ -988,6 +990,7 @@ import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部
 import eventLogUpload from '@/views/eventLogUpload.vue' //日志上传文件
 import areaSupermap from '@/components/supermap'//区域标记地图
 import TcPlayer from '@/components/TcPlayer' //视频预览
+import TVWall from '@/components/TVWall.vue' //电视墙弹窗
 import findUserByDept from '@/views/findUserByDept' //责任人选择弹框
 import {
   getEventDetail,
@@ -1004,6 +1007,7 @@ import {
   dutysystemList,
   dutysystemAdd,
   dutysystemRemove,
+  initByCameras,
   userFeginlist
 } from '@/api/forest'
 import {
@@ -1033,11 +1037,54 @@ export default {
     supermapDialog,
     eventLogUpload,
     areaSupermap,
+    TVWall,
     TcPlayer,
     findUserByDept
   },
   data() {
     return {
+      aa:[
+        {
+          "switchTab":"2",
+          "treeLabels":[
+            {
+              "id":null,
+              "labelCode":"999",
+              "labelName":"电视墙",
+              "parentLabelCode":""
+            },
+            {
+              "id":"spcamera00288",
+              "labelCode":"22030300001321100289",
+              "labelName":"四平市伊通县西苇椽子沟村",
+              "parentLabelCode":"999"
+            }
+          ],
+          "labelChannels":[
+            {
+              "labelCode":"22030300001321100289",
+              "channelDates":[
+                {
+                  "channelCode":"22030300001321100289",
+                  "channelName":"四平市伊通县西苇椽子沟村可见光",
+                  "channelSn":null,
+                  "cameraType":null,
+                  "online":"1",
+                  "cameraCode":null
+                },
+                {
+                  "channelCode":"22030300001321100290",
+                  "channelName":"四平市伊通县西苇椽子沟村热成像",
+                  "channelSn":null,
+                  "cameraType":null,
+                  "online":"1",
+                  "cameraCode":null
+                }
+              ]
+            }
+          ]
+        }
+      ],
       showFindUserByDept: false,//责任人选择框
       //海康
       cameraTitle: '',
@@ -1374,6 +1421,27 @@ 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='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
+      })
+
+    },
     showUpdateYjYuAn() {
       listYuAn().then(res => {
         //关联预案列表

+ 3 - 5
src/views/forest.vue

@@ -417,7 +417,7 @@
             @getTodayEvents="getTodayEvents" @getFirespread="getFirespread" @getSupermap="getSupermap"></eventdetailsdialog>
 
         <firespread ref="firespread" :calendarDay="calendarDay" @getEventList="getEventList"
-            @getTodayEvents="getTodayEvents" @showEventDialog="showEventDialog" @getSupermap="getSupermap"></firespread>
+            @getTodayEvents="getTodayEvents" @showEventDialog="showEventDialog" @getSupermap="getSupermap" @showDialog="showDialog"></firespread>
         <eventLocation ref="eventLocation"></eventLocation>
         <TVWall ref="TVWall"></TVWall>
     </div>
@@ -1213,7 +1213,7 @@ export default {
         websocketonmessage(e) { //数据接收
             console.log('接收数据', e.data)
             // let data = "{\"fromId\":\"forest\",\"fromUserId\":\""+Cookies.get('username')+"\",\"toUserId\":\""+Cookies.get('username')+"\"}";
-            let data = "{\"fromId\":\"forest\",\"fromUserId\":\"admin\",\"toUserId\":\"admin\"}";
+            let data = "{\"fromId\":\"resources\"}";
             if (this.calendarDay == this.getCurrentDataStr() && data != e.data) {
                 // 处理收到的消息
                 this.handleWebSoceketEvent(e.data)
@@ -1242,9 +1242,7 @@ export default {
          * @param {string} ping 心跳名称 默认字符串ping
          */
         sendPing(time = 60000, ping = {
-            'fromId': 'forest',
-            'fromUserId': Cookies.get('username'),
-            'toUserId': Cookies.get('username')
+            'fromId': 'resources'
         }) {
             clearInterval(this.setIntervalWesocketPush)
             this.setIntervalWesocketPush = setInterval(() => {