|
@@ -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;
|
|
|
/** ----------------------------------大华摄像头预览开始------------------------------------- */
|