Ver código fonte

火点联动

王通 2 anos atrás
pai
commit
66bab4f88d

+ 19 - 1
src/api/forest.js

@@ -304,6 +304,24 @@ export function eventHandling(id,eventCode) {
   return request({
     url: '/center-fire/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
+    })
+
+}
+// export function initByCameras(param) {
+//   return request({
+//     url: '/center-fire/VisuForestMonitorCenterController/findCameraByEventCoordinate',
+//     method: 'get',
+//     params:param
+//   })
+
+// }
+

+ 4 - 4
src/api/monitor.js

@@ -40,8 +40,8 @@ export function getRegionalFlag(id) {
 
 //获取点位周边摄像头
 export function findCameraByEventCoordinate(longitude,latitude) {
-  longitude = '124.41986560821533';
-  latitude = '43.08817137032747';
+  // longitude = '124.41986560821533';
+  // latitude = '43.08817137032747';
   return request({
     url: '/center-fire/VisuForestMonitorCenterController/findCameraByEventCoordinate?longitude='+longitude+"&latitude="+latitude+"&type=1",
     method: 'get',
@@ -50,8 +50,8 @@ export function findCameraByEventCoordinate(longitude,latitude) {
 
 //转到固定点位
 export function rotation(lng,lat,list) {
-  lng = '124.41986560821533';
-  lat = '43.08817137032747';
+  // lng = '124.41986560821533';
+  // lat = '43.08817137032747';
   return request({
     url: '/center-fire/VisuForestMonitorCenterController/rotation',
     method: 'post',

+ 127 - 1
src/components/TVWall.vue

@@ -41,6 +41,7 @@ export default {
   components: {},
   data() {
     return {
+      array:[],
       tvListJson: [
         {
           'switchTab': '2',
@@ -228,7 +229,6 @@ export default {
     },
     rotation(lng,lat,list){
       rotation(lng,lat,list).then(res => {
-
       })
     },
     cancelEventLocationShow() {
@@ -244,6 +244,104 @@ 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
+
+    },
     showTVWall() {
       // let that=this;
       /** ----------------------------------大华摄像头预览开始------------------------------------- */
@@ -318,6 +416,7 @@ export default {
                   this.alertLoginSuccess()
                   this.activePanel = 'key2'
                   this.create(newres.data)
+
                 } else {
                   this.alertLoginFailed()
                 }
@@ -329,7 +428,34 @@ export default {
         })
       })
     },
+    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)
 
+    },
     create(tvListJson) { // 调用创建控件接口
       let _this = this
       const params = [

+ 68 - 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>
                 <!-- 地图 -->
@@ -1062,6 +1063,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>
 
@@ -1073,6 +1075,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,
@@ -1091,7 +1094,7 @@ import {
   dutysystemRemove,
   sendMessage,
   userFeginlist,
-  eventHandling
+  eventHandling, initByCameras
 } from '@/api/forest'
 import {
   treeselectAll as deptTreeselect
@@ -1121,12 +1124,55 @@ export default {
     vBottomMenu,
     supermapDialog,
     eventLogUpload,
+    TVWall,
     areaSupermap,
     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,//责任人选择框
       /** ----------------------------------摄像头预览开始------------------------------------- */
       //大华
@@ -1483,6 +1529,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 => {
         //关联预案列表

+ 9 - 1
src/views/firespread.vue

@@ -33,6 +33,7 @@
                 </div>
                 <!-- 应急预案end -->
                 <div class="fire-m">
+
                   <el-button size="small" icon="el-icon-upload" @click="showEventdetailsdialog()">动态标绘</el-button>
                   <el-button size="small" icon="el-icon-upload" @click="showheatPlotting()">火灾蔓延</el-button>
                 </div>
@@ -140,13 +141,16 @@
         <div id="playWnd" class="playWnd" style="left: 0px; top: 0px;"></div>
       </div>
     </el-dialog>
+<!--    <TVWall ref="TVWall"></TVWall>-->
   </div>
+
 </template>
 
 <script>
   import html2canvas from 'html2canvas'//截图组件
   import supermapDialog1 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'//区域标记地图
@@ -166,7 +170,8 @@
     dutysystemList,
     dutysystemAdd,
     dutysystemRemove,
-    userFeginlist
+    userFeginlist,
+    initByCameras
   } from '@/api/forest'
   import {
     treeselectAll as deptTreeselect
@@ -191,6 +196,7 @@
     },
     components: {
       vheader,
+      TVWall,
       vBottomMenu,
       supermapDialog1,
       eventLogUpload,
@@ -200,6 +206,7 @@
     data() {
       return {
         //海康
+        tvListJson:[],
         cameraTitle: '',
         cameraCode:'',
         cameraVisible: false,
@@ -513,6 +520,7 @@
         this.eventDialog = false;
         this.$emit('showEventDialog', this.eventCode);
       },
+
       showheatPlotting() {
         if (!this.$refs.supermapDialog1.isheatPlotting) {
           this.$refs.supermapDialog1.showheatPlotting(this.latitude, this.longitude)

+ 4 - 4
src/views/forest.vue

@@ -427,7 +427,7 @@
 
     <firespread ref="firespread" :calendarDay="calendarDay" @getEventList="getEventList"
                 @getTodayEvents="getTodayEvents" @showEventDialog="showEventDialog"
-                @getSupermap="getSupermap"></firespread>
+                @getSupermap="getSupermap" @showDialog="showDialog"></firespread>
     <eventLocation ref="eventLocation"></eventLocation>
     <TVWall ref="TVWall"></TVWall>
     <wrj ref="wrj"></wrj>
@@ -532,7 +532,6 @@ export default {
     return {
       //警报MP3文件
       audioSrc: require('@/assets/jingbao.mp3'),
-
       calendarDay: this.getCurrentDataStr(),
       //基本情况
       forestInfo: '', //基本情况
@@ -1255,6 +1254,7 @@ export default {
         this.$refs.bottomMenu.deptTreeselect()//查询林场部门树结构
       },
       showDialog(click) {
+        console.log(click)
         if (click == 'eventLocation') {
           this.$refs.eventLocation.showEventLocation()
           this.$refs.supermap.isEditableLayers = false
@@ -1285,7 +1285,8 @@ export default {
           this.$refs.bottomMenu.showChild = false
           this.$refs.bottomMenu.showBanChild = false
           this.$refs.bottomMenu.showChangChild = false
-        } else if (click == 'wrj') {
+        }
+        else if (click == 'wrj') {
           this.$refs.wrj.showWrj();
           this.$refs.supermap.isEditableLayers = false
           this.$refs.bottomMenu.showChild = false
@@ -1310,7 +1311,6 @@ export default {
             this.$refs.bottomMenu.showChangChild = false
           }
         }
-
       },
       //选择图层
       choseLayerSwitching(url, isClear) {