From d7862fcfdc6fe45c3114d0db4d3c4046f041e1d1 Mon Sep 17 00:00:00 2001 From: jinna Date: Fri, 20 Oct 2023 17:49:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E8=AE=B2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 +- src/page/index/index.vue | 27 +++++-- src/views/dispatch/index.vue | 146 +++++++++++++++++++++++------------ 3 files changed, 118 insertions(+), 59 deletions(-) diff --git a/src/App.vue b/src/App.vue index dd3e5e3..71d2bf8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -56,8 +56,8 @@ export default { methods: { initWebSocket(supplierId) { // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https - let wsUrl = `ws://192.168.1.34:81/websocket/${supplierId}`; - // let wsUrl = `ws://171.16.8.51: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; this.websocket.onerror = this.websocketonerror; diff --git a/src/page/index/index.vue b/src/page/index/index.vue index 5a794fe..9f3f5fb 100644 --- a/src/page/index/index.vue +++ b/src/page/index/index.vue @@ -6,7 +6,7 @@
- +
@@ -152,17 +152,28 @@ console.log('dom ===>',dom) dom.pause() if(this.times > 0){ + console.log(this.times) if(dom.readyState == 4){ - for(let i = 0;i<=this.times;i++){ - setTimeout(() =>{ - this.start++; - this.isMuted = false, + for(let i = 0;i<=this.times;i++){ + setTimeout(() =>{ + this.start++; + this.times--; + this.isMuted = false, + this.isPlay = true + dom.play() + },2500 * i) + } + + } + }else{ + if(dom.readyState == 4){ + this.isMuted = false, this.isPlay = true + this.start = 0 dom.play() - },2500 * i) + } + } - } - } if (obj) { this.$notify({ title: '警告', diff --git a/src/views/dispatch/index.vue b/src/views/dispatch/index.vue index f56272c..62b3402 100644 --- a/src/views/dispatch/index.vue +++ b/src/views/dispatch/index.vue @@ -56,7 +56,7 @@
-
{{item.name}}{{item.isSelect}}
+
{{item.name}}
邀请
删除
@@ -74,12 +74,12 @@ - {{ data.groupName }} + {{ data.groupName }} 邀请 @@ -609,11 +609,11 @@ export default { mylog("receiveConferenceInvite: "); _conf = para.conference; }); - setTimeout(() =>{ + // setTimeout(() =>{ if(!isRegisted()) { regist(); } - },2000) + // },2000) }, // 获取所有调度组 getGroupData(){ @@ -675,33 +675,8 @@ export default { // 邀请群组 inviteGroup(row){ console.log(row) - this.$confirm('确定要邀请该群组吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.isGroup = true; - row.children.map(item => { - this.selectTreeNode.push(item.id) - this.inviteList.push({ - id:item.id, - name:item.label - }) - }) - - this.$nextTick(() => { - let audio = document.getElementById('video') //获取媒体控件 - this.$refs.tree.setCheckedKeys(this.selectTreeNode); //把当前选择的key设置到el-tree中 - client.startIntercom(row.id, audio).then((conf) => { //发起群组对讲 - this._intercom = conf; - setListener(); - mylog("startintercom success"); - }).catch((error) => { - mylog("startIntercom fail: " + JSON.stringify(error)); - }) - }) - - }) + this.getGroupPeo(row) + }, @@ -836,15 +811,21 @@ export default { this.isIntercom = true; this.isMetting = false this.dialogCall = false; - this.callItem.isSelect = 1; - this.deviceData.find(item => item.id == this.callItem.id).isSelect = 1; - this.inviteList.push(this.callItem); - let audio = document.getElementById('video') //获取媒体控件 - client.startTempIntercom([this.callItem.id],audio,"").then((conf) => { //发起临时对讲 + + // let audio = document.getElementById('video') //获取媒体控件 + var members = [this.callItem.name] + var mediaControl = video1; + var name = '' + client.startTempIntercom(members,mediaControl,name).then((conf) => { //发起临时对讲 + console.log('发起对讲======================================================================>') + this.callItem.isSelect = 1; + this.deviceData.find(item => item.id == this.callItem.id).isSelect = 1; + this.inviteList.push(this.callItem); this._intercom = conf; setListener(); mylog("startintercom success:" + conf.groupNumber); }).catch((error)=>{ + this.$message.error('对讲失败') mylog("startIntercomfail:" + JSON.stringify(error)); }) }) @@ -860,10 +841,9 @@ export default { }, // 视频呼叫 videoCall(){ - this.callItem.isSelect = 1; + // this.callItem.isSelect = 1; this.isIntercom = false; - this.deviceData.find(item => item.id == this.callItem.id).isSelect = 1; - this.inviteList.push(this.callItem); + this.dialogCall = false; this.makecall(true,2) }, @@ -1128,27 +1108,90 @@ export default { // console.log('点击节点 ===>',data,node) // }, - loadNode(node,resolve){ - let arr = [] - console.log('node ===>',node) + getGroupPeo(data){ getGroupUser({ curPage:1, pageRows:100, - groupNum:node.data.groupNum, - groupName:node.data.groupName + groupNum:data.groupNum, + groupName:data.groupName }).then(res =>{ + let dataList = res.data.page.dataList getOnline().then(res1 =>{ + console.log('res1 ===>',res1) res1.data.Onlines.map(item1 =>{ - res.data.page.dataList.map(item =>{ + console.log('item1 ======>',item1) + dataList.map(item =>{ + item.online = false if(item1.employeeID == item.employeeID){ item.online = true } - arr.push({groupNum:item.id,groupName:item.name,online:item.online}) }) }) + let tmp = dataList.find(item => item.online) + console.log('tmp ==================>', tmp) + if(tmp){ + this.$confirm('确定要邀请该群组吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.isGroup = true; + // row.children.map(item => { + // this.selectTreeNode.push(item.id) + // this.inviteList.push({ + // id:item.id, + // name:item.label + // }) + // }) + + this.$nextTick(() => { + var groupNumber = data.groupNum; + var mediaControl = video1 + console.log('groupNumber===》',groupNumber,'media ===>',mediaControl) + // this.$refs.tree.setCheckedKeys(this.selectTreeNode); //把当前选择的key设置到el-tree中 + client.startIntercom(groupNumber,mediaControl).then((conf) => { //发起群组对讲 + this._intercom = conf; + setListener(); + mylog("startintercom success"); + }).catch((error) => { + mylog("startIntercom fail: " + JSON.stringify(error)); + }) + }) + + }) + }else{ + this.$message.error('该组下无在线人员,不可邀请') + } + }) + + + }) + }, + loadNode(node,resolve){ + let arr = [] + getOnline().then(res =>{ + let onlineData = res.data.Onlines + getGroupUser({ + curPage:1, + pageRows:100, + groupNum:node.data.groupNum, + groupName:node.data.groupName + }).then(res =>{ + let dataList = res.data.page.dataList + dataList.map(item =>{ + item.online = false + onlineData.map(item1 =>{ + if(item.employeeID == item1.employeeID){ + item.online = true + } + }) + }) + dataList.map(item =>{ + arr.push({groupNum:item.id,groupName:item.name,online:item.online}) + }) + arr.sort((a, b) => b.online-a.online) + return resolve(arr) }) - console.log('arr ===>',arr) - return resolve(arr) }) } }, @@ -1561,6 +1604,11 @@ export default { opacity: 0.4; } + /deep/ .outline{ + opacity: 0.4; + + } + /deep/ .el-tree-node__content:hover{ background: transparent; }