修改语音调度呼叫等功能

main
jinna 3 years ago
parent 7b5efe40b9
commit 98788557ea
  1. 2
      src/App.vue
  2. 92
      src/page/index/index.vue
  3. 17
      src/views/dispatch/index.vue

@ -56,7 +56,7 @@ export default {
methods: { methods: {
initWebSocket(supplierId) { initWebSocket(supplierId) {
// WebSocketwshttpwsshttps // WebSocketwshttpwsshttps
let wsUrl = `ws://192.168.3.32:81/websocket/${supplierId}`; let wsUrl = `ws://192.168.1.34:81/websocket/${supplierId}`;
// let wsUrl = `ws://171.16.8.51:81/websocket/${supplierId}`// // let wsUrl = `ws://171.16.8.51:81/websocket/${supplierId}`//
this.websocket = new WebSocket(wsUrl); this.websocket = new WebSocket(wsUrl);
this.websocket.onopen = this.websocketonopen; this.websocket.onopen = this.websocketonopen;

@ -6,6 +6,7 @@
<div class="avue-header"> <div class="avue-header">
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<top ref="top"/> <top ref="top"/>
<button @click="getAlarmInfo">点击按钮</button>
</div> </div>
<div class="avue-layout"> <div class="avue-layout">
<div class="avue-left"> <div class="avue-left">
@ -75,20 +76,19 @@
}, },
mounted() { mounted() {
this.init(); this.init();
this.getAlarmInfo()
if(!window.sessionStorage.getItem("click")){ if(!window.sessionStorage.getItem("click")){
this.$alert('请允许系统提示报警声音', '提示', { this.$alert('请允许系统提示报警声音', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
window.sessionStorage.setItem("click", 1) window.sessionStorage.setItem("click", 1)
// socket // socket
// window.addEventListener('onmessageWS', this.getSocketData); window.addEventListener('onmessageWS', this.getSocketData);
this.timer = setInterval(() =>{ // this.timer = setInterval(() =>{
this.getSocketData('222') // this.getSocketData('222')
},3000) // },3000)
setTimeout(() =>{ // setTimeout(() =>{
clearInterval(this.timer) // clearInterval(this.timer)
},6200) // },6200)
} }
}); });
}else{ }else{
@ -99,13 +99,13 @@
callback: action => { callback: action => {
window.sessionStorage.setItem("click", 1) window.sessionStorage.setItem("click", 1)
// socket // socket
// window.addEventListener('onmessageWS', this.getSocketData); window.addEventListener('onmessageWS', this.getSocketData);
this.timer = setInterval(() =>{ // this.timer = setInterval(() =>{
this.getSocketData('222') // this.getSocketData('222')
},3000) // },3000)
setTimeout(() =>{ // setTimeout(() =>{
clearInterval(this.timer) // clearInterval(this.timer)
},9200) // },9200)
} }
}); });
} }
@ -123,31 +123,7 @@
}) })
}, },
getSocketData(res) { getSocketData(res) {
this.times++; // this.times++;
let dom = document.querySelector('#play_audio')
console.log('dom ===>',dom)
dom.pause()
if(this.times > 0){
if(dom.readyState == 4){
for(let i = 0;i<=this.times;i++){
setTimeout(() =>{
this.start++;
this.isMuted = false,
this.isPlay = true
dom.play()
},2500 * i)
}
}
}
this.$notify({
title: '警告',
message: res,
type: 'warning'
})
// if (res.detail.data === 'success' || res.detail.data === '' || res.detail.data === 'heartBath') return
// // ...
// let obj = res.detail.data.indexOf('{') > -1 ? JSON.parse(res.detail.data) : null;
// this.times++;
// let dom = document.querySelector('#play_audio') // let dom = document.querySelector('#play_audio')
// console.log('dom ===>',dom) // console.log('dom ===>',dom)
// dom.pause() // dom.pause()
@ -163,13 +139,37 @@
// } // }
// } // }
// } // }
// if (obj) { // this.$notify({
// this.$notify({ // title: '',
// title: '', // message: res,
// message: obj.buildId + '' + obj.floorNo + '' + obj.content,
// type: 'warning' // type: 'warning'
// }); // })
// } if (res.detail.data === 'success' || res.detail.data === '连接成功' || res.detail.data === 'heartBath') return
// ...
let obj = res.detail.data.indexOf('{') > -1 ? JSON.parse(res.detail.data) : null;
this.times++;
let dom = document.querySelector('#play_audio')
console.log('dom ===>',dom)
dom.pause()
if(this.times > 0){
if(dom.readyState == 4){
for(let i = 0;i<=this.times;i++){
setTimeout(() =>{
this.start++;
this.isMuted = false,
this.isPlay = true
dom.play()
},2500 * i)
}
}
}
if (obj) {
this.$notify({
title: '警告',
message: obj.buildId + '号楼' + obj.floorNo + '层发生报警:' + obj.content,
type: 'warning'
});
}
}, },
showCollapse() { showCollapse() {
this.$store.commit("SET_COLLAPSE"); this.$store.commit("SET_COLLAPSE");

@ -49,14 +49,14 @@
></el-input> ></el-input>
</div> </div>
<div class="list_box" v-show="activeTit == 1" v-infinite-scroll="load" :infinite-scroll-disabled="isSroll"> <div class="list_box" v-show="activeTit == 1" v-infinite-scroll="load" :infinite-scroll-disabled="isSroll">
<div class="list_item" :class="activeDevice == item.id ? 'dev_act' : item.isSelect == 1 ? 'sele_devi' : !item.online ? 'sele_devi' : ''" <div class="list_item" :class="activeDevice == item.id ? 'dev_act' : item.isSelect == 1 ? 'sele_devi' : !item.online ? 'outline_devi' : ''"
v-for="item in deviceData" :key="item.id" @mouseenter="enterDevice(item)" @mouseleave="leaveDevice"> v-for="item in deviceData" :key="item.id" @mouseenter="enterDevice(item)" @mouseleave="leaveDevice">
<div class="left_bor" v-show="activeDevice == item.id"></div> <div class="left_bor" v-show="activeDevice == item.id"></div>
<div class="dev_img"> <div class="dev_img">
<img v-show="activeDevice !== item.id" src="~@/assets/image/device.png" alt=""> <img v-show="activeDevice !== item.id" src="~@/assets/image/device.png" alt="">
<img v-show="activeDevice == item.id" src="~@/assets/image/device_act.png" alt=""> <img v-show="activeDevice == item.id" src="~@/assets/image/device_act.png" alt="">
</div> </div>
<div class="device_name" :class="activeDevice == item.id ? 'act_dev_name' : ''">{{item.name}}</div> <div class="device_name" :class="activeDevice == item.id ? 'act_dev_name' : ''">{{item.name}}{{item.isSelect}}</div>
<div class="dev_btn_box"> <div class="dev_btn_box">
<div class="dev_btn" @click="inviteUser(item)" v-show="activeDevice == item.id && !isIntercom && item.online">邀请</div> <div class="dev_btn" @click="inviteUser(item)" v-show="activeDevice == item.id && !isIntercom && item.online">邀请</div>
<div class="dev_btn del_btn" v-show="activeDevice == item.id" @click="deleteUser(item)">删除</div> <div class="dev_btn del_btn" v-show="activeDevice == item.id" @click="deleteUser(item)">删除</div>
@ -736,7 +736,7 @@ export default {
// }); // });
// }) // })
console.log('isRegisted ====>',isRegisted()) // console.log('isRegisted ====>',isRegisted())
// let mediaControl = null; // let mediaControl = null;
var mediaControl; var mediaControl;
if (position == 1) { if (position == 1) {
@ -745,8 +745,9 @@ export default {
mediaControl = document.getElementById('video1'); mediaControl = document.getElementById('video1');
} }
console.log(this.callItem) console.log(this.callItem)
console.log('inviteList ===>',this.inviteList)
// this.$nextTick(() =>{ // this.$nextTick(() =>{
if(this.inviteList.length == 1){ // if(this.inviteList.length == 0){ //
console.log('进入循环') console.log('进入循环')
this.isMetting = false; this.isMetting = false;
mediaControl = video1; // mediaControl = video1; //
@ -757,7 +758,7 @@ export default {
this.inviteList.push(this.callItem); this.inviteList.push(this.callItem);
}).catch((reason) => { }).catch((reason) => {
console.log("call fail"); console.log("call fail ===>",this.deviceData);
console.log(JSON.stringify(reason)); console.log(JSON.stringify(reason));
this.$message.error('呼叫失败') this.$message.error('呼叫失败')
}); });
@ -852,7 +853,7 @@ export default {
// //
audioCall(){ audioCall(){
this.isIntercom = false; this.isIntercom = false;
this.callItem.isSelect = 1; // this.callItem.isSelect = 1;
this.dialogCall = false; this.dialogCall = false;
console.log('callItem ===>',this.callItem) console.log('callItem ===>',this.callItem)
this.makecall(false,1) this.makecall(false,1)
@ -1337,6 +1338,10 @@ export default {
opacity: 0.4; opacity: 0.4;
} }
&.outline_devi{
opacity: 0.4;
}
.left_bor{ .left_bor{
width: 0.03rem; width: 0.03rem;
height: 0.35rem; height: 0.35rem;

Loading…
Cancel
Save