修改语音调度呼叫等功能

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: {
initWebSocket(supplierId) {
// 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}`//
this.websocket = new WebSocket(wsUrl);
this.websocket.onopen = this.websocketonopen;

@ -6,6 +6,7 @@
<div class="avue-header">
<!-- 顶部导航栏 -->
<top ref="top"/>
<button @click="getAlarmInfo">点击按钮</button>
</div>
<div class="avue-layout">
<div class="avue-left">
@ -75,20 +76,19 @@
},
mounted() {
this.init();
this.getAlarmInfo()
if(!window.sessionStorage.getItem("click")){
this.$alert('请允许系统提示报警声音', '提示', {
confirmButtonText: '确定',
callback: action => {
window.sessionStorage.setItem("click", 1)
// socket
// window.addEventListener('onmessageWS', this.getSocketData);
this.timer = setInterval(() =>{
this.getSocketData('222')
},3000)
setTimeout(() =>{
clearInterval(this.timer)
},6200)
window.addEventListener('onmessageWS', this.getSocketData);
// this.timer = setInterval(() =>{
// this.getSocketData('222')
// },3000)
// setTimeout(() =>{
// clearInterval(this.timer)
// },6200)
}
});
}else{
@ -99,13 +99,13 @@
callback: action => {
window.sessionStorage.setItem("click", 1)
// socket
// window.addEventListener('onmessageWS', this.getSocketData);
this.timer = setInterval(() =>{
this.getSocketData('222')
},3000)
setTimeout(() =>{
clearInterval(this.timer)
},9200)
window.addEventListener('onmessageWS', this.getSocketData);
// this.timer = setInterval(() =>{
// this.getSocketData('222')
// },3000)
// setTimeout(() =>{
// clearInterval(this.timer)
// },9200)
}
});
}
@ -123,31 +123,7 @@
})
},
getSocketData(res) {
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++;
// this.times++;
// let dom = document.querySelector('#play_audio')
// console.log('dom ===>',dom)
// dom.pause()
@ -163,13 +139,37 @@
// }
// }
// }
// if (obj) {
// this.$notify({
// title: '',
// message: obj.buildId + '' + obj.floorNo + '' + obj.content,
// 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')
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() {
this.$store.commit("SET_COLLAPSE");

@ -49,14 +49,14 @@
></el-input>
</div>
<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">
<div class="left_bor" v-show="activeDevice == item.id"></div>
<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_act.png" alt="">
</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" @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>
@ -736,7 +736,7 @@ export default {
// });
// })
console.log('isRegisted ====>',isRegisted())
// console.log('isRegisted ====>',isRegisted())
// let mediaControl = null;
var mediaControl;
if (position == 1) {
@ -745,8 +745,9 @@ export default {
mediaControl = document.getElementById('video1');
}
console.log(this.callItem)
console.log('inviteList ===>',this.inviteList)
// this.$nextTick(() =>{
if(this.inviteList.length == 1){ //
if(this.inviteList.length == 0){ //
console.log('进入循环')
this.isMetting = false;
mediaControl = video1; //
@ -757,7 +758,7 @@ export default {
this.inviteList.push(this.callItem);
}).catch((reason) => {
console.log("call fail");
console.log("call fail ===>",this.deviceData);
console.log(JSON.stringify(reason));
this.$message.error('呼叫失败')
});
@ -852,7 +853,7 @@ export default {
//
audioCall(){
this.isIntercom = false;
this.callItem.isSelect = 1;
// this.callItem.isSelect = 1;
this.dialogCall = false;
console.log('callItem ===>',this.callItem)
this.makecall(false,1)
@ -1337,6 +1338,10 @@ export default {
opacity: 0.4;
}
&.outline_devi{
opacity: 0.4;
}
.left_bor{
width: 0.03rem;
height: 0.35rem;

Loading…
Cancel
Save