perf: 优化打开会议

This commit is contained in:
kuaifan 2024-11-10 11:51:44 +08:00
parent c6c735bbe8
commit 1b0ec71d93
9 changed files with 85 additions and 28 deletions

View File

@ -51,6 +51,9 @@ contextBridge.exposeInMainWorld(
sendMessage: function (action, args) {
ipcRenderer.send(action, args);
},
sendAsync: function (action, args) {
return ipcRenderer.invoke(action, args)
},
listenOnce: function (action, callback) {
ipcRenderer.once(action, function (event, args) {
callback(args);

21
electron/electron.js vendored
View File

@ -705,6 +705,27 @@ ipcMain.on('updateChildWindow', (event, args) => {
event.returnValue = "ok"
})
/**
* 获取路由窗口信息
*/
ipcMain.handle('getChildWindow', (event, args) => {
let child;
if (!args) {
const browser = BrowserWindow.fromWebContents(event.sender);
child = childWindow.find(({browser: win}) => win === browser)
} else {
child = childWindow.find(({name}) => name === args)
}
if (child) {
return {
name: child.name,
id: child.browser.webContents.id,
url: child.browser.webContents.getURL()
}
}
return null;
});
/**
* 创建路由窗口todo 已废弃
* @param args {path, ?}

View File

@ -374,15 +374,15 @@ export default {
})
}
//
window.__onMeetingEvent = ({act,uuid,meetingid}) => {
window.__onMeetingEvent = ({act, uuid, meetingid, status}) => {
switch (act) {
//
case "getInfo":
const isTourist = (uuid+'').indexOf('88888') !== -1;
const isTourist = (uuid + '').indexOf('88888') !== -1;
this.$store.dispatch("call", {
url: isTourist ? 'users/meeting/tourist' : 'users/basic',
data: {
userid: isTourist ? uuid : (uuid+'').substring(6),
userid: isTourist ? uuid : (uuid + '').substring(6),
tourist_id: uuid,
}
}).then(({data}) => {
@ -398,23 +398,27 @@ export default {
$A.modalError(msg);
});
break;
//
//
case "success":
this.$store.dispatch("closeMeetingWindow","add")
this.$store.dispatch("closeMeetingWindow", "add")
break;
//
case "invent":
this.$store.dispatch("showMeetingWindow",{
this.$store.dispatch("showMeetingWindow", {
type: "invitation",
meetingid: meetingid
})
break;
//
//
case "endMeeting":
break;
//
//
case "error":
this.$store.dispatch("closeMeetingWindow","error")
this.$store.dispatch("closeMeetingWindow", "error")
break;
//
case "status":
this.$store.state.appMeetingShow = status
break;
default:
break;

View File

@ -68,6 +68,12 @@
return $A.eeuiModuleSync("eeui").rewriteUrl(val);
},
// 获取页面信息
eeuiAppGetPageInfo(pageName) {
if (!$A.isEEUiApp) return;
return $A.eeuiModuleSync("eeui").getPageInfo(pageName);
},
// 打开app新页面
eeuiAppOpenPage(object, callback) {
if (!$A.isEEUiApp) return;

View File

@ -179,7 +179,7 @@ export default {
},
computed: {
...mapState(['meetingWindow', 'formOptions', 'userToken']),
...mapState(['meetingWindow', 'appMeetingShow', 'formOptions', 'userToken']),
},
mounted() {
@ -300,11 +300,26 @@ export default {
});
},
onOpen(isDirect = false) {
if (this.meetingShow) {
async onOpen(isDirect = false) {
//
let isMeeting = false;
if ($A.isEEUiApp) {
isMeeting = this.appMeetingShow;
} else if ($A.Electron) {
const meetingWindow = await $A.Electron.sendAsync("getChildWindow", 'meeting-window')
if (meetingWindow) {
const currentWindow = await $A.Electron.sendAsync("getChildWindow", null)
isMeeting = currentWindow?.id !== meetingWindow.id;
}
} else {
isMeeting = this.meetingShow;
}
if (isMeeting) {
$A.modalWarning("正在会议中,无法进入其他会议室");
return;
}
//
const loader = (add) => {
if (isDirect) {
if (add) {
@ -320,6 +335,8 @@ export default {
}
}
}
//
loader(true);
this.$store.dispatch("call", {
url: 'users/meeting/open',

View File

@ -1,6 +1,8 @@
<template>
<div class="meeting-player">
<div :id="id" class="player" :style="playerStyle"></div>
<div :id="id" class="player">
<div class="player-bg" :style="playerStyle"></div>
</div>
<ETooltip :disabled="$isEEUiApp || windowTouch || !username">
<div slot="content">
{{username}}

View File

@ -1,16 +1,5 @@
<template>
<div>
<MeetingManager/>
</div>
</template>
<script>
import MeetingManager from "./manage/components/MeetingManager.vue";
export default {
components: {
MeetingManager,
},
mounted() {
const {meetingId, sharekey} = this.$route.params;
const {nickname, avatar, audio, video, type} = this.$route.query;
@ -25,5 +14,8 @@ export default {
meetingdisabled: true,
})
},
render() {
return null
}
}
</script>

View File

@ -224,6 +224,7 @@ export default {
type: "",
meetingid: 0
},
appMeetingShow: false,
// okr窗口
okrWindow: {

View File

@ -23,10 +23,21 @@ body {
position: relative;
z-index: 1;
overflow: hidden;
background-color: #e1e1e1;
background-size: 136%;
background-position: center;
background-repeat: no-repeat
> * {
z-index: 1;
}
.player-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #e1e1e1;
background-size: 136%;
background-position: center;
background-repeat: no-repeat;
z-index: 0;
}
}
.player-state {
position: absolute;