mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-29 07:00:57 +00:00
perf: 优化打开会议
This commit is contained in:
parent
c6c735bbe8
commit
1b0ec71d93
3
electron/electron-preload.js
vendored
3
electron/electron-preload.js
vendored
@ -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
21
electron/electron.js
vendored
@ -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, ?}
|
||||
|
||||
@ -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;
|
||||
|
||||
6
resources/assets/js/functions/eeui.js
vendored
6
resources/assets/js/functions/eeui.js
vendored
@ -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;
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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}}
|
||||
|
||||
@ -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>
|
||||
|
||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -224,6 +224,7 @@ export default {
|
||||
type: "",
|
||||
meetingid: 0
|
||||
},
|
||||
appMeetingShow: false,
|
||||
|
||||
// okr窗口
|
||||
okrWindow: {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user