mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-02 19:08:12 +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) {
|
sendMessage: function (action, args) {
|
||||||
ipcRenderer.send(action, args);
|
ipcRenderer.send(action, args);
|
||||||
},
|
},
|
||||||
|
sendAsync: function (action, args) {
|
||||||
|
return ipcRenderer.invoke(action, args)
|
||||||
|
},
|
||||||
listenOnce: function (action, callback) {
|
listenOnce: function (action, callback) {
|
||||||
ipcRenderer.once(action, function (event, args) {
|
ipcRenderer.once(action, function (event, args) {
|
||||||
callback(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"
|
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 已废弃)
|
* 创建路由窗口(todo 已废弃)
|
||||||
* @param args {path, ?}
|
* @param args {path, ?}
|
||||||
|
|||||||
@ -374,15 +374,15 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 会议事件
|
// 会议事件
|
||||||
window.__onMeetingEvent = ({act,uuid,meetingid}) => {
|
window.__onMeetingEvent = ({act, uuid, meetingid, status}) => {
|
||||||
switch (act) {
|
switch (act) {
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
case "getInfo":
|
case "getInfo":
|
||||||
const isTourist = (uuid+'').indexOf('88888') !== -1;
|
const isTourist = (uuid + '').indexOf('88888') !== -1;
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
url: isTourist ? 'users/meeting/tourist' : 'users/basic',
|
url: isTourist ? 'users/meeting/tourist' : 'users/basic',
|
||||||
data: {
|
data: {
|
||||||
userid: isTourist ? uuid : (uuid+'').substring(6),
|
userid: isTourist ? uuid : (uuid + '').substring(6),
|
||||||
tourist_id: uuid,
|
tourist_id: uuid,
|
||||||
}
|
}
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
@ -398,23 +398,27 @@ export default {
|
|||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
//加入成功
|
// 加入成功
|
||||||
case "success":
|
case "success":
|
||||||
this.$store.dispatch("closeMeetingWindow","add")
|
this.$store.dispatch("closeMeetingWindow", "add")
|
||||||
break;
|
break;
|
||||||
// 邀请
|
// 邀请
|
||||||
case "invent":
|
case "invent":
|
||||||
this.$store.dispatch("showMeetingWindow",{
|
this.$store.dispatch("showMeetingWindow", {
|
||||||
type: "invitation",
|
type: "invitation",
|
||||||
meetingid: meetingid
|
meetingid: meetingid
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
//结束会议
|
// 结束会议
|
||||||
case "endMeeting":
|
case "endMeeting":
|
||||||
break;
|
break;
|
||||||
//加入失败
|
// 加入失败
|
||||||
case "error":
|
case "error":
|
||||||
this.$store.dispatch("closeMeetingWindow","error")
|
this.$store.dispatch("closeMeetingWindow", "error")
|
||||||
|
break;
|
||||||
|
// 状态
|
||||||
|
case "status":
|
||||||
|
this.$store.state.appMeetingShow = status
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
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);
|
return $A.eeuiModuleSync("eeui").rewriteUrl(val);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取页面信息
|
||||||
|
eeuiAppGetPageInfo(pageName) {
|
||||||
|
if (!$A.isEEUiApp) return;
|
||||||
|
return $A.eeuiModuleSync("eeui").getPageInfo(pageName);
|
||||||
|
},
|
||||||
|
|
||||||
// 打开app新页面
|
// 打开app新页面
|
||||||
eeuiAppOpenPage(object, callback) {
|
eeuiAppOpenPage(object, callback) {
|
||||||
if (!$A.isEEUiApp) return;
|
if (!$A.isEEUiApp) return;
|
||||||
|
|||||||
@ -179,7 +179,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['meetingWindow', 'formOptions', 'userToken']),
|
...mapState(['meetingWindow', 'appMeetingShow', 'formOptions', 'userToken']),
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -300,11 +300,26 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onOpen(isDirect = false) {
|
async onOpen(isDirect = false) {
|
||||||
if (this.meetingShow) {
|
// 判断是否在会议中
|
||||||
|
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("正在会议中,无法进入其他会议室");
|
$A.modalWarning("正在会议中,无法进入其他会议室");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载动画
|
||||||
const loader = (add) => {
|
const loader = (add) => {
|
||||||
if (isDirect) {
|
if (isDirect) {
|
||||||
if (add) {
|
if (add) {
|
||||||
@ -320,6 +335,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加入会议
|
||||||
loader(true);
|
loader(true);
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
url: 'users/meeting/open',
|
url: 'users/meeting/open',
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="meeting-player">
|
<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">
|
<ETooltip :disabled="$isEEUiApp || windowTouch || !username">
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
{{username}}
|
{{username}}
|
||||||
|
|||||||
@ -1,16 +1,5 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<MeetingManager/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MeetingManager from "./manage/components/MeetingManager.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
MeetingManager,
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
const {meetingId, sharekey} = this.$route.params;
|
const {meetingId, sharekey} = this.$route.params;
|
||||||
const {nickname, avatar, audio, video, type} = this.$route.query;
|
const {nickname, avatar, audio, video, type} = this.$route.query;
|
||||||
@ -25,5 +14,8 @@ export default {
|
|||||||
meetingdisabled: true,
|
meetingdisabled: true,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
render() {
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -224,6 +224,7 @@ export default {
|
|||||||
type: "",
|
type: "",
|
||||||
meetingid: 0
|
meetingid: 0
|
||||||
},
|
},
|
||||||
|
appMeetingShow: false,
|
||||||
|
|
||||||
// okr窗口
|
// okr窗口
|
||||||
okrWindow: {
|
okrWindow: {
|
||||||
|
|||||||
@ -23,10 +23,21 @@ body {
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #e1e1e1;
|
> * {
|
||||||
background-size: 136%;
|
z-index: 1;
|
||||||
background-position: center;
|
}
|
||||||
background-repeat: no-repeat
|
.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 {
|
.player-state {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user