@@ -47,7 +51,12 @@
-
@@ -55,7 +64,8 @@
-
- 确认修改内容
+
+ 确认修改内容
@@ -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': {