From eeb3ae6e1c480151139ecaf3ae6861fbff9150f4 Mon Sep 17 00:00:00 2001 From: gyj Date: Mon, 22 Apr 2024 10:23:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B1=E4=BA=AB=E5=B1=8F=E5=B9=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home.js | 8 +- src/views/components/roomFooter.vue | 4 +- src/views/room.vue | 190 ++++++++++++++++------------ vue.config.js | 2 +- 4 files changed, 114 insertions(+), 90 deletions(-) diff --git a/src/api/home.js b/src/api/home.js index e49c3024..c28c1976 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -32,17 +32,17 @@ export function reserveConferenceList(caseId) { } //根据id查询密文信息 export function getEncryptInfoByid(caseId) { - return axios.get(`${baseUrl}/shortMessage/getMeetingInfo?authId=${caseId}`); + return axios.get(`tiaojie/shortMessage/getMeetingInfo?authId=${caseId}`); } // 案件列表 export function caseApplicationList(param) { - return axios.get(`${baseUrl}/caseApplication/list?caseId=${param}`); + return axios.get(`tiaojie/caseApplication/list?caseId=${param}`); } // 签收案件 export function msCaseSign(data) { - return axios.post(`${baseUrl}/mssignSeal/msCaseSign`, data); + return axios.post(`tiaojie/mssignSeal/msCaseSign`, data); } //根据案件id获取附件 export function fileList(caseAppliId,annexTypeList) { - return axios.get(`${baseUrl}/common/fileList?caseAppliId=${caseAppliId}&annexTypeList=${annexTypeList}`); + return axios.get(`tiaojie/common/fileList?caseAppliId=${caseAppliId}&annexTypeList=${annexTypeList}`); } diff --git a/src/views/components/roomFooter.vue b/src/views/components/roomFooter.vue index 3879d236..70a09402 100644 --- a/src/views/components/roomFooter.vue +++ b/src/views/components/roomFooter.vue @@ -41,7 +41,7 @@ @click="videoClickOff" /> - + diff --git a/src/views/room.vue b/src/views/room.vue index 11dbaed5..3f512b57 100644 --- a/src/views/room.vue +++ b/src/views/room.vue @@ -7,7 +7,11 @@ >
-
+
@@ -47,7 +51,12 @@
{{ userId }}
-
+
{{ item }}
@@ -55,7 +64,8 @@
-
申请人上传证据 + 上传调解书 -
@@ -147,9 +156,21 @@
- - 确认修改内容 + + 确认修改内容
@@ -162,7 +183,7 @@ import { selectById, selectRoleMenuByCaseId, getMenuPermsByUser, - videoUpload + videoUpload, } from "@/api/room"; import { getWidth, getHeight, getWidthPhone, getModile } from "@/utils/utils"; import roomFooter from "./components/roomFooter.vue"; @@ -247,6 +268,9 @@ export default { }; }, methods: { + UploadUrl() { + return window.location.origin + "/tiaojie/video/upload"; + }, /**点击开启麦克风图标,关闭麦克风 */ micClickOn() { trtc.updateLocalAudio({ mute: true }).then(() => { @@ -288,24 +312,28 @@ export default { }); }, /**共享屏幕 */ - sharClickOn() { - this.sharFlag = false; - this.videoList = "videoList1"; - this.videoClass = "videoItem2"; - this.screenShareFlag = true; + async sharClickOn() { + // this.videoList = "videoList1"; + // this.videoClass = "videoItem2"; + // this.screenShareFlag = true; + await trtc.startScreenShare().then(() => { + this.sharFlag = false; + }); }, /**关闭共享屏幕 */ sharClickOff() { - this.sharFlag = true; - this.videoList = "videoList"; - this.screenShareFlag = false; - if (this.userList.length > 1) { - this.videoClass = "videoItem1"; - } else if (this.userList.length < 1) { - this.videoClass = "videoItem"; - } else if (this.userList.length == 1) { - this.videoClass = "videoItem3"; - } + trtc.stopScreenShare().then(() => { + this.sharFlag = true; + this.videoList = "videoList"; + this.screenShareFlag = false; + if (this.userList.length > 1) { + this.videoClass = "videoItem1"; + } else if (this.userList.length < 1) { + this.videoClass = "videoItem"; + } else if (this.userList.length == 1) { + this.videoClass = "videoItem3"; + } + }); }, /**获取当前用户操作权限 */ getMenuPermsByUserFn() { @@ -360,28 +388,6 @@ export default { this.$refs.upload3.clearFiles(); this.selectByIdFn(this.caseId); }, - upload3(param){ - const formData = new FormData() - formData.append('file', param.file); - formData.append('annexType', 7); - formData.append('officeFlag', 1); - formData.append('caseId', this.caseId); - videoUpload(formData).then(res=>{ - console.log('上传图片成功') - }) - // axios.post(url, formData).then(response => { - // //根据返回值进行判断是否上传成功 - // if(response.data.flag){ - // //上传成功 - // console.log('上传图片成功') - // }else{ - // //上传失败 - // console.log('图片上传失败') - // } - // }).catch(response => { - // console.log('异常处理') - // }) - }, preview(item, flag) { if (item.onlyOfficeFileId) { // this.$router.push({ @@ -389,20 +395,18 @@ export default { // query: { id: item.onlyOfficeFileId, flag: flag }, // }); let flag = 1; - if(this.editFlag){ - flag = 1 - }else{ - flag = 0 + if (this.editFlag) { + flag = 1; + } else { + flag = 0; } + let token = sessionStorage.getItem('token') window.open( - `http://121.40.189.20:8002/onlyoffice?id=${item.onlyOfficeFileId}&flag=${flag}`, + `http://121.40.189.20:8002/onlyoffice?id=${item.onlyOfficeFileId}&flag=${flag}&token=${token}`, "_black" ); } else { - window.open( - "http://121.40.189.20:6001" + item.annexPath, - "_black" - ); + window.open(window.location.origin + item.annexPath, "_black"); } }, // 点击提交修改后的内容 @@ -465,7 +469,7 @@ export default { } else if (item.annexType == 12) { this.resFile.push(item); } else if (item.annexType == 7) { - this.mediateFile.push(item) + this.mediateFile.push(item); } }); }); @@ -496,7 +500,17 @@ export default { trtc.on(TRTC.EVENT.REMOTE_VIDEO_AVAILABLE, (event) => { const userId = event.userId; const streamType = event.streamType; - this.userList.push(userId); + if (streamType == "main") { + this.userList.push(userId); + setTimeout(() => { + trtc.startRemoteVideo({ userId, streamType, view: `${userId}` }); + }); + } else if (streamType == "main") { + trtc.startRemoteVideo({ userId, streamType, view: "screenShare" }); + this.videoList = "videoList1"; + this.videoClass = "videoItem2"; + this.screenShareFlag = true; + } setTimeout(() => { let aoido = trtc.getAudioTrack(userId); this.asrList[this.userList[this.userList.length - 1]] = new ASR({ @@ -530,38 +544,48 @@ export default { `${res.result.voice_text_str}`; }; }, 2000); - setTimeout(() => { - trtc.startRemoteVideo({ userId, streamType, view: `${userId}` }); - }); - // }) }); }, // 删除退出会议人员列表 deletePushVideo() { trtc.on(TRTC.EVENT.REMOTE_VIDEO_UNAVAILABLE, (event) => { + const streamType = event.streamType; const userId = event.userId; - if (this.hostId == userId) { - alert("主持人已经解散会议"); - this.$router.push({ - name: "Home", + if (streamType == "main") { + if (this.hostId == userId) { + alert("主持人已经解散会议"); + this.$router.push({ + name: "Home", + }); + this.userList = []; + return; + } + let deleteIndex = this.userList.indexOf(userId); + this.userList = this.userList.filter((item) => item !== userId); + if (deleteIndex !== -1) { + this.userList.splice(deleteIndex, 1); + } + if (this.modileFlag) { + // this.userHeight = getHeight(this.userList); + } else { + this.userClassPhone = getWidthPhone(this.userList); + } + Object.keys(this.asrList).forEach((key) => { + this.asrList[userId].stop(); }); - this.userList = []; - return; + } else if (streamType == "sub") { + this.sharFlag = true; + this.videoList = "videoList"; + this.screenShareFlag = false; + if (this.userList.length > 1) { + this.videoClass = "videoItem1"; + } else if (this.userList.length < 1) { + this.videoClass = "videoItem"; + } else if (this.userList.length == 1) { + this.videoClass = "videoItem3"; + } } - let deleteIndex = this.userList.indexOf(userId); - this.userList = this.userList.filter((item) => item !== userId); - if (deleteIndex !== -1) { - this.userList.splice(deleteIndex, 1); - } - if (this.modileFlag) { - // this.userHeight = getHeight(this.userList); - } else { - this.userClassPhone = getWidthPhone(this.userList); - } - Object.keys(this.asrList).forEach((key) => { - this.asrList[userId].stop(); - }); }); }, // 根据caseId查询房间相关信息 diff --git a/vue.config.js b/vue.config.js index 77dfd549..f9995dc2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -8,7 +8,7 @@ module.exports = defineConfig({ changeOrigin: true, // 是否改变Origin头信息 secure : false, pathRewrite: { - '^/api': '' // 将/api前缀重写为空字符串 + '^/tiaojie': '' // 将/api前缀重写为空字符串 }, }, '/zhongcai': {