From 5a54e639a28ec3ccddd5883f0f505e1afce59475 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 11 Oct 2024 17:48:12 +0800 Subject: [PATCH 01/95] =?UTF-8?q?=E5=85=B1=E4=BA=AB=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81(=E6=9C=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BD=BF=E7=94=A8=E4=BB=A3=E7=A0=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 33 ++++++-- preload.js | 4 + src/page/Meeting/index.tsx | 59 ++++++++++++- src/page/ShareScreenWindow/index.module.scss | 2 +- src/page/ShareScreenWindow/index.tsx | 88 ++++++++++++++++---- src/render.d.ts | 1 + 6 files changed, 159 insertions(+), 28 deletions(-) diff --git a/main.js b/main.js index db2a312..a416b71 100644 --- a/main.js +++ b/main.js @@ -322,17 +322,19 @@ app.on('ready', () => { child.loadURL(config.url) childWindow[config.key] = child child.once('ready-to-show', () => { - child.show() - if (config.key === 'shareScreenWindow') { - const display = screen.getDisplayMatching({ ...child.getBounds() }); - const x = Math.round((display.workArea.width - child.getSize()[0]) / 2); - child.setPosition(x, 0); - child.setResizable(false) - child.setMovable(false) - mainWindow.setPosition(-999999, -999999); - } + childWindow[config.key].show() + windowOperation(config) }) }); + // 隐藏窗口 + ipcMain.handle('closeChildWindow', (event, key) => { + childWindow[key].close() + childWindow[key] = "" + const display = screen.getDisplayMatching({ ...mainWindow.getBounds() }); + const x = Math.round((display.workArea.width - mainWindow.getSize()[0]) / 2); + const y = Math.round((display.workArea.height - mainWindow.getSize()[1]) / 2); + mainWindow.setPosition(x, y); + }); } }); // 检测更新,在你想要检查更新的时候执行,renderer事件触发后的操作自行编写 @@ -401,3 +403,16 @@ function cancleDownloadUpdate() { function quitAndInstall() { autoUpdater.quitAndInstall(); } + +function windowOperation(config) { + const child = childWindow[config.key]; + if (config.key === 'shareScreenWindow') { + const display = screen.getDisplayMatching({ ...child.getBounds() }); + const x = Math.round((display.workArea.width - child.getSize()[0]) / 2); + child.setPosition(x, 0); + child.setResizable(false) + child.setMovable(false) + mainWindow.setPosition(-999999, -999999); + child.webContents.openDevTools() + } +} \ No newline at end of file diff --git a/preload.js b/preload.js index adecf8a..1914a17 100644 --- a/preload.js +++ b/preload.js @@ -77,4 +77,8 @@ window.electron = { createChildWindow: (config) => { ipcRenderer.invoke('createChildWindow', config) }, + // 关闭子窗口 + closeChildWindow: (key) => { + ipcRenderer.invoke('closeChildWindow', key) + }, } diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 9fa9617..27bf3b7 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -184,6 +184,7 @@ const Meeting: React.FC = () => { const [observer, setObserver] = useState() let userInfo = JSON.parse(storage.getItem('user') as string) const msgTips = '您不是管理员或发言人,无法开启此功能!' + const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { let time: NodeJS.Timeout; // let getDesktopCapturerVideoTime: NodeJS.Timeout; @@ -199,8 +200,43 @@ const Meeting: React.FC = () => { window.addEventListener('customStorageChange', handleCustomStorageChange); const container = document.getElementById('videoView') as HTMLElement; container.addEventListener('wheel', handleWheelChange); + channel.onmessage = async function (event) { + const { type, footerListsTitle } = event.data; + switch (type) { + case 'closeShareScreen': + await stopScreenCapture() + await allUserLook(userInfo.uid, userInfo.userName) + break; + case 'footerListsTitle': + switch (footerListsTitle) { + case '静音': + case '解除静音': + changeStatusList({ + title: footerListsTitle + }, 0, 1) + break; + case '关闭视频': + case '开启视频': + changeStatusList({ + title: footerListsTitle + }, 0, 2) + break; + case '录制': + case '录制中': + changeStatusList({ + title: footerListsTitle + }, 1, 3) + break; + } + break; + } + } time = setInterval(() => { setCurrentSeconds(currentSeconds++) + channel.postMessage({ + type: 'time', + time: changeCurrentSeconds(), + }); }, 1000) // getDesktopCapturerVideoTime = setInterval(() => { // setSharedScreenItem((i: any) => { @@ -639,6 +675,14 @@ const Meeting: React.FC = () => { observerObject.observe(element); }); } + channel.postMessage({ + type: 'roomUserList', + roomUserList, + }); + channel.postMessage({ + type: 'footerList', + footerList, + }); return () => { elements.forEach(element => { observer?.unobserve(element); @@ -1075,12 +1119,12 @@ const Meeting: React.FC = () => { await allUserLook(userInfo.uid, userInfo.userName) break; case '静音': - await postOpenMicr(false, user.uid) + await postOpenMicr(false, userInfo.uid) break; case '解除静音': await getUserRoomInfo().then(async (res) => { if (res) { - await postOpenMicr(true, user.uid) + await postOpenMicr(true, userInfo.uid) } else { if (!isClicked) { setCurrentRequestSpeakType('audio') @@ -1092,12 +1136,12 @@ const Meeting: React.FC = () => { }) break; case '关闭视频': - await postOpenCamera(false, user.uid) + await postOpenCamera(false, userInfo.uid) break; case '开启视频': await getUserRoomInfo().then(async (res) => { if (res) { - await postOpenCamera(true, user.uid) + await postOpenCamera(true, userInfo.uid) } else { if (!isClicked) { setCurrentRequestSpeakType('video') @@ -1259,6 +1303,12 @@ const Meeting: React.FC = () => { setIsSharedScreenModal(false) await agora.setDesktopCapturerVideo(sharedScreenItem, isComputerAudio, isFluencyPriority) await allUserLook(user.screenShareId, user.userName) + // window.electron.createChildWindow({ + // url: location.origin + `/#/shareScreenWindow`, + // width: 540, + // height: 70, + // key: 'shareScreenWindow', + // }) } else { message.error('请选择应用!') } @@ -1301,6 +1351,7 @@ const Meeting: React.FC = () => { agora.stopScreenCapture() footerListTemplate[1][0].title = '共享屏幕' setFooterList(footerListTemplate) + window.electron.closeChildWindow('shareScreenWindow') } // 获取房间用户 const getRoomUser = async (): Promise => { diff --git a/src/page/ShareScreenWindow/index.module.scss b/src/page/ShareScreenWindow/index.module.scss index 9859102..d1f0f36 100644 --- a/src/page/ShareScreenWindow/index.module.scss +++ b/src/page/ShareScreenWindow/index.module.scss @@ -24,13 +24,13 @@ display: flex; flex-grow: 1; justify-content: space-between; - padding: 0 20px; >div { display: flex; flex-direction: column; align-items: center; cursor: pointer; + width: calc(100% / 6); >img { height: 24px; diff --git a/src/page/ShareScreenWindow/index.tsx b/src/page/ShareScreenWindow/index.tsx index 0d122bf..361ec9a 100644 --- a/src/page/ShareScreenWindow/index.tsx +++ b/src/page/ShareScreenWindow/index.tsx @@ -1,15 +1,12 @@ +import { GetRoomUser, GetRoomUserItem } from '@/api/Meeting'; +import { role } from '@/config/role'; import styles from '@/page/ShareScreenWindow/index.module.scss' +import { storage } from '@/utils'; import ImageUrl from '@/utils/package/imageUrl'; import { Button } from 'antd'; import { useEffect, useState } from "react"; -// window.electron.createChildWindow({ -// url: location.origin + `/#/shareScreenWindow`, -// width: 500, -// height: 70, -// key: 'shareScreenWindow', -// }) const ShareScreenWindow: React.FC = () => { - const [footerList, setFooterList] = useState([ + const [footerLists, setFooterLists] = useState([ { title: '静音', icon: ImageUrl.icon22, @@ -54,33 +51,96 @@ const ShareScreenWindow: React.FC = () => { select: false, }, ]) + const [time, setTime] = useState('') + const [roomUserLists, setRoomUserLists] = useState([]) + const channel = new BroadcastChannel('meeting_channel'); + let userInfo = JSON.parse(storage.getItem('user') as string) useEffect(() => { - + getRoomUser() + channel.onmessage = function (event) { + const { type, time, roomUserList, footerList } = event.data; + const footerListTemplate = [...footerLists]; + switch (type) { + case 'time': + setTime(time) + break; + case 'roomUserList': + setRoomUserLists(roomUserList) + break; + case 'footerList': + footerListTemplate[0].title = footerList[0][0].active ? '解除静音' : '静音'; + footerListTemplate[0].active = footerList[0][0].active; + footerListTemplate[1].title = footerList[0][1].active ? '开启视频' : '关闭视频'; + footerListTemplate[1].active = footerList[0][1].active; + footerListTemplate[5].title = footerList[1][3].active ? '录制中' : '录制'; + footerListTemplate[5].active = footerList[1][3].active; + setFooterLists(footerListTemplate) + break; + } + } }, []); + // 获取房间用户 + const getRoomUser = async (): Promise => { + const data = JSON.parse(storage.getItem('stateInfo') as string) + await GetRoomUserItem(data.channelId, userInfo.uid).then((res: any) => { + if (res.code === 200) { + const footerListTemplate = [...footerLists]; + footerListTemplate[0].title = !res.data.enableMicr ? '解除静音' : '静音'; + footerListTemplate[0].active = !res.data.enableMicr; + footerListTemplate[1].title = !res.data.enableCamera ? '开启视频' : '关闭视频'; + footerListTemplate[1].active = !res.data.enableCamera; + setFooterLists(footerListTemplate) + GetRoomUser(data.channelId).then(res => { + if (res.code === 200) { + res.data.forEach((item: any) => { + item.isShow = true; + item.isRoom = true; + item.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager + }) + setRoomUserLists(res.data) + } + }) + } + }) + } return ( <>
-
02:38 共享中
+
{time} 共享中
- {footerList.map((item: any, index: number) => { + {footerLists.map((item: any, index: number) => { return (
{ - console.log(item, index) + switch (item.title) { + case '静音': + case '解除静音': + case '关闭视频': + case '开启视频': + case '录制': + case '录制中': + channel.postMessage({ + type: 'footerListsTitle', + footerListsTitle: item.title + }); + break; + } }} key={index}> {item.select ? : } - {item.title} + {item.title}{item.title === '成员列表' ? `(${roomUserLists.filter((item: any) => item.isRoom).length})` : ''}
) })}
diff --git a/src/render.d.ts b/src/render.d.ts index 2a0cc6d..cf22a14 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -19,6 +19,7 @@ export interface IElectronAPI { setRegistry: (uuid: string) => any; getRegistry: () => any; createChildWindow: (config: any) => void; + closeChildWindow: (key: string) => void; } declare global { From e89d820797693304282bbd6a8de3946815d2e0d6 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 11 Oct 2024 17:50:58 +0800 Subject: [PATCH 02/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index a416b71..2c29a81 100644 --- a/main.js +++ b/main.js @@ -413,6 +413,8 @@ function windowOperation(config) { child.setResizable(false) child.setMovable(false) mainWindow.setPosition(-999999, -999999); - child.webContents.openDevTools() + if (env === 'development') { + child.webContents.openDevTools() + } } } \ No newline at end of file From 49d73bedce70f13365f0059381cbb9a60ce4d6ed Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Sat, 12 Oct 2024 09:56:12 +0800 Subject: [PATCH 03/95] =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 33 +++++++++++++++++++--------- preload.js | 8 +++++++ src/components/StupWizard/index.tsx | 4 ++++ src/page/Meeting/index.tsx | 5 +++++ src/page/ShareScreenWindow/index.tsx | 5 +++++ src/render.d.ts | 2 ++ 6 files changed, 47 insertions(+), 10 deletions(-) diff --git a/main.js b/main.js index 2c29a81..57a68f6 100644 --- a/main.js +++ b/main.js @@ -273,10 +273,7 @@ app.on('ready', () => { // 设置窗口尺寸 mainWindow.setSize(config.width, config.height) // 设置窗口位置使其居中于当前屏幕 - const display = screen.getDisplayMatching({ ...mainWindow.getBounds() }); - const x = Math.round((display.workArea.width - mainWindow.getSize()[0]) / 2); - const y = Math.round((display.workArea.height - mainWindow.getSize()[1]) / 2); - mainWindow.setPosition(x, y); + mainWindowCenter() }); // 写入注册表 ipcMain.handle('setRegistry', (event, uuid) => { @@ -326,14 +323,19 @@ app.on('ready', () => { windowOperation(config) }) }); - // 隐藏窗口 + // 关闭子窗口 ipcMain.handle('closeChildWindow', (event, key) => { childWindow[key].close() childWindow[key] = "" - const display = screen.getDisplayMatching({ ...mainWindow.getBounds() }); - const x = Math.round((display.workArea.width - mainWindow.getSize()[0]) / 2); - const y = Math.round((display.workArea.height - mainWindow.getSize()[1]) / 2); - mainWindow.setPosition(x, y); + mainWindowCenter() + }); + // 隐藏主窗口 + ipcMain.handle('mainWindowHide', () => { + mainWindowHide() + }); + // 居中主窗口 + ipcMain.handle('mainWindowCenter', () => { + mainWindowCenter() }); } }); @@ -412,9 +414,20 @@ function windowOperation(config) { child.setPosition(x, 0); child.setResizable(false) child.setMovable(false) - mainWindow.setPosition(-999999, -999999); + mainWindowHide() if (env === 'development') { child.webContents.openDevTools() } } +} +// 主窗口居中 +function mainWindowCenter() { + const display = screen.getDisplayMatching({ ...mainWindow.getBounds() }); + const x = Math.round((display.workArea.width - mainWindow.getSize()[0]) / 2); + const y = Math.round((display.workArea.height - mainWindow.getSize()[1]) / 2); + mainWindow.setPosition(x, y); +} +// 主窗口隐藏 +function mainWindowHide() { + mainWindow.setPosition(-999999, -999999); } \ No newline at end of file diff --git a/preload.js b/preload.js index 1914a17..73210bf 100644 --- a/preload.js +++ b/preload.js @@ -81,4 +81,12 @@ window.electron = { closeChildWindow: (key) => { ipcRenderer.invoke('closeChildWindow', key) }, + // 隐藏主窗口 + mainWindowHide: () => { + ipcRenderer.invoke('mainWindowHide') + }, + // 居中主窗口 + mainWindowCenter: () => { + ipcRenderer.invoke('mainWindowCenter') + }, } diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 610a1c7..2eb9138 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -99,6 +99,10 @@ const StupWizard = forwardRef((props: any, ref: any) => { if (location.hash.indexOf('/meeting') === -1) { agora.release() } + if (storage.getItem('isOpenChildWindow') === 'true') { + window.electron.mainWindowHide() + storage.setItem('isOpenChildWindow', false) + } setIsStupWizard(false) }} /> diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 6f49fea..06a65c7 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -207,6 +207,10 @@ const Meeting: React.FC = () => { await stopScreenCapture() await allUserLook(userInfo.uid, userInfo.userName) break; + case 'setting': + stupWizardRef.current.changeModal(3); + window.electron.mainWindowCenter() + break; case 'footerListsTitle': switch (footerListsTitle) { case '静音': @@ -1309,6 +1313,7 @@ const Meeting: React.FC = () => { // height: 70, // key: 'shareScreenWindow', // }) + // storage.setItem('isOpenChildWindow', true) } else { message.error('请选择应用!') } diff --git a/src/page/ShareScreenWindow/index.tsx b/src/page/ShareScreenWindow/index.tsx index 361ec9a..af5f59a 100644 --- a/src/page/ShareScreenWindow/index.tsx +++ b/src/page/ShareScreenWindow/index.tsx @@ -126,6 +126,11 @@ const ShareScreenWindow: React.FC = () => { footerListsTitle: item.title }); break; + case '设置': + channel.postMessage({ + type: 'setting' + }); + break; } }} key={index}> diff --git a/src/render.d.ts b/src/render.d.ts index cf22a14..333ce68 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -20,6 +20,8 @@ export interface IElectronAPI { getRegistry: () => any; createChildWindow: (config: any) => void; closeChildWindow: (key: string) => void; + mainWindowCenter: () => any; + mainWindowHide: () => any; } declare global { From ad07bd753fe592315dd94ba2b2b8eaac9ae6a3aa Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Sat, 12 Oct 2024 16:17:06 +0800 Subject: [PATCH 04/95] =?UTF-8?q?=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 22 +- src/App.tsx | 10 +- src/components/EquipmentManagement/index.tsx | 14 +- src/components/StupWizard/index.tsx | 7 +- .../ShareScreenWindow/index.module.scss | 0 .../{ => Meeting}/ShareScreenWindow/index.tsx | 33 ++- .../Meeting/UserListWindow/index.module.scss | 120 ++++++++++ src/page/Meeting/UserListWindow/index.tsx | 210 ++++++++++++++++++ src/page/Meeting/index.tsx | 76 +++++-- src/utils/package/public.ts | 15 ++ 10 files changed, 465 insertions(+), 42 deletions(-) rename src/page/{ => Meeting}/ShareScreenWindow/index.module.scss (100%) rename src/page/{ => Meeting}/ShareScreenWindow/index.tsx (80%) create mode 100644 src/page/Meeting/UserListWindow/index.module.scss create mode 100644 src/page/Meeting/UserListWindow/index.tsx create mode 100644 src/utils/package/public.ts diff --git a/main.js b/main.js index 57a68f6..0eea96e 100644 --- a/main.js +++ b/main.js @@ -325,9 +325,18 @@ app.on('ready', () => { }); // 关闭子窗口 ipcMain.handle('closeChildWindow', (event, key) => { - childWindow[key].close() - childWindow[key] = "" - mainWindowCenter() + if (key === 'shareScreenWindow') { + for (const k in childWindow) { + if (childWindow[k]){ + childWindow[k].close() + childWindow[k] = "" + } + } + mainWindowCenter() + } else { + childWindow[key].close() + childWindow[key] = "" + } }); // 隐藏主窗口 ipcMain.handle('mainWindowHide', () => { @@ -408,16 +417,13 @@ function quitAndInstall() { function windowOperation(config) { const child = childWindow[config.key]; + child.setResizable(false) + if (env === 'development') child.webContents.openDevTools(); if (config.key === 'shareScreenWindow') { const display = screen.getDisplayMatching({ ...child.getBounds() }); const x = Math.round((display.workArea.width - child.getSize()[0]) / 2); child.setPosition(x, 0); - child.setResizable(false) - child.setMovable(false) mainWindowHide() - if (env === 'development') { - child.webContents.openDevTools() - } } } // 主窗口居中 diff --git a/src/App.tsx b/src/App.tsx index c6d6195..8cdedbe 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,7 +18,8 @@ import { agora } from "@/utils/package/agora"; import QuitTips from "@/components/QuitTips"; import { GetLeave } from "@/api/Meeting"; import path from "path"; -import ShareScreenWindow from "./page/ShareScreenWindow"; +import ShareScreenWindow from "@/page/Meeting/ShareScreenWindow"; +import UserListWindow from "@/page/Meeting/UserListWindow"; const fs = require('fs').promises; const { exec } = require('child_process'); const App: React.FC = () => { @@ -33,7 +34,8 @@ const App: React.FC = () => { }); const [spinning, setSpinning] = useState(false); const [isState, setIsState] = useState(true); - if (location.hash.indexOf('shareScreenWindow') == -1) { + const urlHashArr = ['#/userListWindow', '#/shareScreenWindow'] + if (urlHashArr.indexOf(location.hash) == -1) { useEffect(() => { let userInfo = JSON.parse(storage.getItem('user') as string) let loginInfo = JSON.parse(storage.getItem('login') as string) @@ -122,6 +124,9 @@ const App: React.FC = () => { aINoiseReduction: 1, // 降噪模式 })) } + if (!storage.getItem('openChildWindow')) { + storage.setItem('openChildWindow', JSON.stringify({})) + } }, []) useEffect(() => { if (isState) { @@ -243,6 +248,7 @@ const App: React.FC = () => { } /> } /> } /> + } /> } /> diff --git a/src/components/EquipmentManagement/index.tsx b/src/components/EquipmentManagement/index.tsx index cf20fb2..d9f01f9 100644 --- a/src/components/EquipmentManagement/index.tsx +++ b/src/components/EquipmentManagement/index.tsx @@ -1,4 +1,5 @@ import styles from '@/components/EquipmentManagement/index.module.scss' +import { getKeyOpenChildWindow } from '@/utils/package/public'; import { onInvoke } from '@/utils/package/signalr'; import { Button, Modal, Select, Slider, message } from 'antd'; import { useState, useImperativeHandle, forwardRef } from "react"; @@ -21,6 +22,13 @@ const EquipmentManagement = forwardRef((_props: any, ref: any) => { const [callerUid, setCallerUid] = useState('') const [deviceInfo, setDeviceInfo] = useState({}) const [userName, setUserName] = useState({}) + const handleWindowsChange = async (): Promise => { + const isOpen = await getKeyOpenChildWindow('shareScreenWindow') + if (isOpen) { + window.electron.mainWindowHide() + } + setEquipmentManagementModal(false) + } return ( <> { centered width={'500px'} onCancel={() => { - setEquipmentManagementModal(false) + handleWindowsChange() }}>
@@ -87,12 +95,12 @@ const EquipmentManagement = forwardRef((_props: any, ref: any) => { uid: callerUid, driversJsonString: JSON.stringify(deviceInfo) }) - setEquipmentManagementModal(false) + handleWindowsChange() message.success('设置成功') }}>确定 + onClick={() => handleWindowsChange()}>取消
diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 2eb9138..6dc22d6 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -6,6 +6,7 @@ import { agora } from '@/utils/package/agora' import { CloseOutlined, LoadingOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import { storage } from '@/utils'; import path from 'path'; +import { getKeyOpenChildWindow } from '@/utils/package/public'; const fs = require('fs').promises; const { exec } = require('child_process'); @@ -95,13 +96,13 @@ const StupWizard = forwardRef((props: any, ref: any) => { top: '16px', cursor: 'pointer' }} - onClick={() => { + onClick={async () => { if (location.hash.indexOf('/meeting') === -1) { agora.release() } - if (storage.getItem('isOpenChildWindow') === 'true') { + const isOpen = await getKeyOpenChildWindow('shareScreenWindow') + if (isOpen) { window.electron.mainWindowHide() - storage.setItem('isOpenChildWindow', false) } setIsStupWizard(false) }} diff --git a/src/page/ShareScreenWindow/index.module.scss b/src/page/Meeting/ShareScreenWindow/index.module.scss similarity index 100% rename from src/page/ShareScreenWindow/index.module.scss rename to src/page/Meeting/ShareScreenWindow/index.module.scss diff --git a/src/page/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx similarity index 80% rename from src/page/ShareScreenWindow/index.tsx rename to src/page/Meeting/ShareScreenWindow/index.tsx index af5f59a..a6fcbaa 100644 --- a/src/page/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -1,8 +1,9 @@ import { GetRoomUser, GetRoomUserItem } from '@/api/Meeting'; import { role } from '@/config/role'; -import styles from '@/page/ShareScreenWindow/index.module.scss' +import styles from '@/page/Meeting/ShareScreenWindow/index.module.scss' import { storage } from '@/utils'; import ImageUrl from '@/utils/package/imageUrl'; +import { getKeyOpenChildWindow, setKeyOpenChildWindow } from '@/utils/package/public'; import { Button } from 'antd'; import { useEffect, useState } from "react"; const ShareScreenWindow: React.FC = () => { @@ -54,7 +55,7 @@ const ShareScreenWindow: React.FC = () => { const [time, setTime] = useState('') const [roomUserLists, setRoomUserLists] = useState([]) const channel = new BroadcastChannel('meeting_channel'); - let userInfo = JSON.parse(storage.getItem('user') as string) + const userInfo = JSON.parse(storage.getItem('user') as string) useEffect(() => { getRoomUser() channel.onmessage = function (event) { @@ -106,14 +107,14 @@ const ShareScreenWindow: React.FC = () => { } return ( <> -
+
{time} 共享中
-
+
{footerLists.map((item: any, index: number) => { return (
{ + onClick={async () => { switch (item.title) { case '静音': case '解除静音': @@ -122,15 +123,27 @@ const ShareScreenWindow: React.FC = () => { case '录制': case '录制中': channel.postMessage({ - type: 'footerListsTitle', - footerListsTitle: item.title + type: 'shareScreenWindowfooterListsTitle', + shareScreenWindowfooterListsTitle: item.title }); break; case '设置': channel.postMessage({ - type: 'setting' + type: 'shareScreenWindowSetting' }); break; + case '成员列表': + const isOpen = await getKeyOpenChildWindow('userListWindow') + if (!isOpen) { + window.electron.createChildWindow({ + url: location.origin + `/#/userListWindow`, + width: 340, + height: 540, + key: 'userListWindow', + }) + setKeyOpenChildWindow('userListWindow', true) + } + break; } }} key={index}> @@ -142,13 +155,13 @@ const ShareScreenWindow: React.FC = () => {
-
+
) } diff --git a/src/page/Meeting/UserListWindow/index.module.scss b/src/page/Meeting/UserListWindow/index.module.scss new file mode 100644 index 0000000..2cc7677 --- /dev/null +++ b/src/page/Meeting/UserListWindow/index.module.scss @@ -0,0 +1,120 @@ +.userListWindow { + height: 100%; + width: 100%; + box-sizing: border-box; + background-color: #16191E; + display: flex; + flex-direction: column; + box-sizing: border-box; + padding: 10px 0; + + >div { + margin-bottom: 10px; + + &:last-child { + margin-bottom: 0px; + } + } + + .userListWindowTitle { + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + padding: 0 10px; + + >span { + color: #EEEEEE; + font-size: 18px; + } + + >img { + cursor: pointer; + } + } + + .userListWindowContent { + flex-grow: 1; + height: 0px; + overflow-y: auto; + + >div { + display: flex; + align-items: center; + justify-content: space-between; + position: relative; + box-sizing: border-box; + padding: 4px 10px; + + >div:nth-child(1) { + display: flex; + align-items: center; + + >span { + font-size: 14px; + color: #F3F3F5; + margin-left: 4px; + } + + >div { + flex-shrink: 0; + } + } + + >div:nth-child(2) { + display: flex; + align-items: center; + + >div { + height: 30px; + width: 30px; + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + + >img { + width: 20px; + } + + &:hover { + background-color: rgba(0, 0, 0, 0.5); + } + } + } + + &:hover { + background-color: rgb(52, 52, 52); + } + } + } + + .userListWindowFooter { + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + + >div { + font-size: 14px; + cursor: pointer; + background-color: #31353A; + color: #EEEEEE; + width: 104px; + height: 30px; + line-height: 30px; + text-align: center; + border-radius: 5px; + + &:hover { + background-color: lighten(#31353A, 4%); + } + + &:active { + background-color: darken(#31353A, 4%); + } + } + } +} \ No newline at end of file diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx new file mode 100644 index 0000000..b3bf4bf --- /dev/null +++ b/src/page/Meeting/UserListWindow/index.tsx @@ -0,0 +1,210 @@ +import { role } from '@/config/role'; +import styles from '@/page/Meeting/UserListWindow/index.module.scss' +import ImageUrl from '@/utils/package/imageUrl'; +import { EllipsisOutlined, ExclamationCircleFilled, SearchOutlined } from '@ant-design/icons'; +import { Button, Input, Modal, Popover } from 'antd'; +import Avatar from '@/components/Avatar'; +import { useEffect, useState } from "react"; +import { storage } from '@/utils'; +import { GetRoomUser } from '@/api/Meeting'; +import { setKeyOpenChildWindow } from '@/utils/package/public'; +const { confirm } = Modal; + +const UserListWindow: React.FC = () => { + const [userSearchValue, setUserSearchValue] = useState('') + const [user, setUser] = useState({}); + const [roomUserList, setRoomUserList] = useState([]) + const channel = new BroadcastChannel('meeting_channel'); + const userInfo = JSON.parse(storage.getItem('user') as string) + useEffect(() => { + setUser(userInfo) + getRoomUser() + channel.onmessage = function (event) { + const { type, roomUserList } = event.data; + switch (type) { + case 'roomUserList': + setRoomUserList(roomUserList) + break; + } + } + }, []); + // 获取房间用户 + const getRoomUser = async (): Promise => { + const data = JSON.parse(storage.getItem('stateInfo') as string) + GetRoomUser(data.channelId).then(res => { + if (res.code === 200) { + res.data.forEach((item: any) => { + item.isShow = true; + item.isRoom = true; + item.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager + }) + setRoomUserList(res.data) + } + }) + } + return ( + <> +
+
+ 成员列表 + { + window.electron.closeChildWindow('userListWindow') + setKeyOpenChildWindow('userListWindow', false) + }} /> +
+
+ } + value={userSearchValue} + onChange={(e) => { + setUserSearchValue(e.target.value) + const newRoomUserList = [...roomUserList] + newRoomUserList.forEach(row => { + if (e.target.value) { + if (row.userName.indexOf(e.target.value) !== -1) { + row.isShow = true; + } else { + row.isShow = false; + } + } else { + row.isShow = true; + } + }); + setRoomUserList(newRoomUserList) + }} + /> +
+
+ {roomUserList.map((item: any, index: number) => { + return ( + item.isShow && item.isRoom ?
+
+
+ + {item.userName}{item.uid === user.uid ? '(我)' : ''} + {role.ID.includes(item.roleId) || item.isRoomManager ? + + {role.ID.includes(item.roleId) ? '管理员' : '发言人'} + + : null} + +
+
+ {role.ID.includes(item.roleId) || item.isRoomManager ?
+ { + channel.postMessage({ + type: 'userListWindowPostOpenMicr', + userListWindowPostOpenMicr: { + enableMicr: !item.enableMicr, + uid: item.uid + } + }); + }} title={item.enableMicr ? '静音' : '解除声音'} /> +
: null} + {role.ID.includes(item.roleId) || item.isRoomManager ?
+ { + channel.postMessage({ + type: 'userListWindowPostOpenCamera', + userListWindowPostOpenCamera: { + enableCamera: !item.enableCamera, + uid: item.uid + } + }); + }} title={item.enableCamera ? '关闭视频' : '开启视频'} /> +
: null} + {item.uid !== user.uid && role.ID.includes(user.roleId) ?
+ + {!role.ID.includes(item.roleId) ? : null} + + +
+ }> + + +
: null} +
+
: null + ) + } + )} +
+
+
{ + channel.postMessage({ + type: 'userListWindowAllPostOpenMicr' + }); + }}>全员静音
+
+
+ + ) +} + +export default UserListWindow diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 06a65c7..56bbaec 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -22,6 +22,7 @@ import EquipmentManagement from '@/components/EquipmentManagement'; import UserVideo from '@/components/UserVideo'; import { role } from '@/config/role'; import { fixWebmDuration } from "webm-duration-fix-buffer"; +import { getKeyOpenChildWindow, setKeyOpenChildWindow } from '@/utils/package/public'; const { confirm } = Modal; const { exec } = require('child_process'); const fs = require('fs').promises; @@ -201,38 +202,77 @@ const Meeting: React.FC = () => { const container = document.getElementById('videoView') as HTMLElement; container.addEventListener('wheel', handleWheelChange); channel.onmessage = async function (event) { - const { type, footerListsTitle } = event.data; + const { + type, + shareScreenWindowfooterListsTitle, + userListWindowPostOpenMicr, + userListWindowPostOpenCamera, + userListWindowDeleteRoomManager, + userListWindowPostRoomManager, + userListWindowGetRoomKickout, + shareScreenWindowEquipmentManagement + } = event.data; switch (type) { - case 'closeShareScreen': + case 'shareScreenWindowClose': await stopScreenCapture() await allUserLook(userInfo.uid, userInfo.userName) break; - case 'setting': + case 'shareScreenWindowSetting': stupWizardRef.current.changeModal(3); window.electron.mainWindowCenter() break; - case 'footerListsTitle': - switch (footerListsTitle) { + case 'shareScreenWindowfooterListsTitle': + switch (shareScreenWindowfooterListsTitle) { case '静音': case '解除静音': changeStatusList({ - title: footerListsTitle + title: shareScreenWindowfooterListsTitle }, 0, 1) break; case '关闭视频': case '开启视频': changeStatusList({ - title: footerListsTitle + title: shareScreenWindowfooterListsTitle }, 0, 2) break; case '录制': case '录制中': changeStatusList({ - title: footerListsTitle + title: shareScreenWindowfooterListsTitle }, 1, 3) break; } break; + case 'userListWindowPostOpenMicr': + postOpenMicr(userListWindowPostOpenMicr.enableMicr, userListWindowPostOpenMicr.uid) + break; + case 'userListWindowPostOpenCamera': + postOpenCamera(userListWindowPostOpenCamera.enableCamera, userListWindowPostOpenCamera.uid) + break; + case 'userListWindowDeleteRoomManager': + DeleteRoomManager({ + roomId: state.roomId, + roomNum: state.channelId, + userId: userListWindowDeleteRoomManager.uid + }) + break; + case 'userListWindowPostRoomManager': + postRoomManager({ + roomId: state.roomId, + roomNum: state.channelId, + userId: userListWindowPostRoomManager.uid + }) + break; + case 'userListWindowGetRoomKickout': + GetRoomKickout(state.channelId, userListWindowGetRoomKickout.uid) + break; + case 'userListWindowAllPostOpenMicr': + postOpenMicr(false, userInfo.id, true) + break; + case 'shareScreenWindowEquipmentManagement': + equipmentManagement(shareScreenWindowEquipmentManagement.uid, shareScreenWindowEquipmentManagement.userName) + window.electron.mainWindowCenter() + break; } } time = setInterval(() => { @@ -1307,13 +1347,16 @@ const Meeting: React.FC = () => { setIsSharedScreenModal(false) await agora.setDesktopCapturerVideo(sharedScreenItem, isComputerAudio, isFluencyPriority) await allUserLook(user.screenShareId, user.userName) - // window.electron.createChildWindow({ - // url: location.origin + `/#/shareScreenWindow`, - // width: 540, - // height: 70, - // key: 'shareScreenWindow', - // }) - // storage.setItem('isOpenChildWindow', true) + const isOpen = await getKeyOpenChildWindow('shareScreenWindow') + if (!isOpen) { + window.electron.createChildWindow({ + url: location.origin + `/#/shareScreenWindow`, + width: 540, + height: 70, + key: 'shareScreenWindow', + }) + setKeyOpenChildWindow('shareScreenWindow', true) + } } else { message.error('请选择应用!') } @@ -1357,6 +1400,7 @@ const Meeting: React.FC = () => { footerListTemplate[1][0].title = '共享屏幕' setFooterList(footerListTemplate) window.electron.closeChildWindow('shareScreenWindow') + setKeyOpenChildWindow('shareScreenWindow', false) } // 获取房间用户 const getRoomUser = async (): Promise => { @@ -2015,7 +2059,7 @@ const Meeting: React.FC = () => {
: null} {item.uid !== user.uid && role.ID.includes(user.roleId) ?
+
{!role.ID.includes(item.roleId) ? : null} + {roomUserItem.uid !== user.uid && !role.ID.includes(roomUserItem.roleId) ? : null} + {roomUserItem.isRoomManager ? : null} + {roomUserItem.isRoomManager ? : null} + {roomUserItem.uid !== user.uid ? : null} + {roomUserItem.uid !== user.uid ? : null} +
:
用户不在房间内
+ }> +
+
+ {item.uid !== user.uid ? + {item.userName} {dayjs(item.timestamp).format('HH:mm:ss')} : + {dayjs(item.timestamp).format('HH:mm:ss')} {item.userName} + } + +
+
:
+
+ {item.uid !== user.uid ? + {item.userName}{dayjs(item.timestamp).format('HH:mm:ss')} : + {dayjs(item.timestamp).format('HH:mm:ss')} {item.userName} + } +
} +
{item.message}
+
+ )} + +
+ { + commonlyChatList.map((item: string, index: number) => { + return + }) + } +
+
+ { + setInputValue(e.target.value) + }} + autoSize={{ minRows: 3, maxRows: 3 }} /> + +
+ + + ) +} + +export default ChatBigWindow diff --git a/src/page/Meeting/ChatSmallWindow/index.module.scss b/src/page/Meeting/ChatSmallWindow/index.module.scss index dc71b19..5e8896c 100644 --- a/src/page/Meeting/ChatSmallWindow/index.module.scss +++ b/src/page/Meeting/ChatSmallWindow/index.module.scss @@ -8,10 +8,9 @@ >div:nth-child(1) { flex-grow: 1; overflow-y: hidden; - height: 80%; + max-height: 80%; padding: 4px; box-sizing: border-box; - overflow-y: auto; .chatSmallWindowContentLeft { display: flex; diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index 13e1c16..2d2c47b 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -14,10 +14,12 @@ const ChatSmallWindow: React.FC = () => { switch (type) { case 'chatList': setChatLists(chatList) - const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; - if (chatSmallWindowView) { - chatSmallWindowView.scrollTop = chatSmallWindowView.scrollHeight; - } + setTimeout(() => { + const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; + if (chatSmallWindowView) { + chatSmallWindowView.scrollTop = chatSmallWindowView.scrollHeight; + } + }, 100) break; } } @@ -27,7 +29,7 @@ const ChatSmallWindow: React.FC = () => { return ( <>
-
+
{chatLists.map((item: any) =>
diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index a6fcbaa..f588682 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -132,9 +132,21 @@ const ShareScreenWindow: React.FC = () => { type: 'shareScreenWindowSetting' }); break; + case '聊天': + const chatBigWindow = await getKeyOpenChildWindow('chatBigWindow') + if (!chatBigWindow) { + window.electron.createChildWindow({ + url: location.origin + `/#/chatBigWindow`, + width: 440, + height: 640, + key: 'chatBigWindow', + }) + setKeyOpenChildWindow('chatBigWindow', true) + } + break; case '成员列表': - const isOpen = await getKeyOpenChildWindow('userListWindow') - if (!isOpen) { + const userListWindow = await getKeyOpenChildWindow('userListWindow') + if (!userListWindow) { window.electron.createChildWindow({ url: location.origin + `/#/userListWindow`, width: 340, diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 345fab2..60825df 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -212,7 +212,15 @@ const Meeting: React.FC = () => { userListWindowPostRoomManager, userListWindowGetRoomKickout, shareScreenWindowEquipmentManagement, - chatSmallWindowSendChannelMsg + chatSmallWindowSendChannelMsg, + chatBigWindowSetAllUserLook, + chatBigWindowDeleteRoomManager, + chatBigWindowPostRoomManager, + chatBigWindowPostOpenMicr, + chatBigWindowPostOpenCamera, + chatBigWindowEquipmentManagement, + chatBigWindowGetRoomKickout, + chatBigWindowSendChannelMsg, } = event.data; switch (type) { case 'shareScreenWindowClose': @@ -278,6 +286,39 @@ const Meeting: React.FC = () => { case 'chatSmallWindowSendChannelMsg': sendMsg(chatSmallWindowSendChannelMsg.msg) break; + case 'chatBigWindowSetAllUserLook': + setAllUserLook(chatBigWindowSetAllUserLook.roomUserItem) + break; + case 'chatBigWindowDeleteRoomManager': + DeleteRoomManager({ + roomId: state.roomId, + roomNum: state.channelId, + userId: chatBigWindowDeleteRoomManager.uid + }) + break; + case 'chatBigWindowPostRoomManager': + postRoomManager({ + roomId: state.roomId, + roomNum: state.channelId, + userId: chatBigWindowPostRoomManager.uid + }) + break; + case 'chatBigWindowPostOpenMicr': + postOpenMicr(chatBigWindowPostOpenMicr.enableMicr, chatBigWindowPostOpenMicr.uid) + break; + case 'chatBigWindowPostOpenCamera': + postOpenCamera(chatBigWindowPostOpenCamera.enableCamera, chatBigWindowPostOpenCamera.uid) + break; + case 'chatBigWindowEquipmentManagement': + equipmentManagement(chatBigWindowEquipmentManagement.uid, chatBigWindowEquipmentManagement.userName) + window.electron.mainWindowCenter() + break; + case 'chatBigWindowGetRoomKickout': + GetRoomKickout(state.channelId, chatBigWindowGetRoomKickout.uid) + break; + case 'chatBigWindowSendChannelMsg': + sendMsg(chatBigWindowSendChannelMsg.msg) + break; } } time = setInterval(() => { From b42fc7f4626da3913897594b8524697280977a47 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 10:37:34 +0800 Subject: [PATCH 08/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=B0=8F=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 12 ++- src/App.tsx | 8 +- src/components/UserVideo/index.tsx | 2 +- .../CurrentSpeakUserWindow/index.module.scss | 19 +++++ .../Meeting/CurrentSpeakUserWindow/index.tsx | 33 ++++++++ src/page/Meeting/index.module.scss | 11 +++ src/page/Meeting/index.tsx | 83 ++++++++++++++++--- src/utils/package/agora.ts | 6 +- src/utils/styles/App.scss | 5 ++ 9 files changed, 156 insertions(+), 23 deletions(-) create mode 100644 src/page/Meeting/CurrentSpeakUserWindow/index.module.scss create mode 100644 src/page/Meeting/CurrentSpeakUserWindow/index.tsx diff --git a/main.js b/main.js index 7079b02..b0670dc 100644 --- a/main.js +++ b/main.js @@ -161,7 +161,6 @@ app.on('ready', () => { mainWindow.on('move', () => { // 如果是全屏自动恢复到上次窗口大小 if (isMaximized) { - mainWindow.setResizable(true) mainWindow.unmaximize() isMaximized = false; } @@ -177,10 +176,8 @@ app.on('ready', () => { break; case 'maximize': mainWindow.maximize() - mainWindow.setResizable(false) break; case 'unmaximize': - mainWindow.setResizable(true) mainWindow.unmaximize() break; case 'minimize': @@ -438,6 +435,10 @@ function windowOperation(config) { y = height - child.getSize()[1]; child.setPosition(40, y - 200); break; + case 'currentSpeakUserWindow': + x = width - child.getSize()[0]; + child.setPosition(x - 40, 250); + break; } } // 主窗口居中 @@ -449,5 +450,8 @@ function mainWindowCenter() { } // 主窗口隐藏 function mainWindowHide() { - mainWindow.setPosition(-999999, -999999); + const display = screen.getDisplayMatching({ ...mainWindow.getBounds() }); + const { width, height } = display.size + x = width - mainWindow.getSize()[0]; + mainWindow.setPosition(x - 40, 40); } \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 0e5632a..641852f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -20,8 +20,9 @@ import { GetLeave } from "@/api/Meeting"; import path from "path"; import ShareScreenWindow from "@/page/Meeting/ShareScreenWindow"; import UserListWindow from "@/page/Meeting/UserListWindow"; -import ChatSmallWindow from "./page/Meeting/ChatSmallWindow"; -import ChatBigWindow from "./page/Meeting/ChatBigWindow"; +import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow"; +import ChatBigWindow from "@/page/Meeting/ChatBigWindow"; +import CurrentSpeakUserWindow from "@/page/Meeting/CurrentSpeakUserWindow"; const fs = require('fs').promises; const { exec } = require('child_process'); const App: React.FC = () => { @@ -36,7 +37,7 @@ const App: React.FC = () => { }); const [spinning, setSpinning] = useState(false); const [isState, setIsState] = useState(true); - const urlHashArr = ['#/userListWindow', '#/shareScreenWindow', '#/chatSmallWindow', '#/chatBigWindow'] + const urlHashArr = ['#/userListWindow', '#/shareScreenWindow', '#/chatSmallWindow', '#/chatBigWindow', '#/currentSpeakUserWindow'] if (urlHashArr.indexOf(location.hash) == -1) { useEffect(() => { let userInfo = JSON.parse(storage.getItem('user') as string) @@ -253,6 +254,7 @@ const App: React.FC = () => { } /> } /> } /> + } /> } /> diff --git a/src/components/UserVideo/index.tsx b/src/components/UserVideo/index.tsx index 3a5cfc1..de403fe 100644 --- a/src/components/UserVideo/index.tsx +++ b/src/components/UserVideo/index.tsx @@ -60,7 +60,7 @@ const UserVideo: React.FC = () => { useEffect(() => { userList.forEach(async (item: any) => { - await agora.destroyRendererByConfig(Number('1' + item.screenShareId)) + await agora.destroyRendererByConfig(Number('1' + item.screenShareId), state.channelId + 'a') await agora.setupRemoteVideoEx({ uid: Number('1' + item.screenShareId), view: document.getElementById(`video-${item.screenShareId}`), diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.module.scss b/src/page/Meeting/CurrentSpeakUserWindow/index.module.scss new file mode 100644 index 0000000..4b7bf32 --- /dev/null +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.module.scss @@ -0,0 +1,19 @@ +.currentSpeakUserWindow { + color: white; + width: 100%; + display: flex; + flex-direction: column; + height: 100%; + background-color: #16191E; + padding: 4px; + box-sizing: border-box; + + >div { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + max-width: 100%; + width: fit-content; + font-size: 14px; + } +} \ No newline at end of file diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx new file mode 100644 index 0000000..ca34566 --- /dev/null +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -0,0 +1,33 @@ +import styles from '@/page/Meeting/CurrentSpeakUserWindow/index.module.scss' +import { useEffect, useState } from "react"; +const CurrentSpeakUserWindow: React.FC = () => { + const [inputValue, setInputValue] = useState('') + const channel = new BroadcastChannel('meeting_channel'); + useEffect(() => { + channel.onmessage = function (event) { + const { type, currentSpeakUser } = event.data; + switch (type) { + case 'currentSpeakUser': + if (currentSpeakUser.length) { + setInputValue(currentSpeakUser.join(',')) + } else { + setInputValue('') + } + break; + } + } + }, []); + + + return ( + <> +
+
+ {inputValue ? `${inputValue}正在说话` : '无人说话'} +
+
+ + ) +} + +export default CurrentSpeakUserWindow diff --git a/src/page/Meeting/index.module.scss b/src/page/Meeting/index.module.scss index 262c256..69586e3 100644 --- a/src/page/Meeting/index.module.scss +++ b/src/page/Meeting/index.module.scss @@ -94,6 +94,17 @@ background-color: #1F2022; display: flex; flex-direction: column; + position: relative; + + .meetingAbsolute { + position: absolute; + width: 100%; + height: 100%; + background-color: #1F2022; + left: 0; + top: 0; + z-index: 3000; + } .meetingHeader { display: flex; diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 60825df..e92c961 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -844,18 +844,43 @@ const Meeting: React.FC = () => { } }, onAudioVolumeIndication: async (speakers: AudioVolumeInfo[]) => { - speakers.forEach((item: any) => { - let domMe = document.getElementById(`micr-item-${userInfo.uid}`); - let dom = document.getElementById(`micr-${item.uid ? item.uid : userInfo.uid}`); - if (dom) { - const percentage = (item.volume / 255) * 100 - dom.style.height = `${percentage}%` - } - if (domMe && !item.uid) { - const percentage = (item.volume / 255) * 100 - domMe.style.height = `${percentage}%` - } - }); + async function checkUidsInUsers(uids: number[]): Promise { + return new Promise(resolve => { + const usernames: string[] = []; + uids.forEach(uid => { + setRoomUserList((res: any) => { + const user = res.find((item: any) => item.uid == uid); + if (user) { + usernames.push(user.userName); + } + return res + }) + }); + if (uids.length === usernames.length) { + resolve(usernames) + } + }) + } + if (speakers.length) { + speakers.forEach((item: any) => { + let domMe = document.getElementById(`micr-item-${userInfo.uid}`); + let dom = document.getElementById(`micr-${item.uid ? item.uid : userInfo.uid}`); + if (dom) { + const percentage = (item.volume / 255) * 100 + dom.style.height = `${percentage}%` + } + if (domMe && !item.uid) { + const percentage = (item.volume / 255) * 100 + domMe.style.height = `${percentage}%` + } + }); + const uidArr = (speakers.filter((item: any) => item.volume)).map(item => item.uid || userInfo.uid) as number[]; + const currentSpeakUser = await checkUidsInUsers(uidArr) + channel.postMessage({ + type: 'currentSpeakUser', + currentSpeakUser, + }); + } }, onNetworkQuality: async (_connection: RtcConnection, remoteUid: number, _txQuality: QualityType, rxQuality: QualityType) => { if (remoteUid === 0) { @@ -1416,7 +1441,26 @@ const Meeting: React.FC = () => { height: 300, key: 'chatSmallWindow', }) + window.electron.createChildWindow({ + url: location.origin + `/#/currentSpeakUserWindow`, + width: 350, + height: 30, + key: 'currentSpeakUserWindow', + }) setKeyOpenChildWindow('shareScreenWindow', true) + window.electron.setMainWindowSize({ + width: 350, + height: 200, + }) + setTimeout(() => { + agora.setupLocalVideo({ + uid: Number(user.screenShareId), + view: document.getElementById(`meetingAbsoluteVideo`) as HTMLElement, + channelId: state.channelId, + sourceType: VideoSourceType.VideoSourceScreen, + type: true + }) + }, 1500); } } else { message.error('请选择应用!') @@ -1457,11 +1501,23 @@ const Meeting: React.FC = () => { const stopScreenCapture = async (): Promise => { const footerListTemplate = [...footerList] await agora.leaveChannelEx(userInfo.screenShareId) + await agora.destroyRendererByConfig(Number(userInfo.screenShareId), state.channelId) agora.stopScreenCapture() footerListTemplate[1][0].title = '共享屏幕' setFooterList(footerListTemplate) window.electron.closeChildWindow('shareScreenWindow') setKeyOpenChildWindow('shareScreenWindow', false) + window.electron.getWindowSize().then((res: any) => { + window.electron.setMainWindowSize({ + width: Math.ceil(res.width / 1.5), + height: Math.ceil(res.height / 1.3), + }) + window.electron.getIsMaximized().then((b: boolean) => { + if (!b) { + window.electron.setViewStatus('maximize') + } + }) + }) } // 获取房间用户 const getRoomUser = async (): Promise => { @@ -1796,6 +1852,9 @@ const Meeting: React.FC = () => { return ( <>
+ {isShare ?
+ +
: null} {contextHolder}
diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index 7819346..6f857ce 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -165,7 +165,7 @@ export const agora = { }, // 本地加入 setupLocalVideo: async (item: any) => { - if (item.view?.childNodes.length === 1) { + if (item.view?.childNodes.length === 1 || item.type) { await rtcEngine.setupLocalVideo({ renderMode: agora.getRrenderMode(item.uid), sourceType: item.sourceType, @@ -323,8 +323,8 @@ export const agora = { rtcEngine.muteRemoteVideoStream(uid, mute) }, // 销毁视频渲染dom - destroyRendererByConfig: async (uid: number) => { - await rtcEngine.destroyRendererByConfig(VideoSourceType.VideoSourceRemote, option.channelId + 'a', uid); + destroyRendererByConfig: async (uid: number, channelId: string) => { + await rtcEngine.destroyRendererByConfig(VideoSourceType.VideoSourceRemote, channelId, uid); }, // ai降噪 setAINSMode: async (enabled: boolean, mode: AudioAinsMode) => { diff --git a/src/utils/styles/App.scss b/src/utils/styles/App.scss index 3b5551f..1c1cf96 100644 --- a/src/utils/styles/App.scss +++ b/src/utils/styles/App.scss @@ -376,6 +376,7 @@ $pagination-hover-background-color: #5575F2; .ant-message { -webkit-app-region: no-drag; } + // ant-spin-fullscreen .ant-spin-fullscreen { z-index: 10000; @@ -383,4 +384,8 @@ $pagination-hover-background-color: #5575F2; .ant-picker-dropdown { -webkit-app-region: no-drag; +} + +.ant-tabs { + -webkit-app-region: no-drag; } \ No newline at end of file From c5d3804a627558d6c74e73b75f4a1b3331dafeb8 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 10:47:36 +0800 Subject: [PATCH 09/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index e92c961..4cc991b 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1852,7 +1852,7 @@ const Meeting: React.FC = () => { return ( <>
- {isShare ?
+ {isShare == user.screenShareId ?
: null} {contextHolder} From eee14c037d0418547a528e718a7f297d3d641867 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 11:24:34 +0800 Subject: [PATCH 10/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 4cc991b..2be2a09 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -549,7 +549,7 @@ const Meeting: React.FC = () => { } } else { if (item.user.uid === userInfo.uid) { - if (!item.user.isRoomManager) { + if (item.user.isRoomManager) { await agora.allLeaveChannelEx() } message.success(`管理员${item.user.isRoomManager ? '设置' : '取消'}您为发言人`) @@ -1507,17 +1507,19 @@ const Meeting: React.FC = () => { setFooterList(footerListTemplate) window.electron.closeChildWindow('shareScreenWindow') setKeyOpenChildWindow('shareScreenWindow', false) - window.electron.getWindowSize().then((res: any) => { - window.electron.setMainWindowSize({ - width: Math.ceil(res.width / 1.5), - height: Math.ceil(res.height / 1.3), + if (isShare === userInfo.screenShareId) { + window.electron.getWindowSize().then((res: any) => { + window.electron.setMainWindowSize({ + width: Math.ceil(res.width / 1.5), + height: Math.ceil(res.height / 1.3), + }) + window.electron.getIsMaximized().then((b: boolean) => { + if (!b) { + window.electron.setViewStatus('maximize') + } + }) }) - window.electron.getIsMaximized().then((b: boolean) => { - if (!b) { - window.electron.setViewStatus('maximize') - } - }) - }) + } } // 获取房间用户 const getRoomUser = async (): Promise => { From fe67cf1d0fa45d6912f5e487fccd7d9547abc201 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 11:32:31 +0800 Subject: [PATCH 11/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 2be2a09..12f095a 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -153,6 +153,7 @@ const Meeting: React.FC = () => { }) const [networkOther, setNetworkOther] = useState({}) const [isComputerAudio, setIsComputerAudio] = useState(true) + const [isScreenCapture, setIsScreenCapture] = useState(true) const [isFluencyPriority, setIsFluencyPriority] = useState(false) const [open, setOpen] = useState(false) const [modeOpen, setModeOpen] = useState(false) @@ -1428,6 +1429,7 @@ const Meeting: React.FC = () => { await agora.setDesktopCapturerVideo(sharedScreenItem, isComputerAudio, isFluencyPriority) await allUserLook(user.screenShareId, user.userName) const isOpen = await getKeyOpenChildWindow('shareScreenWindow') + setIsScreenCapture(true) if (!isOpen) { window.electron.createChildWindow({ url: location.origin + `/#/shareScreenWindow`, @@ -1507,7 +1509,8 @@ const Meeting: React.FC = () => { setFooterList(footerListTemplate) window.electron.closeChildWindow('shareScreenWindow') setKeyOpenChildWindow('shareScreenWindow', false) - if (isShare === userInfo.screenShareId) { + if (isScreenCapture) { + setIsScreenCapture(false) window.electron.getWindowSize().then((res: any) => { window.electron.setMainWindowSize({ width: Math.ceil(res.width / 1.5), From bc0724e428d8eb23199f79ea52311cf0f956f233 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 11:41:20 +0800 Subject: [PATCH 12/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 12f095a..571b3bf 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1423,6 +1423,11 @@ const Meeting: React.FC = () => { const clickSharedScreen = async (): Promise => { let data = sharedScreenList.find((item: any) => item.sourceId === sharedScreenItem.sourceId) if (data) { + setIsShare(user.screenShareId) + window.electron.setMainWindowSize({ + width: 350, + height: 200, + }) const footerListTemplate = [...footerList] footerListTemplate[footerListIndex.itemIndex][footerListIndex.rowIndex].title = '停止共享' setIsSharedScreenModal(false) @@ -1450,10 +1455,6 @@ const Meeting: React.FC = () => { key: 'currentSpeakUserWindow', }) setKeyOpenChildWindow('shareScreenWindow', true) - window.electron.setMainWindowSize({ - width: 350, - height: 200, - }) setTimeout(() => { agora.setupLocalVideo({ uid: Number(user.screenShareId), From e51a8e9742dabf0e214776c18bfdc152dd25bf16 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 11:43:44 +0800 Subject: [PATCH 13/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 571b3bf..12f095a 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1423,11 +1423,6 @@ const Meeting: React.FC = () => { const clickSharedScreen = async (): Promise => { let data = sharedScreenList.find((item: any) => item.sourceId === sharedScreenItem.sourceId) if (data) { - setIsShare(user.screenShareId) - window.electron.setMainWindowSize({ - width: 350, - height: 200, - }) const footerListTemplate = [...footerList] footerListTemplate[footerListIndex.itemIndex][footerListIndex.rowIndex].title = '停止共享' setIsSharedScreenModal(false) @@ -1455,6 +1450,10 @@ const Meeting: React.FC = () => { key: 'currentSpeakUserWindow', }) setKeyOpenChildWindow('shareScreenWindow', true) + window.electron.setMainWindowSize({ + width: 350, + height: 200, + }) setTimeout(() => { agora.setupLocalVideo({ uid: Number(user.screenShareId), From a32273eaae04f6f0992742499eb48a4633484869 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 13:52:12 +0800 Subject: [PATCH 14/95] =?UTF-8?q?=E7=AA=97=E5=8F=A3=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4&=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 7 +-- .../Meeting/ChatSmallWindow/index.module.scss | 57 +++++++------------ src/page/Meeting/ChatSmallWindow/index.tsx | 7 +-- src/page/Meeting/index.module.scss | 11 ---- src/page/Meeting/index.tsx | 19 +------ 5 files changed, 27 insertions(+), 74 deletions(-) diff --git a/main.js b/main.js index b0670dc..271c5f0 100644 --- a/main.js +++ b/main.js @@ -437,7 +437,7 @@ function windowOperation(config) { break; case 'currentSpeakUserWindow': x = width - child.getSize()[0]; - child.setPosition(x - 40, 250); + child.setPosition(x - 40, 40); break; } } @@ -450,8 +450,5 @@ function mainWindowCenter() { } // 主窗口隐藏 function mainWindowHide() { - const display = screen.getDisplayMatching({ ...mainWindow.getBounds() }); - const { width, height } = display.size - x = width - mainWindow.getSize()[0]; - mainWindow.setPosition(x - 40, 40); + mainWindow.setPosition(-999999, -999999); } \ No newline at end of file diff --git a/src/page/Meeting/ChatSmallWindow/index.module.scss b/src/page/Meeting/ChatSmallWindow/index.module.scss index 5e8896c..e386a8c 100644 --- a/src/page/Meeting/ChatSmallWindow/index.module.scss +++ b/src/page/Meeting/ChatSmallWindow/index.module.scss @@ -11,33 +11,27 @@ max-height: 80%; padding: 4px; box-sizing: border-box; + display: flex; + flex-direction: column-reverse; .chatSmallWindowContentLeft { display: flex; flex-direction: column; align-items: flex-start; - >div:nth-child(1) { - display: flex; - align-items: center; - - >span { - font-size: 14px; - color: black; - margin-left: 4px; - } - - >div {} - } - - >div:nth-child(2) { - background-color: #5575F2; - color: #F3F3F5; + >div { + background-color: #5574f25d; + color: black; padding: 4px; box-sizing: border-box; border-radius: 0 15px 15px 15px; - margin: 0 0 10px 40px; + margin: 0 0 10px 0; font-size: 12px; + display: flex; + + >span:nth-child(1) { + white-space: nowrap; + } } } @@ -46,29 +40,20 @@ flex-direction: column; align-items: flex-end; - >div:nth-child(1) { - display: flex; - align-items: center; - flex-direction: row-reverse; - - >span { - font-size: 14px; - color: black; - } - - >div { - margin-left: 4px; - } - } - - >div:nth-child(2) { - background-color: #464E6B; - color: #F3F3F5; + >div { + background-color: #464e6b55; + color: black; padding: 4px; box-sizing: border-box; border-radius: 15px 0 15px 15px; - margin: 0 40px 10px 0; + margin: 0 0 10px 0; font-size: 14px; + display: flex; + flex-direction: row-reverse; + + >span:nth-child(1) { + white-space: nowrap; + } } } } diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index 2d2c47b..1e99b01 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -1,7 +1,6 @@ import styles from '@/page/Meeting/ChatSmallWindow/index.module.scss' import { Input } from 'antd'; import { useEffect, useState } from "react"; -import Avatar from '@/components/Avatar'; import { storage } from '@/utils'; const ChatSmallWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') @@ -13,7 +12,7 @@ const ChatSmallWindow: React.FC = () => { const { type, chatList } = event.data; switch (type) { case 'chatList': - setChatLists(chatList) + setChatLists(chatList.reverse()) setTimeout(() => { const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; if (chatSmallWindowView) { @@ -33,10 +32,10 @@ const ChatSmallWindow: React.FC = () => { {chatLists.map((item: any) =>
-
{item.userName} + + {item.message}
-
{item.message}
)}
diff --git a/src/page/Meeting/index.module.scss b/src/page/Meeting/index.module.scss index 69586e3..262c256 100644 --- a/src/page/Meeting/index.module.scss +++ b/src/page/Meeting/index.module.scss @@ -94,17 +94,6 @@ background-color: #1F2022; display: flex; flex-direction: column; - position: relative; - - .meetingAbsolute { - position: absolute; - width: 100%; - height: 100%; - background-color: #1F2022; - left: 0; - top: 0; - z-index: 3000; - } .meetingHeader { display: flex; diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 12f095a..6984da7 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1445,24 +1445,11 @@ const Meeting: React.FC = () => { }) window.electron.createChildWindow({ url: location.origin + `/#/currentSpeakUserWindow`, - width: 350, + width: 200, height: 30, key: 'currentSpeakUserWindow', }) setKeyOpenChildWindow('shareScreenWindow', true) - window.electron.setMainWindowSize({ - width: 350, - height: 200, - }) - setTimeout(() => { - agora.setupLocalVideo({ - uid: Number(user.screenShareId), - view: document.getElementById(`meetingAbsoluteVideo`) as HTMLElement, - channelId: state.channelId, - sourceType: VideoSourceType.VideoSourceScreen, - type: true - }) - }, 1500); } } else { message.error('请选择应用!') @@ -1503,7 +1490,6 @@ const Meeting: React.FC = () => { const stopScreenCapture = async (): Promise => { const footerListTemplate = [...footerList] await agora.leaveChannelEx(userInfo.screenShareId) - await agora.destroyRendererByConfig(Number(userInfo.screenShareId), state.channelId) agora.stopScreenCapture() footerListTemplate[1][0].title = '共享屏幕' setFooterList(footerListTemplate) @@ -1857,9 +1843,6 @@ const Meeting: React.FC = () => { return ( <>
- {isShare == user.screenShareId ?
- -
: null} {contextHolder}
From 1fd3f421f8c1e340206796eb4dff4291fbaad194 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 15:21:17 +0800 Subject: [PATCH 15/95] =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 5 + src/App.tsx | 4 +- .../Meeting/NoticeWindow/index.module.scss | 6 + src/page/Meeting/NoticeWindow/index.tsx | 100 ++++++++++++++ src/page/Meeting/index.tsx | 129 +++++++++++------- 5 files changed, 196 insertions(+), 48 deletions(-) create mode 100644 src/page/Meeting/NoticeWindow/index.module.scss create mode 100644 src/page/Meeting/NoticeWindow/index.tsx diff --git a/main.js b/main.js index 271c5f0..363341d 100644 --- a/main.js +++ b/main.js @@ -439,6 +439,11 @@ function windowOperation(config) { x = width - child.getSize()[0]; child.setPosition(x - 40, 40); break; + case 'noticeWindow': + x = width - child.getSize()[0]; + y = height - child.getSize()[1]; + child.setPosition(x, y - 80); + break; } } // 主窗口居中 diff --git a/src/App.tsx b/src/App.tsx index 641852f..f7805ca 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,6 +23,7 @@ import UserListWindow from "@/page/Meeting/UserListWindow"; import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow"; import ChatBigWindow from "@/page/Meeting/ChatBigWindow"; import CurrentSpeakUserWindow from "@/page/Meeting/CurrentSpeakUserWindow"; +import NoticeWindow from "@/page/Meeting/NoticeWindow"; const fs = require('fs').promises; const { exec } = require('child_process'); const App: React.FC = () => { @@ -37,7 +38,7 @@ const App: React.FC = () => { }); const [spinning, setSpinning] = useState(false); const [isState, setIsState] = useState(true); - const urlHashArr = ['#/userListWindow', '#/shareScreenWindow', '#/chatSmallWindow', '#/chatBigWindow', '#/currentSpeakUserWindow'] + const urlHashArr = ['#/userListWindow', '#/shareScreenWindow', '#/chatSmallWindow', '#/chatBigWindow', '#/currentSpeakUserWindow', '#/noticeWindow'] if (urlHashArr.indexOf(location.hash) == -1) { useEffect(() => { let userInfo = JSON.parse(storage.getItem('user') as string) @@ -255,6 +256,7 @@ const App: React.FC = () => { } /> } /> } /> + } /> } /> diff --git a/src/page/Meeting/NoticeWindow/index.module.scss b/src/page/Meeting/NoticeWindow/index.module.scss new file mode 100644 index 0000000..2264327 --- /dev/null +++ b/src/page/Meeting/NoticeWindow/index.module.scss @@ -0,0 +1,6 @@ +.noticeWindow { + height: 100%; + width: 100%; + box-sizing: border-box; + background-color: transparent; +} \ No newline at end of file diff --git a/src/page/Meeting/NoticeWindow/index.tsx b/src/page/Meeting/NoticeWindow/index.tsx new file mode 100644 index 0000000..dcf0e96 --- /dev/null +++ b/src/page/Meeting/NoticeWindow/index.tsx @@ -0,0 +1,100 @@ +import styles from '@/page/Meeting/NoticeWindow/index.module.scss' +import { setKeyOpenChildWindow } from '@/utils/package/public'; +import { Button, notification } from 'antd'; +import { useEffect } from "react"; + +const NoticeWindow: React.FC = () => { + const [api, contextHolder] = notification.useNotification({ + stack: { + threshold: 3 + } + }); + const channel = new BroadcastChannel('meeting_channel'); + let time: NodeJS.Timeout; + useEffect(() => { + channel.onmessage = function (event) { + const { type, noticeItem } = event.data; + switch (type) { + case 'noticeItem': + api.open({ + message: '', + description:
+ {noticeItem.uname}申请发言 +
+ + +
+
, + duration: 10, + placement: 'bottomRight', + showProgress: true, + pauseOnHover: false, + }); + break; + } + } + }, []); + useEffect(() => { + setTimeout(() => { + time = setInterval(() => { + const dom = document.getElementsByClassName('ant-notification') + if (dom.length === 0) { + window.electron.closeChildWindow('noticeWindow') + setKeyOpenChildWindow('noticeWindow', false) + } + }, 1000) + }, 3000); + return () => { + clearInterval(time) + }; + }, []) + return ( + <> +
+ {contextHolder} +
+ + ) +} + +export default NoticeWindow diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 6984da7..c7184f4 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -153,7 +153,7 @@ const Meeting: React.FC = () => { }) const [networkOther, setNetworkOther] = useState({}) const [isComputerAudio, setIsComputerAudio] = useState(true) - const [isScreenCapture, setIsScreenCapture] = useState(true) + const [isScreenCapture, setIsScreenCapture] = useState(false) const [isFluencyPriority, setIsFluencyPriority] = useState(false) const [open, setOpen] = useState(false) const [modeOpen, setModeOpen] = useState(false) @@ -222,6 +222,7 @@ const Meeting: React.FC = () => { chatBigWindowEquipmentManagement, chatBigWindowGetRoomKickout, chatBigWindowSendChannelMsg, + noticeWindowPostRoomManager } = event.data; switch (type) { case 'shareScreenWindowClose': @@ -320,6 +321,13 @@ const Meeting: React.FC = () => { case 'chatBigWindowSendChannelMsg': sendMsg(chatBigWindowSendChannelMsg.msg) break; + case 'noticeWindowPostRoomManager': + postRoomManager({ + roomId: state.roomId, + roomNum: state.channelId, + userId: noticeWindowPostRoomManager.uid + }) + break; } } time = setInterval(() => { @@ -576,59 +584,86 @@ const Meeting: React.FC = () => { break; // 申请发言 case 'ApplyToSpeak': - api.open({ - message: '', - description:
- {item.uname}申请发言 -
- - + -
-
, - duration: 10, - placement: 'bottomRight', - showProgress: true, - pauseOnHover: false, - }); + }} + style={{ backgroundColor: '#EC3C3C', marginLeft: '14px' }} + >拒绝 +
+
, + duration: 10, + placement: 'bottomRight', + showProgress: true, + pauseOnHover: false, + }); + } + return bool + }) break; // 管理员查看随机用户 case 'Watch': From 3e31304d439ba49180850411b02254bbfe9510a7 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 15:54:48 +0800 Subject: [PATCH 16/95] =?UTF-8?q?=E5=BD=95=E5=88=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 1 + src/components/StupWizard/index.module.scss | 24 +++--- src/components/StupWizard/index.tsx | 85 ++++++++++++--------- src/page/Meeting/index.tsx | 21 +++++ 4 files changed, 87 insertions(+), 44 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index f7805ca..d39f593 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -126,6 +126,7 @@ const App: React.FC = () => { closeSetting: 'hide', //关闭按钮设置 isAINoiseReduction: true, //是否开启ai降噪 aINoiseReduction: 1, // 降噪模式 + isRecordingTips: true, //是否开启录制提示 })) } if (!storage.getItem('openChildWindow')) { diff --git a/src/components/StupWizard/index.module.scss b/src/components/StupWizard/index.module.scss index bd57960..5a760a6 100644 --- a/src/components/StupWizard/index.module.scss +++ b/src/components/StupWizard/index.module.scss @@ -176,19 +176,23 @@ } .recordingComponents { - >span { - color: #bfbfbf; - font-size: 16px; - } - >div { - display: flex; - align-items: center; - margin-top: 10px; + margin-bottom: 20px; >span { - color: #878787; - white-space: nowrap; + color: #bfbfbf; + font-size: 16px; + } + + >div { + display: flex; + align-items: center; + margin-top: 10px; + + >span { + color: #878787; + white-space: nowrap; + } } } } diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 6dc22d6..38afd49 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -464,6 +464,7 @@ const AudioComponents = () => { } const RecordingComponents = () => { const [filePath, setFilePath] = useState('') + const [isRecordingTips, setIsRecordingTips] = useState(false) const setting = JSON.parse(storage.getItem('setting') as string) useEffect(() => { if (!setting.recordingFilesPath) { @@ -472,10 +473,14 @@ const RecordingComponents = () => { const parentDirectory = path.resolve(currentDirectory, '../../Downloads') + '\\'; setting.recordingFilesPath = parentDirectory; setFilePath(setting.recordingFilesPath) - storage.setItem('setting', JSON.stringify(setting)) } else { setFilePath(setting.recordingFilesPath); } + if (setting.isRecordingTips === undefined) { + setting.isRecordingTips = true; + } + storage.setItem('setting', JSON.stringify(setting)) + setIsRecordingTips(setting.isRecordingTips) window.addEventListener('customStorageChange', handleCustomStorageChange); return () => { window.removeEventListener('customStorageChange', handleCustomStorageChange); @@ -492,41 +497,53 @@ const RecordingComponents = () => {
录制
- 本地录制
- 本地录制文件路径 - { - setting.recordingFilesPath = e.target.value; + 本地录制 +
+ 本地录制文件路径 + { + setting.recordingFilesPath = e.target.value; + storage.setItem('setting', JSON.stringify(setting)) + setFilePath(e.target.value) + }} + /> + + +
+
+
+ 录制设置 +
+ { + setting.isRecordingTips = e.target.checked; storage.setItem('setting', JSON.stringify(setting)) - setFilePath(e.target.value) - }} - /> - - + setIsRecordingTips(e.target.checked) + }} checked={isRecordingTips}>开启入会录制提示 +
diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index c7184f4..2b32883 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -337,6 +337,27 @@ const Meeting: React.FC = () => { time: changeCurrentSeconds(), }); }, 1000) + setTimeout(async () => { + const setting = await JSON.parse(storage.getItem('setting') as string); + const stateInfo = await JSON.parse(storage.getItem('stateInfo') as string); + if (stateInfo && setting.isRecordingTips && !recorder) { + confirm({ + title: '提示', + icon: , + content: `是否录制本次会议?`, + centered: true, + okText: '确定', + cancelText: '取消', + async onOk() { + changeStatusList({ + title: '录制' + }, 1, 3) + }, + onCancel() { + } + }) + } + }, 10000); // getDesktopCapturerVideoTime = setInterval(() => { // setSharedScreenItem((i: any) => { // if (i && i.type === 0) { From 652830f6f13f1590d2cd9299c59caae8137223b1 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 17:16:12 +0800 Subject: [PATCH 17/95] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E6=8F=8F=E8=BE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 38 +++++++++++++++++++------------------- src/utils/package/agora.ts | 6 +----- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 2b32883..ce50e21 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -189,7 +189,7 @@ const Meeting: React.FC = () => { const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { let time: NodeJS.Timeout; - // let getDesktopCapturerVideoTime: NodeJS.Timeout; + let getDesktopCapturerVideoTime: NodeJS.Timeout; setUser(userInfo) window.electron.getIsMaximized().then((res: boolean) => { if (!res) { @@ -358,28 +358,28 @@ const Meeting: React.FC = () => { }) } }, 10000); - // getDesktopCapturerVideoTime = setInterval(() => { - // setSharedScreenItem((i: any) => { - // if (i && i.type === 0) { - // agora.getDesktopCapturerVideo({ width: 0, height: 0 }, { width: 0, height: 0 }, false).then(res => { - // if (res.length) { - // let row = res.find((item: any) => item.sourceId === i.sourceId) - // if (!row) { - // stopScreenCapture() - // setSharedScreenItem('') - // allUserLook(userInfo.uid, userInfo.userName) - // } - // } - // }) - // } - // return i - // }) - // }, 3000) + getDesktopCapturerVideoTime = setInterval(() => { + setSharedScreenItem((i: any) => { + if (i && i.type === 0) { + agora.getDesktopCapturerVideo({ width: 0, height: 0 }, { width: 0, height: 0 }, false).then(res => { + if (res.length) { + let row = res.find((item: any) => item.sourceId === i.sourceId) + if (!row) { + stopScreenCapture() + setSharedScreenItem('') + allUserLook(userInfo.uid, userInfo.userName) + } + } + }) + } + return i + }) + }, 3000) return () => { window.removeEventListener('customStorageChange', handleCustomStorageChange); window.removeEventListener('wheel', handleWheelChange); clearInterval(time) - // clearInterval(getDesktopCapturerVideoTime) + clearInterval(getDesktopCapturerVideoTime) }; }, []); diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index 6f857ce..4e0a99f 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -388,7 +388,7 @@ export const agora = { }, // 桌面捕获音频和视频的媒体源的信息 getDesktopCapturerVideo: async (thumbSize: any, iconSize: any, includeScreen: boolean) => { - return await rtcEngine.getScreenCaptureSources(thumbSize, iconSize, includeScreen).filter((item: any) => item.type === 1) + return await rtcEngine.getScreenCaptureSources(thumbSize, iconSize, includeScreen) }, // 共享屏幕采集 setDesktopCapturerVideo: async (targetSource: any, isComputerAudio: boolean, isFluencyPriority: boolean) => { @@ -414,8 +414,6 @@ export const agora = { {}, { windowFocus: true, - enableHighLight: true, - highLightColor: 0xFF99CC00, ...data } ); @@ -425,8 +423,6 @@ export const agora = { {}, { windowFocus: true, - enableHighLight: true, - highLightColor: 0xFF99CC00, ...data } ); From 225a8c8e7149646d29f6f3fbeb4bf884a9572f9b Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 17:22:29 +0800 Subject: [PATCH 18/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 1 + src/page/Meeting/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 363341d..225d2a7 100644 --- a/main.js +++ b/main.js @@ -317,6 +317,7 @@ app.on('ready', () => { childWindow[config.key] = child child.once('ready-to-show', () => { childWindow[config.key].show() + childWindow[config.key].setAlwaysOnTop(true) windowOperation(config) }) child.webContents.on('before-input-event', (event, input) => { diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index ce50e21..00768c9 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1515,7 +1515,9 @@ const Meeting: React.FC = () => { const getDesktopCapturerVideo = (): void => { agora.getDesktopCapturerVideo({ width: 300, height: 300 }, { width: 300, height: 300 }, true).then((res: any) => { res.forEach((item: any, index: number) => { - item.sourceTitle = '桌面' + (index + 1) + if (item.type === 1) { + item.sourceTitle = '桌面' + (index + 1) + } if (item.thumbImage.buffer) { item.thumbnailUrl = thumbImageBufferToBase64(item.thumbImage) } From 444568b232b86ed758eb0a907e42e2a2ff34f161 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 17:33:18 +0800 Subject: [PATCH 19/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 3 +++ src/components/Operation/index.tsx | 2 +- src/components/QuitTips/index.tsx | 2 +- src/page/Meeting/index.tsx | 30 +++++++++++++++++------------- src/render.d.ts | 2 +- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/main.js b/main.js index 225d2a7..85fe4a4 100644 --- a/main.js +++ b/main.js @@ -186,6 +186,9 @@ app.on('ready', () => { case 'hide': mainWindow.hide() break; + case 'show': + mainWindow.show() + break; } }); // 导出是否全屏 diff --git a/src/components/Operation/index.tsx b/src/components/Operation/index.tsx index 2ebc3dd..7f7ba5d 100644 --- a/src/components/Operation/index.tsx +++ b/src/components/Operation/index.tsx @@ -1,7 +1,7 @@ import styles from '@/components/Operation/index.module.scss' import ImageUrl from '@/utils/package/imageUrl'; import { useEffect, useState } from "react"; -type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide'; +type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide' | 'show'; type OperationType = { icon: string; key: OperationKeyType; diff --git a/src/components/QuitTips/index.tsx b/src/components/QuitTips/index.tsx index 4eaecdd..6e0e8d1 100644 --- a/src/components/QuitTips/index.tsx +++ b/src/components/QuitTips/index.tsx @@ -3,7 +3,7 @@ import { storage } from '@/utils'; import { InfoCircleOutlined } from '@ant-design/icons'; import { Button, Checkbox, Modal, Radio } from 'antd'; import { useState, useImperativeHandle, forwardRef } from "react"; -type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide'; +type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide' | 'show'; const QuitTips = forwardRef((props: any, ref: any) => { useImperativeHandle(ref, () => ({ changeModal: () => { diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 00768c9..7295162 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1486,6 +1486,7 @@ const Meeting: React.FC = () => { await allUserLook(user.screenShareId, user.userName) const isOpen = await getKeyOpenChildWindow('shareScreenWindow') setIsScreenCapture(true) + window.electron.setViewStatus('hide') if (!isOpen) { window.electron.createChildWindow({ url: location.origin + `/#/shareScreenWindow`, @@ -1553,20 +1554,23 @@ const Meeting: React.FC = () => { setFooterList(footerListTemplate) window.electron.closeChildWindow('shareScreenWindow') setKeyOpenChildWindow('shareScreenWindow', false) - if (isScreenCapture) { - setIsScreenCapture(false) - window.electron.getWindowSize().then((res: any) => { - window.electron.setMainWindowSize({ - width: Math.ceil(res.width / 1.5), - height: Math.ceil(res.height / 1.3), + setIsScreenCapture(bool => { + if (bool) { + window.electron.setViewStatus('show') + window.electron.getWindowSize().then((res: any) => { + window.electron.setMainWindowSize({ + width: Math.ceil(res.width / 1.5), + height: Math.ceil(res.height / 1.3), + }) + window.electron.getIsMaximized().then((b: boolean) => { + if (!b) { + window.electron.setViewStatus('maximize') + } + }) }) - window.electron.getIsMaximized().then((b: boolean) => { - if (!b) { - window.electron.setViewStatus('maximize') - } - }) - }) - } + } + return false + }) } // 获取房间用户 const getRoomUser = async (): Promise => { diff --git a/src/render.d.ts b/src/render.d.ts index 333ce68..7c85640 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -2,7 +2,7 @@ export interface IElectronAPI { setMainWindowSize: (config: any) => void; getWindowSize: () => any; - setViewStatus: (status: 'quit' | 'maximize' | 'minimize' | 'unmaximize' | 'hide') => void; + setViewStatus: (status: 'quit' | 'maximize' | 'minimize' | 'unmaximize' | 'hide' | 'show') => void; getIsMaximized: () => Promise; setWriteText: (text: string) => void; onQuit: (callBack: Function) => void; From e492d0fcf9a14e25b29a8c6c682426c4205a1a2e Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 17:33:47 +0800 Subject: [PATCH 20/95] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 7295162..858b5fe 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -153,7 +153,7 @@ const Meeting: React.FC = () => { }) const [networkOther, setNetworkOther] = useState({}) const [isComputerAudio, setIsComputerAudio] = useState(true) - const [isScreenCapture, setIsScreenCapture] = useState(false) + const [_isScreenCapture, setIsScreenCapture] = useState(false) const [isFluencyPriority, setIsFluencyPriority] = useState(false) const [open, setOpen] = useState(false) const [modeOpen, setModeOpen] = useState(false) From b96e5853a160df892165b17d5413195617c21b0e Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 17:54:37 +0800 Subject: [PATCH 21/95] =?UTF-8?q?=E6=AD=A3=E5=9C=A8=E5=BD=95=E5=88=B6?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8=E5=BC=B9=E5=87=BA=E6=98=AF=E5=90=A6=E5=BD=95?= =?UTF-8?q?=E5=88=B6=E4=BC=9A=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 858b5fe..448c23f 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -341,20 +341,25 @@ const Meeting: React.FC = () => { const setting = await JSON.parse(storage.getItem('setting') as string); const stateInfo = await JSON.parse(storage.getItem('stateInfo') as string); if (stateInfo && setting.isRecordingTips && !recorder) { - confirm({ - title: '提示', - icon: , - content: `是否录制本次会议?`, - centered: true, - okText: '确定', - cancelText: '取消', - async onOk() { - changeStatusList({ - title: '录制' - }, 1, 3) - }, - onCancel() { + setRecorder((data: any) => { + if (!data) { + confirm({ + title: '提示', + icon: , + content: `是否录制本次会议?`, + centered: true, + okText: '确定', + cancelText: '取消', + async onOk() { + changeStatusList({ + title: '录制' + }, 1, 3) + }, + onCancel() { + } + }) } + return data }) } }, 10000); From 20b7aadeffacf93862f524f4a7cdee4ccdd2c78a Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 09:25:59 +0800 Subject: [PATCH 22/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B0=8F=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EquipmentManagement/index.tsx | 1 + src/components/StupWizard/index.tsx | 1 + .../Meeting/ChatSmallWindow/index.module.scss | 5 ++++ .../ShareScreenWindow/index.module.scss | 20 ++++++++++++-- src/page/Meeting/ShareScreenWindow/index.tsx | 26 +++++++++++++++++-- src/page/Meeting/index.tsx | 7 +++++ 6 files changed, 56 insertions(+), 4 deletions(-) diff --git a/src/components/EquipmentManagement/index.tsx b/src/components/EquipmentManagement/index.tsx index d9f01f9..53c3c46 100644 --- a/src/components/EquipmentManagement/index.tsx +++ b/src/components/EquipmentManagement/index.tsx @@ -26,6 +26,7 @@ const EquipmentManagement = forwardRef((_props: any, ref: any) => { const isOpen = await getKeyOpenChildWindow('shareScreenWindow') if (isOpen) { window.electron.mainWindowHide() + window.electron.setViewStatus('hide') } setEquipmentManagementModal(false) } diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 38afd49..8f8cb72 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -103,6 +103,7 @@ const StupWizard = forwardRef((props: any, ref: any) => { const isOpen = await getKeyOpenChildWindow('shareScreenWindow') if (isOpen) { window.electron.mainWindowHide() + window.electron.setViewStatus('hide') } setIsStupWizard(false) }} diff --git a/src/page/Meeting/ChatSmallWindow/index.module.scss b/src/page/Meeting/ChatSmallWindow/index.module.scss index e386a8c..c5626e8 100644 --- a/src/page/Meeting/ChatSmallWindow/index.module.scss +++ b/src/page/Meeting/ChatSmallWindow/index.module.scss @@ -60,5 +60,10 @@ >div:nth-child(2) { flex-shrink: 0; + opacity: 0.4; + + &:hover { + opacity: 1; + } } } \ No newline at end of file diff --git a/src/page/Meeting/ShareScreenWindow/index.module.scss b/src/page/Meeting/ShareScreenWindow/index.module.scss index d1f0f36..9f90ed8 100644 --- a/src/page/Meeting/ShareScreenWindow/index.module.scss +++ b/src/page/Meeting/ShareScreenWindow/index.module.scss @@ -32,8 +32,24 @@ cursor: pointer; width: calc(100% / 6); - >img { - height: 24px; + >div { + position: relative; + + >img { + height: 24px; + width: 24px; + } + + >div { + position: absolute; + left: 0; + bottom: 0; + background-repeat: no-repeat; + background-position: bottom center; + background-size: cover; + width: 100%; + height: 0%; + } } >span { diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index f588682..8d9164e 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -59,7 +59,7 @@ const ShareScreenWindow: React.FC = () => { useEffect(() => { getRoomUser() channel.onmessage = function (event) { - const { type, time, roomUserList, footerList } = event.data; + const { type, time, roomUserList, footerList, currentSpeakUserMe } = event.data; const footerListTemplate = [...footerLists]; switch (type) { case 'time': @@ -77,6 +77,12 @@ const ShareScreenWindow: React.FC = () => { footerListTemplate[5].active = footerList[1][3].active; setFooterLists(footerListTemplate) break; + case 'currentSpeakUserMe': + let domMe = document.getElementById(`micr-item-${userInfo.uid}`) as HTMLDivElement; + if (domMe) { + domMe.style.height = `${currentSpeakUserMe}%` + } + break; } } }, []); @@ -105,6 +111,15 @@ const ShareScreenWindow: React.FC = () => { } }) } + // 底部按钮点击效果 + const changeFooterListSelect = (item: any, index: number, bool: boolean): void => { + let arr = ['静音', '解除静音', '关闭视频', '开启视频'] + if (arr.indexOf(item.title) === -1) { + const footerListTemplate = [...footerLists] + footerListTemplate[index].select = bool; + setFooterLists(footerListTemplate) + } + } return ( <>
@@ -114,6 +129,9 @@ const ShareScreenWindow: React.FC = () => { {footerLists.map((item: any, index: number) => { return (
changeFooterListSelect(item, index, true)} + onMouseUp={() => changeFooterListSelect(item, index, false)} + onMouseLeave={() => changeFooterListSelect(item, index, false)} onClick={async () => { switch (item.title) { case '静音': @@ -159,7 +177,11 @@ const ShareScreenWindow: React.FC = () => { } }} key={index}> - {item.select ? : } +
+ {!item.active ?
+
: ''} + {item.select ? : } +
{item.title}{item.title === '成员列表' ? `(${roomUserLists.filter((item: any) => item.isRoom).length})` : ''}
) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 448c23f..409c0d6 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -232,6 +232,7 @@ const Meeting: React.FC = () => { case 'shareScreenWindowSetting': stupWizardRef.current.changeModal(3); window.electron.mainWindowCenter() + window.electron.setViewStatus('show') break; case 'shareScreenWindowfooterListsTitle': switch (shareScreenWindowfooterListsTitle) { @@ -284,6 +285,7 @@ const Meeting: React.FC = () => { case 'shareScreenWindowEquipmentManagement': equipmentManagement(shareScreenWindowEquipmentManagement.uid, shareScreenWindowEquipmentManagement.userName) window.electron.mainWindowCenter() + window.electron.setViewStatus('show') break; case 'chatSmallWindowSendChannelMsg': sendMsg(chatSmallWindowSendChannelMsg.msg) @@ -314,6 +316,7 @@ const Meeting: React.FC = () => { case 'chatBigWindowEquipmentManagement': equipmentManagement(chatBigWindowEquipmentManagement.uid, chatBigWindowEquipmentManagement.userName) window.electron.mainWindowCenter() + window.electron.setViewStatus('show') break; case 'chatBigWindowGetRoomKickout': GetRoomKickout(state.channelId, chatBigWindowGetRoomKickout.uid) @@ -934,6 +937,10 @@ const Meeting: React.FC = () => { if (domMe && !item.uid) { const percentage = (item.volume / 255) * 100 domMe.style.height = `${percentage}%` + channel.postMessage({ + type: 'currentSpeakUserMe', + currentSpeakUserMe: percentage, + }); } }); const uidArr = (speakers.filter((item: any) => item.volume)).map(item => item.uid || userInfo.uid) as number[]; From c66f60d2ab8f22e856bf33636b65af5b5da8ea8c Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 10:43:42 +0800 Subject: [PATCH 23/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/UserListWindow/index.tsx | 48 +++++++++++----------- src/page/Meeting/index.tsx | 49 ++++++++++------------- 2 files changed, 45 insertions(+), 52 deletions(-) diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx index b3bf4bf..963ebda 100644 --- a/src/page/Meeting/UserListWindow/index.tsx +++ b/src/page/Meeting/UserListWindow/index.tsx @@ -1,7 +1,7 @@ import { role } from '@/config/role'; import styles from '@/page/Meeting/UserListWindow/index.module.scss' import ImageUrl from '@/utils/package/imageUrl'; -import { EllipsisOutlined, ExclamationCircleFilled, SearchOutlined } from '@ant-design/icons'; +import { EllipsisOutlined, ExclamationCircleFilled, SearchOutlined, UserAddOutlined, UserDeleteOutlined } from '@ant-design/icons'; import { Button, Input, Modal, Popover } from 'antd'; import Avatar from '@/components/Avatar'; import { useEffect, useState } from "react"; @@ -100,7 +100,7 @@ const UserListWindow: React.FC = () => { uid: item.uid } }); - }} title={item.enableMicr ? '静音' : '解除声音'} /> + }} title={item.enableMicr ? '静音' : '解除静音'} />
: null} {role.ID.includes(item.roleId) || item.isRoomManager ?
{ @@ -113,32 +113,30 @@ const UserListWindow: React.FC = () => { }); }} title={item.enableCamera ? '关闭视频' : '开启视频'} />
: null} + {item.uid !== user.uid && !role.ID.includes(item.roleId) ?
{ + if (item.isRoomManager) { + channel.postMessage({ + type: 'userListWindowDeleteRoomManager', + userListWindowDeleteRoomManager: { + uid: item.uid + } + }); + } else { + channel.postMessage({ + type: 'userListWindowPostRoomManager', + userListWindowPostRoomManager: { + uid: item.uid + } + }); + } + }}> + {!item.isRoomManager ? + : + } +
: null} {item.uid !== user.uid && role.ID.includes(user.roleId) ?
- {!role.ID.includes(item.roleId) ? : null} : null}
}> - +
: null}
From 0939d6154b7f2aeaf943e866dff50efee0b8f5f9 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 11:33:36 +0800 Subject: [PATCH 24/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=A3=E5=9C=A8?= =?UTF-8?q?=E8=AF=B4=E8=AF=9D=E6=96=87=E5=AD=97=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/CurrentSpeakUserWindow/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx index ca34566..b3b42c9 100644 --- a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -22,8 +22,8 @@ const CurrentSpeakUserWindow: React.FC = () => { return ( <>
-
- {inputValue ? `${inputValue}正在说话` : '无人说话'} +
+ {inputValue ? `正在说话:${inputValue}` : '无人说话'}
From 2e438090b84c180ab4ab386d845c651774fd7a06 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 13:47:52 +0800 Subject: [PATCH 25/95] =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icon50.png | Bin 0 -> 430 bytes src/assets/icon51.png | Bin 0 -> 349 bytes src/components/StupWizard/index.tsx | 6 --- src/page/Meeting/ShareScreenWindow/index.tsx | 43 +++++----------- src/page/Meeting/UserListWindow/index.tsx | 44 ++++++++-------- src/page/Meeting/index.tsx | 51 ++++++++++--------- src/utils/package/imageUrl.ts | 4 ++ 7 files changed, 66 insertions(+), 82 deletions(-) create mode 100644 src/assets/icon50.png create mode 100644 src/assets/icon51.png diff --git a/src/assets/icon50.png b/src/assets/icon50.png new file mode 100644 index 0000000000000000000000000000000000000000..9914d40ae5ed496ae161c25cf59213d2f21f6963 GIT binary patch literal 430 zcmV;f0a5;mP)usBLuvk-1-%IL}sQ zU8GPh?GF6B&IRg=$Jz2=B}9_`E##t`cB}E=7Ap)v^IL9QC1GG)Otxh=MO2O&A~a+5 zydkn@S#}hO7nA6*F0@onruE*$F6uFIbx(qtAUzKVm_Tp~rM|uClMrKbokuIt=uA!E z+%k5fkC#4aibHZ*#W@j8t@ZAUEP9!KZ%r3ZxaD#$2`H;s@EAO>jms_Z6__(WU&5(U zi!R`35qhV03=w$UUcbzULVr*#kl=}zLl54IxYT_JuMv7>wDW(CLf3Eu80-^qe1}uu Y7iSQTPqcZjNdN!<07*qoM6N<$f@!a>jQ{`u literal 0 HcmV?d00001 diff --git a/src/assets/icon51.png b/src/assets/icon51.png new file mode 100644 index 0000000000000000000000000000000000000000..1b36b177037988df5bf0668f6c9337425eceafdd GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^f*{Pn1|+R>-G2co&H|6fVg?3oVGw3ym^DWND9BhG zA>8> zVsb1StSt(j9!nHG(qVDGaF2ArD+R}g#h3CUUao(+Oww=KhQ;@FOgSsFbeCK2csFa$ z!7VNsU5~^UN^?!sa$lDHxi!#AMfT#;{A&s+M|#}fcWFKg_FJOQbtCZN)q8(3yPnLt z;_%QW>gBUuyCp?k7m~a`xn_M33b|pRbS!GOhHKBBv@QH%2JdHRYubI~+&cU6hLdTI sdCl7wJ=-%sQ_=GjbNze`l^^W$1pat)m(5;#2Px# literal 0 HcmV?d00001 diff --git a/src/components/StupWizard/index.tsx b/src/components/StupWizard/index.tsx index 8f8cb72..c6ff0ed 100644 --- a/src/components/StupWizard/index.tsx +++ b/src/components/StupWizard/index.tsx @@ -6,7 +6,6 @@ import { agora } from '@/utils/package/agora' import { CloseOutlined, LoadingOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import { storage } from '@/utils'; import path from 'path'; -import { getKeyOpenChildWindow } from '@/utils/package/public'; const fs = require('fs').promises; const { exec } = require('child_process'); @@ -100,11 +99,6 @@ const StupWizard = forwardRef((props: any, ref: any) => { if (location.hash.indexOf('/meeting') === -1) { agora.release() } - const isOpen = await getKeyOpenChildWindow('shareScreenWindow') - if (isOpen) { - window.electron.mainWindowHide() - window.electron.setViewStatus('hide') - } setIsStupWizard(false) }} /> diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index 8d9164e..a69af22 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -1,4 +1,4 @@ -import { GetRoomUser, GetRoomUserItem } from '@/api/Meeting'; +import { GetRoomUser } from '@/api/Meeting'; import { role } from '@/config/role'; import styles from '@/page/Meeting/ShareScreenWindow/index.module.scss' import { storage } from '@/utils'; @@ -36,13 +36,6 @@ const ShareScreenWindow: React.FC = () => { active: false, select: false, }, - { - title: '设置', - icon: ImageUrl.icon28, - iconSelect: ImageUrl.icon28Select, - active: false, - select: false, - }, { title: '录制', icon: ImageUrl.icon27, @@ -73,8 +66,8 @@ const ShareScreenWindow: React.FC = () => { footerListTemplate[0].active = footerList[0][0].active; footerListTemplate[1].title = footerList[0][1].active ? '开启视频' : '关闭视频'; footerListTemplate[1].active = footerList[0][1].active; - footerListTemplate[5].title = footerList[1][3].active ? '录制中' : '录制'; - footerListTemplate[5].active = footerList[1][3].active; + footerListTemplate[4].title = footerList[1][3].active ? '录制中' : '录制'; + footerListTemplate[4].active = footerList[1][3].active; setFooterLists(footerListTemplate) break; case 'currentSpeakUserMe': @@ -90,24 +83,17 @@ const ShareScreenWindow: React.FC = () => { // 获取房间用户 const getRoomUser = async (): Promise => { const data = JSON.parse(storage.getItem('stateInfo') as string) - await GetRoomUserItem(data.channelId, userInfo.uid).then((res: any) => { + await GetRoomUser(data.channelId).then(res => { if (res.code === 200) { - const footerListTemplate = [...footerLists]; - footerListTemplate[0].title = !res.data.enableMicr ? '解除静音' : '静音'; - footerListTemplate[0].active = !res.data.enableMicr; - footerListTemplate[1].title = !res.data.enableCamera ? '开启视频' : '关闭视频'; - footerListTemplate[1].active = !res.data.enableCamera; - setFooterLists(footerListTemplate) - GetRoomUser(data.channelId).then(res => { - if (res.code === 200) { - res.data.forEach((item: any) => { - item.isShow = true; - item.isRoom = true; - item.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager - }) - setRoomUserLists(res.data) - } + res.data.forEach((item: any) => { + item.isShow = true; + item.isRoom = true; + item.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager }) + setRoomUserLists(res.data) + channel.postMessage({ + type: 'shareScreenWindowGetFooterLists', + }); } }) } @@ -145,11 +131,6 @@ const ShareScreenWindow: React.FC = () => { shareScreenWindowfooterListsTitle: item.title }); break; - case '设置': - channel.postMessage({ - type: 'shareScreenWindowSetting' - }); - break; case '聊天': const chatBigWindow = await getKeyOpenChildWindow('chatBigWindow') if (!chatBigWindow) { diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx index 963ebda..8bcd214 100644 --- a/src/page/Meeting/UserListWindow/index.tsx +++ b/src/page/Meeting/UserListWindow/index.tsx @@ -1,7 +1,7 @@ import { role } from '@/config/role'; import styles from '@/page/Meeting/UserListWindow/index.module.scss' import ImageUrl from '@/utils/package/imageUrl'; -import { EllipsisOutlined, ExclamationCircleFilled, SearchOutlined, UserAddOutlined, UserDeleteOutlined } from '@ant-design/icons'; +import { EllipsisOutlined, ExclamationCircleFilled, SearchOutlined } from '@ant-design/icons'; import { Button, Input, Modal, Popover } from 'antd'; import Avatar from '@/components/Avatar'; import { useEffect, useState } from "react"; @@ -91,6 +91,27 @@ const UserListWindow: React.FC = () => {
+ {item.uid !== user.uid && !role.ID.includes(item.roleId) ?
{ + if (item.isRoomManager) { + channel.postMessage({ + type: 'userListWindowDeleteRoomManager', + userListWindowDeleteRoomManager: { + uid: item.uid + } + }); + } else { + channel.postMessage({ + type: 'userListWindowPostRoomManager', + userListWindowPostRoomManager: { + uid: item.uid + } + }); + } + }}> + {!item.isRoomManager ? + : + } +
: null} {role.ID.includes(item.roleId) || item.isRoomManager ?
{ channel.postMessage({ @@ -113,27 +134,6 @@ const UserListWindow: React.FC = () => { }); }} title={item.enableCamera ? '关闭视频' : '开启视频'} />
: null} - {item.uid !== user.uid && !role.ID.includes(item.roleId) ?
{ - if (item.isRoomManager) { - channel.postMessage({ - type: 'userListWindowDeleteRoomManager', - userListWindowDeleteRoomManager: { - uid: item.uid - } - }); - } else { - channel.postMessage({ - type: 'userListWindowPostRoomManager', - userListWindowPostRoomManager: { - uid: item.uid - } - }); - } - }}> - {!item.isRoomManager ? - : - } -
: null} {item.uid !== user.uid && role.ID.includes(user.roleId) ?
diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 3e3a216..3016891 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -4,7 +4,7 @@ import Operation from '@/components/Operation'; import SpeakerModeModal from '@/components/SpeakerModeModal'; import InvitingPersonnelModal from '@/components/InvitingPersonnelModal'; import { Button, Input, Popover, Modal, Checkbox, message, Popconfirm, notification } from "antd"; -import { SearchOutlined, EllipsisOutlined, ExclamationCircleFilled, FullscreenExitOutlined, FullscreenOutlined, QuestionCircleOutlined, UserAddOutlined, UserDeleteOutlined } from '@ant-design/icons'; +import { SearchOutlined, EllipsisOutlined, ExclamationCircleFilled, FullscreenExitOutlined, FullscreenOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import { useLocation, useNavigate } from 'react-router-dom'; import { thumbImageBufferToBase64 } from '@/utils/package/base64' import { storage } from '@/utils'; @@ -229,11 +229,6 @@ const Meeting: React.FC = () => { await stopScreenCapture() await allUserLook(userInfo.uid, userInfo.userName) break; - case 'shareScreenWindowSetting': - stupWizardRef.current.changeModal(3); - window.electron.mainWindowCenter() - window.electron.setViewStatus('show') - break; case 'shareScreenWindowfooterListsTitle': switch (shareScreenWindowfooterListsTitle) { case '静音': @@ -256,6 +251,20 @@ const Meeting: React.FC = () => { break; } break; + case 'shareScreenWindowGetFooterLists': + setFooterList((res: any) => { + channel.postMessage({ + type: 'footerList', + footerList: res, + }); + return res + }) + break; + case 'shareScreenWindowEquipmentManagement': + equipmentManagement(shareScreenWindowEquipmentManagement.uid, shareScreenWindowEquipmentManagement.userName) + window.electron.mainWindowCenter() + window.electron.setViewStatus('show') + break; case 'userListWindowPostOpenMicr': postOpenMicr(userListWindowPostOpenMicr.enableMicr, userListWindowPostOpenMicr.uid) break; @@ -282,11 +291,6 @@ const Meeting: React.FC = () => { case 'userListWindowAllPostOpenMicr': postOpenMicr(false, userInfo.id, true) break; - case 'shareScreenWindowEquipmentManagement': - equipmentManagement(shareScreenWindowEquipmentManagement.uid, shareScreenWindowEquipmentManagement.userName) - window.electron.mainWindowCenter() - window.electron.setViewStatus('show') - break; case 'chatSmallWindowSendChannelMsg': sendMsg(chatSmallWindowSendChannelMsg.msg) break; @@ -2229,16 +2233,6 @@ const Meeting: React.FC = () => {
- {role.ID.includes(item.roleId) || item.isRoomManager ?
- { - postOpenMicr(!item.enableMicr, item.uid) - }} title={item.enableMicr ? '静音' : '解除静音'} /> -
: null} - {role.ID.includes(item.roleId) || item.isRoomManager ?
- { - postOpenCamera(!item.enableCamera, item.uid) - }} title={item.enableCamera ? '关闭视频' : '开启视频'} /> -
: null} {item.uid !== user.uid && !role.ID.includes(item.roleId) ?
{ if (item.isRoomManager) { DeleteRoomManager({ @@ -2255,8 +2249,19 @@ const Meeting: React.FC = () => { } }}> {!item.isRoomManager ? - : - } + : + + } +
: null} + {role.ID.includes(item.roleId) || item.isRoomManager ?
+ { + postOpenMicr(!item.enableMicr, item.uid) + }} title={item.enableMicr ? '静音' : '解除静音'} /> +
: null} + {role.ID.includes(item.roleId) || item.isRoomManager ?
+ { + postOpenCamera(!item.enableCamera, item.uid) + }} title={item.enableCamera ? '关闭视频' : '开启视频'} />
: null} {item.uid !== user.uid && role.ID.includes(user.roleId) ?
Date: Wed, 16 Oct 2024 14:04:00 +0800 Subject: [PATCH 26/95] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShareScreenWindow/index.module.scss | 20 +++++++++++++++++-- src/page/Meeting/ShareScreenWindow/index.tsx | 15 ++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/page/Meeting/ShareScreenWindow/index.module.scss b/src/page/Meeting/ShareScreenWindow/index.module.scss index 9f90ed8..7f5136c 100644 --- a/src/page/Meeting/ShareScreenWindow/index.module.scss +++ b/src/page/Meeting/ShareScreenWindow/index.module.scss @@ -1,5 +1,4 @@ .shareScreenWindow { - background-color: #07090B; color: white; height: 100%; width: 100%; @@ -12,13 +11,30 @@ padding: 4px; box-sizing: border-box; background-color: lighten(#07090B, 4%); + display: flex; + justify-content: space-between; + align-items: center; + + >span:nth-child(2) { + cursor: pointer; + background-color: #FF5219; + padding: 1px 10px; + border-radius: 2px; + font-size: 12px; + } } .shareScreenWindowContent { flex-grow: 1; - display: flex; align-items: center; justify-content: space-between; + opacity: 0; + background-color: #07090B; + display: flex; + + &:hover { + opacity: 1 !important; + } .shareScreenWindowContentList { display: flex; diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index a69af22..c4a08d1 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -46,6 +46,7 @@ const ShareScreenWindow: React.FC = () => { }, ]) const [time, setTime] = useState('') + const [isHover, setIsHover] = useState(true) const [roomUserLists, setRoomUserLists] = useState([]) const channel = new BroadcastChannel('meeting_channel'); const userInfo = JSON.parse(storage.getItem('user') as string) @@ -109,8 +110,18 @@ const ShareScreenWindow: React.FC = () => { return ( <>
-
{time} 共享中
-
+
+ {time} 共享中 + {isHover ? { + channel.postMessage({ + type: 'shareScreenWindowClose' + }); + }}>结束共享 : null} +
+
setIsHover(false)} + onMouseLeave={() => setIsHover(true)} + >
{footerLists.map((item: any, index: number) => { return ( From 6fb7020836f53fd72714e819b292a9cd48d262dd Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 14:53:14 +0800 Subject: [PATCH 27/95] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EquipmentManagement/index.tsx | 38 +++++++++++++------- src/page/Meeting/ChatBigWindow/index.tsx | 30 +++++++++++----- src/page/Meeting/ShareScreenWindow/index.tsx | 4 +-- src/page/Meeting/UserListWindow/index.tsx | 32 +++++++++++------ src/page/Meeting/index.tsx | 30 +++++++++------- 5 files changed, 87 insertions(+), 47 deletions(-) diff --git a/src/components/EquipmentManagement/index.tsx b/src/components/EquipmentManagement/index.tsx index 53c3c46..af17d93 100644 --- a/src/components/EquipmentManagement/index.tsx +++ b/src/components/EquipmentManagement/index.tsx @@ -3,14 +3,21 @@ import { getKeyOpenChildWindow } from '@/utils/package/public'; import { onInvoke } from '@/utils/package/signalr'; import { Button, Modal, Select, Slider, message } from 'antd'; import { useState, useImperativeHandle, forwardRef } from "react"; -const EquipmentManagement = forwardRef((_props: any, ref: any) => { +const EquipmentManagement = forwardRef((props: any, ref: any) => { useImperativeHandle(ref, () => ({ changeModal: async (uid: string, userName: string) => { setCallerUid(uid) setDeviceInfo({}) - await onInvoke('getDrivers', { - uid - }) + let isOpen = await getKeyOpenChildWindow('shareScreenWindow') + if (isOpen) { + if (props.getDriver) { + props.getDriver(uid) + } + } else { + await onInvoke('getDrivers', { + uid + }) + } setUserName(userName) setEquipmentManagementModal(true) }, @@ -23,11 +30,6 @@ const EquipmentManagement = forwardRef((_props: any, ref: any) => { const [deviceInfo, setDeviceInfo] = useState({}) const [userName, setUserName] = useState({}) const handleWindowsChange = async (): Promise => { - const isOpen = await getKeyOpenChildWindow('shareScreenWindow') - if (isOpen) { - window.electron.mainWindowHide() - window.electron.setViewStatus('hide') - } setEquipmentManagementModal(false) } return ( @@ -92,10 +94,20 @@ const EquipmentManagement = forwardRef((_props: any, ref: any) => {
diff --git a/src/page/Meeting/ChatBigWindow/index.tsx b/src/page/Meeting/ChatBigWindow/index.tsx index c33f626..7dd53b2 100644 --- a/src/page/Meeting/ChatBigWindow/index.tsx +++ b/src/page/Meeting/ChatBigWindow/index.tsx @@ -1,6 +1,6 @@ import styles from '@/page/Meeting/ChatBigWindow/index.module.scss' import ImageUrl from '@/utils/package/imageUrl'; -import { useEffect, useState } from "react"; +import { useEffect, useState, useRef } from "react"; import { storage } from '@/utils'; import { setKeyOpenChildWindow } from '@/utils/package/public'; import { Button, Input, Modal, Popover } from 'antd'; @@ -9,6 +9,7 @@ import { GetRoomUserItem } from '@/api/Meeting'; import Avatar from '@/components/Avatar'; import dayjs from 'dayjs'; import { ExclamationCircleFilled } from '@ant-design/icons'; +import EquipmentManagement from '@/components/EquipmentManagement'; const { confirm } = Modal; const ChatBigWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') @@ -21,13 +22,14 @@ const ChatBigWindow: React.FC = () => { '听不到', '我要发言', ]) + const equipmentManagementRef = useRef(); const userInfo = JSON.parse(storage.getItem('user') as string) const stateInfo = JSON.parse(storage.getItem('stateInfo') as string) const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { setUser(userInfo) channel.onmessage = function (event) { - const { type, chatList } = event.data; + const { type, chatList, showDriverList } = event.data; switch (type) { case 'chatList': setChatLists(chatList) @@ -38,6 +40,9 @@ const ChatBigWindow: React.FC = () => { } }, 100) break; + case 'showDriverList': + equipmentManagementRef.current.setData(showDriverList) + break; } } }, []); @@ -160,13 +165,7 @@ const ChatBigWindow: React.FC = () => { className='m-ant-btn' size={'small'} onClick={() => { - channel.postMessage({ - type: 'chatBigWindowEquipmentManagement', - chatBigWindowEquipmentManagement: { - uid: roomUserItem.uid, - userName: roomUserItem.userName - } - }); + equipmentManagementRef.current.changeModal(item.uid, item.userName) }} >设备管理 : null} {roomUserItem.uid !== user.uid ?
+ { + channel.postMessage({ + type: 'userListWindowEquipmentManagement', + userListWindowEquipmentManagement: { + uid + } + }); + }} setDriver={(data: any) => { + channel.postMessage({ + type: 'userListWindowSetEquipmentManagement', + userListWindowSetEquipmentManagement: data + }); + }} /> ) } diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index c4a08d1..8e8aa13 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -147,7 +147,7 @@ const ShareScreenWindow: React.FC = () => { if (!chatBigWindow) { window.electron.createChildWindow({ url: location.origin + `/#/chatBigWindow`, - width: 440, + width: 540, height: 640, key: 'chatBigWindow', }) @@ -159,7 +159,7 @@ const ShareScreenWindow: React.FC = () => { if (!userListWindow) { window.electron.createChildWindow({ url: location.origin + `/#/userListWindow`, - width: 340, + width: 440, height: 540, key: 'userListWindow', }) diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx index 8bcd214..bb7f958 100644 --- a/src/page/Meeting/UserListWindow/index.tsx +++ b/src/page/Meeting/UserListWindow/index.tsx @@ -4,27 +4,32 @@ import ImageUrl from '@/utils/package/imageUrl'; import { EllipsisOutlined, ExclamationCircleFilled, SearchOutlined } from '@ant-design/icons'; import { Button, Input, Modal, Popover } from 'antd'; import Avatar from '@/components/Avatar'; -import { useEffect, useState } from "react"; +import { useEffect, useState, useRef } from "react"; import { storage } from '@/utils'; import { GetRoomUser } from '@/api/Meeting'; import { setKeyOpenChildWindow } from '@/utils/package/public'; +import EquipmentManagement from '@/components/EquipmentManagement'; const { confirm } = Modal; const UserListWindow: React.FC = () => { const [userSearchValue, setUserSearchValue] = useState('') const [user, setUser] = useState({}); const [roomUserList, setRoomUserList] = useState([]) + const equipmentManagementRef = useRef(); const channel = new BroadcastChannel('meeting_channel'); const userInfo = JSON.parse(storage.getItem('user') as string) useEffect(() => { setUser(userInfo) getRoomUser() channel.onmessage = function (event) { - const { type, roomUserList } = event.data; + const { type, roomUserList, showDriverList } = event.data; switch (type) { case 'roomUserList': setRoomUserList(roomUserList) break; + case 'showDriverList': + equipmentManagementRef.current.setData(showDriverList) + break; } } }, []); @@ -143,15 +148,7 @@ const UserListWindow: React.FC = () => { style={{ width: '100%' }} size={'small'} onClick={() => { - channel.postMessage({ - type: 'shareScreenWindowEquipmentManagement', - shareScreenWindowEquipmentManagement: { - uid: item.uid, - userName: item.userName, - } - }); - window.electron.closeChildWindow('userListWindow') - setKeyOpenChildWindow('userListWindow', false) + equipmentManagementRef.current.changeModal(item.uid, item.userName) }} >设备管理
+ { + channel.postMessage({ + type: 'userListWindowEquipmentManagement', + userListWindowEquipmentManagement: { + uid + } + }); + }} setDriver={(data: any) => { + channel.postMessage({ + type: 'userListWindowSetEquipmentManagement', + userListWindowSetEquipmentManagement: data + }); + }} /> ) } diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 3016891..4b6b48a 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -212,14 +212,14 @@ const Meeting: React.FC = () => { userListWindowDeleteRoomManager, userListWindowPostRoomManager, userListWindowGetRoomKickout, - shareScreenWindowEquipmentManagement, + userListWindowEquipmentManagement, + userListWindowSetEquipmentManagement, chatSmallWindowSendChannelMsg, chatBigWindowSetAllUserLook, chatBigWindowDeleteRoomManager, chatBigWindowPostRoomManager, chatBigWindowPostOpenMicr, chatBigWindowPostOpenCamera, - chatBigWindowEquipmentManagement, chatBigWindowGetRoomKickout, chatBigWindowSendChannelMsg, noticeWindowPostRoomManager @@ -260,10 +260,16 @@ const Meeting: React.FC = () => { return res }) break; - case 'shareScreenWindowEquipmentManagement': - equipmentManagement(shareScreenWindowEquipmentManagement.uid, shareScreenWindowEquipmentManagement.userName) - window.electron.mainWindowCenter() - window.electron.setViewStatus('show') + case 'userListWindowEquipmentManagement': + await onInvoke('getDrivers', { + uid: userListWindowEquipmentManagement.uid, + }) + break; + case 'userListWindowSetEquipmentManagement': + await onInvoke('setDrivers', { + uid: userListWindowSetEquipmentManagement.uid, + driversJsonString: userListWindowSetEquipmentManagement.driversJsonString + }) break; case 'userListWindowPostOpenMicr': postOpenMicr(userListWindowPostOpenMicr.enableMicr, userListWindowPostOpenMicr.uid) @@ -317,11 +323,6 @@ const Meeting: React.FC = () => { case 'chatBigWindowPostOpenCamera': postOpenCamera(chatBigWindowPostOpenCamera.enableCamera, chatBigWindowPostOpenCamera.uid) break; - case 'chatBigWindowEquipmentManagement': - equipmentManagement(chatBigWindowEquipmentManagement.uid, chatBigWindowEquipmentManagement.userName) - window.electron.mainWindowCenter() - window.electron.setViewStatus('show') - break; case 'chatBigWindowGetRoomKickout': GetRoomKickout(state.channelId, chatBigWindowGetRoomKickout.uid) break; @@ -764,7 +765,12 @@ const Meeting: React.FC = () => { case 'ShowDriverList': if (item.driversJsonString) { const data = JSON.parse(item.driversJsonString); - equipmentManagementRef.current.setData(data) + const isOpen = await getKeyOpenChildWindow('shareScreenWindow') + if (isOpen) { + channel.postMessage({ type: 'showDriverList', showDriverList: data }) + } else { + equipmentManagementRef.current.setData(data) + } } break; } From bcd3adaf26cb68b1491ad7daea27f9d814da148d Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 15:04:19 +0800 Subject: [PATCH 28/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EquipmentManagement/index.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/components/EquipmentManagement/index.tsx b/src/components/EquipmentManagement/index.tsx index af17d93..2872586 100644 --- a/src/components/EquipmentManagement/index.tsx +++ b/src/components/EquipmentManagement/index.tsx @@ -10,9 +10,7 @@ const EquipmentManagement = forwardRef((props: any, ref: any) => { setDeviceInfo({}) let isOpen = await getKeyOpenChildWindow('shareScreenWindow') if (isOpen) { - if (props.getDriver) { - props.getDriver(uid) - } + props.getDriver?.(uid) } else { await onInvoke('getDrivers', { uid @@ -96,12 +94,10 @@ const EquipmentManagement = forwardRef((props: any, ref: any) => { +
} +
{ + setIsExpand(!isExpand) + window.electron.setChildWindow({ + width: isExpand ? 440 : 440 / 2, + height: 80, + key: 'shareScreenWindow', + }) + }}> + {isExpand ? '展开' : '收起'} + {isExpand ? : }
diff --git a/src/page/Meeting/index.module.scss b/src/page/Meeting/index.module.scss index 262c256..cbb972d 100644 --- a/src/page/Meeting/index.module.scss +++ b/src/page/Meeting/index.module.scss @@ -937,6 +937,7 @@ width: 144px; height: 94px; box-sizing: border-box; + border: 5px solid transparent; >img { width: 100%; @@ -953,14 +954,16 @@ &:hover { >div { - border: 1px solid #EBEBEB; + border: 5px solid yellow; + box-sizing: border-box; } } } .active { >div { - border: 1px solid #EBEBEB; + border: 5px solid yellow; + box-sizing: border-box; } } } diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 917c431..84247ed 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1512,14 +1512,14 @@ const Meeting: React.FC = () => { if (!isOpen) { window.electron.createChildWindow({ url: location.origin + `/#/shareScreenWindow`, - width: 540, - height: 70, + width: 400, + height: 80, key: 'shareScreenWindow', }) window.electron.createChildWindow({ url: location.origin + `/#/chatSmallWindow`, width: 200, - height: 300, + height: 150, key: 'chatSmallWindow', }) window.electron.createChildWindow({ diff --git a/src/render.d.ts b/src/render.d.ts index 7c85640..71555a0 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -19,6 +19,7 @@ export interface IElectronAPI { setRegistry: (uuid: string) => any; getRegistry: () => any; createChildWindow: (config: any) => void; + setChildWindow: (config: any) => void; closeChildWindow: (key: string) => void; mainWindowCenter: () => any; mainWindowHide: () => any; From 5125b83a9312475a792cbd11f1d66562dcf27ea2 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 16:44:57 +0800 Subject: [PATCH 31/95] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main.js b/main.js index 832fda1..a3b35f1 100644 --- a/main.js +++ b/main.js @@ -348,12 +348,7 @@ app.on('ready', () => { }); // 设置子窗口 ipcMain.handle('setChildWindow', (event, config) => { - const child = childWindow[config.key]; - const display = screen.getDisplayMatching({ ...child.getBounds() }); - const { width, height } = display.size - let x, y; if (config.key === 'shareScreenWindow') { - x = Math.round((width - config.width) / 2); childWindow[config.key].setBounds({ width: config.width }) } }); From 488f4e27639d7ebe3e8463d92c41fd8f21172408 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 16:53:41 +0800 Subject: [PATCH 32/95] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ShareScreenWindow/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index 8e93a31..87a27d7 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -189,7 +189,6 @@ const ShareScreenWindow: React.FC = () => { setIsExpand(!isExpand) window.electron.setChildWindow({ width: isExpand ? 440 : 440 / 2, - height: 80, key: 'shareScreenWindow', }) }}> From 747fd4d25fa66e5dd019cf54ad45874d59054b0d Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 17:42:02 +0800 Subject: [PATCH 33/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ShareScreenWindow/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index 87a27d7..8024848 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -152,7 +152,7 @@ const ShareScreenWindow: React.FC = () => { setKeyOpenChildWindow('chatBigWindow', true) } break; - case '成员列表': + case '成员': const userListWindow = await getKeyOpenChildWindow('userListWindow') if (!userListWindow) { window.electron.createChildWindow({ From 6b653becd95316e6f7c26f5b5f6815cab7610988 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 17:47:19 +0800 Subject: [PATCH 34/95] =?UTF-8?q?=E6=89=93=E5=BC=80=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E4=B8=8A=E6=AC=A1=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ChatBigWindow/index.tsx | 6 ++++++ src/page/Meeting/index.tsx | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/page/Meeting/ChatBigWindow/index.tsx b/src/page/Meeting/ChatBigWindow/index.tsx index 7dd53b2..dc1009f 100644 --- a/src/page/Meeting/ChatBigWindow/index.tsx +++ b/src/page/Meeting/ChatBigWindow/index.tsx @@ -45,6 +45,12 @@ const ChatBigWindow: React.FC = () => { break; } } + channel.postMessage({ + type: 'chatBigWindowSendChannelMsg', + chatBigWindowSendChannelMsg: { + msg: '', + } + }); }, []); return ( diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 84247ed..e87ab5e 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -327,7 +327,17 @@ const Meeting: React.FC = () => { GetRoomKickout(state.channelId, chatBigWindowGetRoomKickout.uid) break; case 'chatBigWindowSendChannelMsg': - sendMsg(chatBigWindowSendChannelMsg.msg) + if (chatBigWindowSendChannelMsg.msg) { + sendMsg(chatBigWindowSendChannelMsg.msg) + } else[ + setChatList((res: any) => { + channel.postMessage({ + type: 'chatList', + chatList: res, + }) + return res + }) + ] break; case 'noticeWindowPostRoomManager': postRoomManager({ From 29b06d790357c7ae0f3a776c84943155079bda84 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Wed, 16 Oct 2024 17:57:52 +0800 Subject: [PATCH 35/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/JoinSetting/index.tsx | 18 ++++++++++++------ src/page/Meeting/index.tsx | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/JoinSetting/index.tsx b/src/components/JoinSetting/index.tsx index 6a11b2a..fe0cffb 100644 --- a/src/components/JoinSetting/index.tsx +++ b/src/components/JoinSetting/index.tsx @@ -12,20 +12,26 @@ import { role } from '@/config/role'; let time = null as any; const JoinSetting = forwardRef((_props: any, ref: any) => { useImperativeHandle(ref, () => ({ - changeModal: (roomNum: string = '') => { + changeModal: async (roomNum: string = '') => { let userInfo = JSON.parse(storage.getItem('user') as string) setUser(userInfo) setJoinRoomSettingModal(true) + if (location.hash.indexOf('/meeting') === -1) { + await agora.init() + } setJoinRoomSettingForm((res: any) => { - res.forEach((item: any) => { - item.active = false + res.forEach((item: any, index: number) => { + if (index === 0) { + agora.getAudioMediaList().then(res => { + item.active = res.ecordingList.length ? true : false + }) + } else { + item.active = false + } }); return res }) setRoomNumber(roomNum) - if (location.hash.indexOf('/meeting') === -1) { - agora.init() - } getDeviceList() } })) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index e87ab5e..c8bd9e8 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -595,7 +595,7 @@ const Meeting: React.FC = () => { message.success(`操作成功`) await agora.updateChannelMediaOptions(item.user.isRoomManager) await postOpenMicrApi(item.user.isRoomManager, userInfo.uid, false) - await postOpenCameraApi(item.user.isRoomManager, userInfo.uid) + await postOpenCameraApi(false, userInfo.uid) // 不管身份如何改变都关闭摄像头 await stopScreenCapture() } else { message.success(`${item.user.userName}已结束发言`) From dfe7fafc137cf9862382dc52ee9333e828e8f3a9 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 09:11:51 +0800 Subject: [PATCH 36/95] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/JoinSetting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/JoinSetting/index.tsx b/src/components/JoinSetting/index.tsx index fe0cffb..a892189 100644 --- a/src/components/JoinSetting/index.tsx +++ b/src/components/JoinSetting/index.tsx @@ -21,7 +21,7 @@ const JoinSetting = forwardRef((_props: any, ref: any) => { } setJoinRoomSettingForm((res: any) => { res.forEach((item: any, index: number) => { - if (index === 0) { + if (index === 0 && role.ID.includes(user.roleId)) { agora.getAudioMediaList().then(res => { item.active = res.ecordingList.length ? true : false }) From d12ef5c6330e040d1221ea303f56f382acb2902f Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 09:31:14 +0800 Subject: [PATCH 37/95] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main.js b/main.js index a3b35f1..b6b42f2 100644 --- a/main.js +++ b/main.js @@ -113,11 +113,6 @@ function createWindow() { mainWindow.focus(); } const additionalData = { myKey: 'myValue' } -// 退出房间 -app.on('will-quit', async (event) => { - await mainWindow.webContents.send('quitAndInstall'); -}); - app.on('ready', () => { const gotTheLock = app.requestSingleInstanceLock(additionalData) if (gotTheLock) { From b01a0a2035d25b16a6b452747221aeb06ca2d04c Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 09:35:45 +0800 Subject: [PATCH 38/95] =?UTF-8?q?=E9=A6=96=E6=AC=A1=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index c8bd9e8..76466fb 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -355,6 +355,13 @@ const Meeting: React.FC = () => { time: changeCurrentSeconds(), }); }, 1000) + // 首次加载图标更新 + const firstFooterList = [...footerList] + firstFooterList[0][0].title = state.enableMicr ? '静音' : '解除静音' + firstFooterList[0][0].active = !state.enableMicr + firstFooterList[0][1].title = state.enableCamera ? '关闭视频' : '开启视频' + firstFooterList[0][1].active = !state.enableCamera + setFooterList(firstFooterList) setTimeout(async () => { const setting = await JSON.parse(storage.getItem('setting') as string); const stateInfo = await JSON.parse(storage.getItem('stateInfo') as string); From c0b55cd062e5d296548e2dee3f13b89ff547406f Mon Sep 17 00:00:00 2001 From: youngq Date: Thu, 17 Oct 2024 09:55:28 +0800 Subject: [PATCH 39/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ChatBigWindow/index.tsx | 2 +- src/page/Meeting/UserListWindow/index.tsx | 4 ++-- src/page/Meeting/index.tsx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/page/Meeting/ChatBigWindow/index.tsx b/src/page/Meeting/ChatBigWindow/index.tsx index dc1009f..56025b5 100644 --- a/src/page/Meeting/ChatBigWindow/index.tsx +++ b/src/page/Meeting/ChatBigWindow/index.tsx @@ -125,7 +125,7 @@ const ChatBigWindow: React.FC = () => { } }) }} - >{roomUserItem.isRoomManager ? '取消发言人' : '设为发言人'} : null} + >{roomUserItem.isRoomManager ? '取消发言' : '允许发言'} : null} {roomUserItem.isRoomManager ?
: null} {role.ID.includes(item.roleId) || item.isRoomManager ?
{ diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index c8bd9e8..5752c38 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -2085,7 +2085,7 @@ const Meeting: React.FC = () => { }) } }} - >{item.isRoomManager ? '取消发言人' : '设为发言人'} : null} + >{item.isRoomManager ? '取消发言' : '允许发言'} : null} {item.isRoomManager ?
: null} {role.ID.includes(item.roleId) || item.isRoomManager ?
@@ -2390,7 +2390,7 @@ const Meeting: React.FC = () => { } }) }} - >{roomUserItem.isRoomManager ? '取消发言人' : '设为发言人'} : null} + >{roomUserItem.isRoomManager ? '取消发言' : '允许发言'} : null} {roomUserItem.isRoomManager ?
+ +
+
+ {role.ID.includes(user.roleId) ? + { + await GetLeaveAll({ + roomNum: state.channelId, + }) + window.electron.quit(true) + }} + onCancel={() => { + + }} + okText="结束" + cancelText="取消" + > +
全员结束会议
+
+ : null} +
{ + await leaveChannel() + window.electron.quit(true) + }}>仅自己离开
+
{ setQuitMeetingModal(false) }}>取消
+
+
+
diff --git a/src/render.d.ts b/src/render.d.ts index 71555a0..4b1e285 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -12,7 +12,7 @@ export interface IElectronAPI { selectFilePath: (data?: any) => void onFilePath: (callBack: Function) => void; getSources: () => any; - quit: () => any; + quit: (bool) => any; downFile: (callBack: Function) => void; quitAndInstall: (callBack: Function) => void; getVersion: () => Promise; From 71d5ddffeabc1a778f48c4bf094411d8c45f0019 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 11:32:20 +0800 Subject: [PATCH 42/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/NoticeWindow/index.tsx | 2 +- src/page/Meeting/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/page/Meeting/NoticeWindow/index.tsx b/src/page/Meeting/NoticeWindow/index.tsx index dcf0e96..4748d54 100644 --- a/src/page/Meeting/NoticeWindow/index.tsx +++ b/src/page/Meeting/NoticeWindow/index.tsx @@ -83,7 +83,7 @@ const NoticeWindow: React.FC = () => { setKeyOpenChildWindow('noticeWindow', false) } }, 1000) - }, 3000); + }, 4000); return () => { clearInterval(time) }; diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index fbbe1cc..20d507e 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -656,7 +656,7 @@ const Meeting: React.FC = () => { type: 'noticeItem', noticeItem: item }); - }, 1000); + }, 2000); setKeyOpenChildWindow('noticeWindow', true) } } else { From bbc57b51854a5a75caf7470105e1d8a6f1ce32c8 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 11:37:01 +0800 Subject: [PATCH 43/95] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 20d507e..a2d780d 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -362,6 +362,7 @@ const Meeting: React.FC = () => { firstFooterList[0][0].active = !state.enableMicr firstFooterList[0][1].title = state.enableCamera ? '关闭视频' : '开启视频' firstFooterList[0][1].active = !state.enableCamera + agora.muteLocalVideoStream(userInfo, state.enableMicr, state.enableCamera) setFooterList(firstFooterList) setTimeout(async () => { const setting = await JSON.parse(storage.getItem('setting') as string); From 58facc62ea0053ca70783f9492be15b04848eefe Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 12:21:33 +0800 Subject: [PATCH 44/95] =?UTF-8?q?=E6=AF=8F10=E7=A7=92=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E9=A1=B9=E8=81=8A=E5=A4=A9=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ChatSmallWindow/index.tsx | 17 ++++++++++++----- src/page/Meeting/index.tsx | 13 +++++++++++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index 6370a9f..3848677 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -1,18 +1,22 @@ import styles from '@/page/Meeting/ChatSmallWindow/index.module.scss' import { Input } from 'antd'; import { useEffect, useState } from "react"; -import { storage } from '@/utils'; const ChatSmallWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') const [chatLists, setChatLists] = useState([]) - const userInfo = JSON.parse(storage.getItem('user') as string) const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { + let time: NodeJS.Timeout; + time = setInterval(() => { + setChatLists((res: any) => { + return res.length ? res.slice(0, -1) : res + }) + }, 10000) channel.onmessage = function (event) { - const { type, chatList } = event.data; + const { type, chatListIten } = event.data; switch (type) { - case 'chatList': - setChatLists(chatList.reverse()) + case 'chatListIten': + setChatLists((newChatList: any) => [chatListIten, ...newChatList]) setTimeout(() => { const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; if (chatSmallWindowView) { @@ -22,6 +26,9 @@ const ChatSmallWindow: React.FC = () => { break; } } + return () => { + clearTimeout(time) + } }, []); diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index a2d780d..ef8a8b5 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -509,6 +509,10 @@ const Meeting: React.FC = () => { setNoViewChatList(storageNoViewChatList) } setChatList((newChatList: any) => [...newChatList, item]) + channel.postMessage({ + type: 'chatListIten', + chatListIten: item, + }); setStatusList((res: any) => { if (!res.userChatList) { api.open({ @@ -1673,12 +1677,17 @@ const Meeting: React.FC = () => { roomNum: state.channelId, msg: msg, }) - setChatList((newChatList: any) => [...newChatList, { + let item = { uid: userInfo.uid, userName: userInfo.userName, message: msg, timestamp: +new Date() - }]) + } + setChatList((newChatList: any) => [...newChatList, item]) + channel.postMessage({ + type: 'chatListIten', + chatListIten: item, + }); setTextMsg(''); chatScrollBotton() } else { From 2389c7c48acdc9f04ea79aa363a82b839f080c97 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 14:10:42 +0800 Subject: [PATCH 45/95] =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Operation/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Operation/index.tsx b/src/components/Operation/index.tsx index 7f7ba5d..fa55f90 100644 --- a/src/components/Operation/index.tsx +++ b/src/components/Operation/index.tsx @@ -46,7 +46,11 @@ const Operation: React.FC = () => { key: 'quit', title: '关闭', onClick: (key: OperationKeyType) => { - window.electron.setViewStatus(key) + if (location.hash.indexOf('/meeting') === -1) { + window.electron.setViewStatus(key) + } else { + window.electron.quit(false) + } }, show: true, },]) From a99194b067230a77cad4a4c3012b6f0853ec7ec5 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 14:31:27 +0800 Subject: [PATCH 46/95] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ChatSmallWindow/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index 3848677..329dff1 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -36,8 +36,8 @@ const ChatSmallWindow: React.FC = () => { <>
- {chatLists.map((item: any) => -
+ {chatLists.map((item: any, index: number) => +
{item.userName}: {item.message} From 0776b9313059d456ab064d9242709048c8ee4807 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 15:37:53 +0800 Subject: [PATCH 47/95] =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=B8=8A=E4=B8=80=E4=B8=AA=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index ef8a8b5..3484f20 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -2758,7 +2758,6 @@ const Meeting: React.FC = () => { await GetLeaveAll({ roomNum: state.channelId, }) - window.electron.quit(true) }} onCancel={() => { @@ -2771,7 +2770,6 @@ const Meeting: React.FC = () => { : null}
{ await leaveChannel() - window.electron.quit(true) }}>仅自己离开
{ setQuitMeetingModal(false) }}>取消
From 78c1dd50262de3782907a7716c156daaef2db5b6 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 17:17:26 +0800 Subject: [PATCH 48/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 17 +++++++++++------ preload.js | 8 ++++++++ src/App.tsx | 12 ++++++++++++ src/render.d.ts | 2 ++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index a7729e1..5202b0e 100644 --- a/main.js +++ b/main.js @@ -57,14 +57,17 @@ function showWindow() { // 如果主窗口已经存在但被最小化了,则恢复显示 if (mainWindow && mainWindow.isMinimized()) { mainWindow.show(); + console.log(3); } // 如果主窗口已存在但不是焦点窗口,则将其置为焦点 if (mainWindow && !mainWindow.isFocused()) { + console.log(2); mainWindow.show(); mainWindow.focus(); } // 如果主窗口还没有被创建,则创建它 if (!mainWindow) { + console.log(1); createWindow(); } } @@ -80,7 +83,7 @@ function createTray() { const contextMenu = Menu.buildFromTemplate([ { label: '打开', click: () => { - showWindow() + mainWindow.webContents.send('isOpenWindows'); }, // icon: iconPath, }, @@ -108,11 +111,7 @@ function createTray() { tray.setToolTip('智汇享'); tray.setContextMenu(contextMenu); tray.on('click', () => { - if (mainWindow.isVisible()) { - mainWindow.hide() - } else { - mainWindow.show() - } + mainWindow.webContents.send('isOpenWindows'); }); } @@ -191,6 +190,7 @@ app.on('ready', () => { break; case 'show': mainWindow.show() + mainWindow.focus(); break; } }); @@ -202,6 +202,10 @@ app.on('ready', () => { ipcMain.handle('getVersion', () => { return app.getVersion(); }); + // 获取窗口是否显示 + ipcMain.handle('isVisible', () => { + return mainWindow.isVisible(); + }); // 获取共享屏幕列表 ipcMain.handle('getSources', async () => { return await desktopCapturer.getSources({ @@ -327,6 +331,7 @@ app.on('ready', () => { child.once('ready-to-show', () => { childWindow[config.key].show() childWindow[config.key].setAlwaysOnTop(true, 'pop-up-menu') + childWindow[config.key].setSkipTaskbar(true) windowOperation(config) }) child.webContents.on('before-input-event', (event, input) => { diff --git a/preload.js b/preload.js index 9df37fc..7613583 100644 --- a/preload.js +++ b/preload.js @@ -21,6 +21,10 @@ window.electron = { getVersion: () => { return ipcRenderer.invoke('getVersion') }, + // 获取窗口是否显示 + isVisible: () => { + return ipcRenderer.invoke('isVisible') + }, // 获取共享屏幕列表 getSources: () => { return ipcRenderer.invoke('getSources') @@ -49,6 +53,10 @@ window.electron = { quitAndInstall: (callback) => { ipcRenderer.on('quitAndInstall', callback) }, + // 点击任务栏图标是否打开窗口 + isOpenWindows: (callback) => { + ipcRenderer.on('isOpenWindows', callback) + }, // 通知下载最新的包 onDownload: (type) => { ipcRenderer.invoke('updateDownload', type) diff --git a/src/App.tsx b/src/App.tsx index ad304bb..5a2944b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -24,6 +24,7 @@ import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow"; import ChatBigWindow from "@/page/Meeting/ChatBigWindow"; import CurrentSpeakUserWindow from "@/page/Meeting/CurrentSpeakUserWindow"; import NoticeWindow from "@/page/Meeting/NoticeWindow"; +import { getKeyOpenChildWindow } from "./utils/package/public"; const fs = require('fs').promises; const { exec } = require('child_process'); const App: React.FC = () => { @@ -105,6 +106,17 @@ const App: React.FC = () => { window.electron.quitAndInstall(async (_e: any) => { storage.setItem('quitMeeting', true) }) + window.electron.isOpenWindows(async (_e: any) => { + let bool = await window.electron.isVisible() + if (location.hash.indexOf('/meeting') === -1) { + window.electron.setViewStatus(bool ? 'hide' : 'show') + } else { + let shareScreenWindow = await getKeyOpenChildWindow('shareScreenWindow') + if (!shareScreenWindow) { + window.electron.setViewStatus(bool ? 'hide' : 'show') + } + } + }) }, []) useEffect(() => { window.electron.onUpdate((_e: any, data: any) => { diff --git a/src/render.d.ts b/src/render.d.ts index 4b1e285..5d64847 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -15,7 +15,9 @@ export interface IElectronAPI { quit: (bool) => any; downFile: (callBack: Function) => void; quitAndInstall: (callBack: Function) => void; + isOpenWindows: (callBack: Function) => void; getVersion: () => Promise; + isVisible: () => Promise; setRegistry: (uuid: string) => any; getRegistry: () => any; createChildWindow: (config: any) => void; From ed04fd7643bdb7747cad5ea6cc7f62eed3bacfd3 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 17:19:12 +0800 Subject: [PATCH 49/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9setAlwaysOnTop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index 5202b0e..f897ef8 100644 --- a/main.js +++ b/main.js @@ -330,7 +330,7 @@ app.on('ready', () => { childWindow[config.key] = child child.once('ready-to-show', () => { childWindow[config.key].show() - childWindow[config.key].setAlwaysOnTop(true, 'pop-up-menu') + childWindow[config.key].setAlwaysOnTop(true, 'screen-saver') childWindow[config.key].setSkipTaskbar(true) windowOperation(config) }) From b8ccf34edb24d4f96dfdab618fb078f902aa795f Mon Sep 17 00:00:00 2001 From: youngq Date: Thu, 17 Oct 2024 17:31:32 +0800 Subject: [PATCH 50/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=AD=A3=E5=9C=A8?= =?UTF-8?q?=E8=AF=B4=E8=AF=9D=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/CurrentSpeakUserWindow/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx index 3187d09..56ca1c0 100644 --- a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -9,7 +9,7 @@ const CurrentSpeakUserWindow: React.FC = () => { switch (type) { case 'currentSpeakUser': if (currentSpeakUser.length) { - setInputValue(currentSpeakUser.join(',')) + setInputValue(currentSpeakUser.join('; ')) } else { setInputValue('') } @@ -22,8 +22,8 @@ const CurrentSpeakUserWindow: React.FC = () => { return ( <>
-
- {inputValue ? `正在说话:${inputValue}` : '无人说话'} +
+ {inputValue ? `正在说话: ${inputValue}` : `正在说话:`}
From e157d8350c0c978ff5c10f605a378f0d37d538d0 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 17:32:45 +0800 Subject: [PATCH 51/95] =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ShareScreenWindow/index.tsx | 27 ++++++++++++++++---- src/page/Meeting/index.tsx | 13 +++++++--- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index 8024848..5c0a6ae 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -6,6 +6,7 @@ import ImageUrl from '@/utils/package/imageUrl'; import { getKeyOpenChildWindow, setKeyOpenChildWindow } from '@/utils/package/public'; import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons'; import { Button } from 'antd'; +import dayjs from 'dayjs'; import { useEffect, useState } from "react"; const ShareScreenWindow: React.FC = () => { const [footerLists, setFooterLists] = useState([ @@ -46,19 +47,23 @@ const ShareScreenWindow: React.FC = () => { select: false, }, ]) - const [time, setTime] = useState('') + const [timeStr, setTimeStr] = useState(0) const [isExpand, setIsExpand] = useState(false) const [roomUserLists, setRoomUserLists] = useState([]) const channel = new BroadcastChannel('meeting_channel'); const userInfo = JSON.parse(storage.getItem('user') as string) + let timeout: NodeJS.Timeout; useEffect(() => { getRoomUser() channel.onmessage = function (event) { - const { type, time, roomUserList, footerList, currentSpeakUserMe } = event.data; + let { type, time, roomUserList, footerList, currentSpeakUserMe } = event.data; const footerListTemplate = [...footerLists]; switch (type) { case 'time': - setTime(time) + setTimeStr(time) + timeout = setInterval(() => { + setTimeStr(time++) + }, 1000) break; case 'roomUserList': setRoomUserLists(roomUserList) @@ -80,8 +85,20 @@ const ShareScreenWindow: React.FC = () => { break; } } + channel.postMessage({ + type: 'shareScreenWindowGetTime' + }); + return () => { + clearInterval(timeout) + }; }, []); - + const changeCurrentSeconds = (time: number): string => { + const duration = dayjs.duration(time, 'seconds'); + const hours = duration.hours(); // 整数小时 + const minutes = duration.minutes(); // 整数分钟 + const secondsRemaining = duration.seconds(); // 剩余的秒数 + return `${hours > 9 ? hours : '0' + hours}:${minutes > 9 ? minutes : '0' + minutes}:${secondsRemaining > 9 ? secondsRemaining : '0' + secondsRemaining}` + } // 获取房间用户 const getRoomUser = async (): Promise => { const data = JSON.parse(storage.getItem('stateInfo') as string) @@ -112,7 +129,7 @@ const ShareScreenWindow: React.FC = () => { <>
- {time} 共享中 + {changeCurrentSeconds(timeStr)} 共享中 {isExpand ? { channel.postMessage({ type: 'shareScreenWindowClose' diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 3484f20..9894063 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -226,6 +226,15 @@ const Meeting: React.FC = () => { noticeWindowPostRoomManager } = event.data; switch (type) { + case 'shareScreenWindowGetTime': + setCurrentSeconds((res=>{ + channel.postMessage({ + type: 'time', + time: res, + }); + return res + })) + break; case 'shareScreenWindowClose': await stopScreenCapture() await allUserLook(userInfo.uid, userInfo.userName) @@ -351,10 +360,6 @@ const Meeting: React.FC = () => { } time = setInterval(() => { setCurrentSeconds(currentSeconds++) - channel.postMessage({ - type: 'time', - time: changeCurrentSeconds(), - }); }, 1000) // 首次加载图标更新 const firstFooterList = [...footerList] From f84c4d95b367c14f2007f8543b04e456c2bc4755 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 17:40:54 +0800 Subject: [PATCH 52/95] =?UTF-8?q?=E9=80=80=E5=87=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 2 -- src/App.tsx | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index f897ef8..5054c0f 100644 --- a/main.js +++ b/main.js @@ -101,8 +101,6 @@ function createTray() { quit() } else { await mainWindow.webContents.send('quitAndInstall'); - mainWindow.show() - mainWindow.focus() } }, // icon: iconPath, diff --git a/src/App.tsx b/src/App.tsx index 5a2944b..30c7c87 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -104,7 +104,11 @@ const App: React.FC = () => { storage.setItem('setting', JSON.stringify(setting)) }) window.electron.quitAndInstall(async (_e: any) => { - storage.setItem('quitMeeting', true) + let bool = await window.electron.isVisible() + if (bool) { + storage.setItem('quitMeeting', true) + window.electron.setViewStatus('show') + } }) window.electron.isOpenWindows(async (_e: any) => { let bool = await window.electron.isVisible() From b8aabf878b090cbd1180fde6f1f1f72ace5bf2ad Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 17:42:03 +0800 Subject: [PATCH 53/95] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ShareScreenWindow/index.module.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/page/Meeting/ShareScreenWindow/index.module.scss b/src/page/Meeting/ShareScreenWindow/index.module.scss index 6bdae31..d93e050 100644 --- a/src/page/Meeting/ShareScreenWindow/index.module.scss +++ b/src/page/Meeting/ShareScreenWindow/index.module.scss @@ -64,7 +64,7 @@ } >span { - font-size: 12px; + font-size: 10px; } } } From 01aad9cb274dd6876dff150b2341abe880343a64 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 17:56:02 +0800 Subject: [PATCH 54/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 9 ++++-- .../Meeting/ChatSmallWindow/index.module.scss | 29 +++++++++++++++++-- src/page/Meeting/ChatSmallWindow/index.tsx | 12 ++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 5054c0f..8a06cc8 100644 --- a/main.js +++ b/main.js @@ -357,8 +357,13 @@ app.on('ready', () => { }); // 设置子窗口 ipcMain.handle('setChildWindow', (event, config) => { - if (config.key === 'shareScreenWindow') { - childWindow[config.key].setBounds({ width: config.width }) + switch (config.key) { + case 'shareScreenWindow': + childWindow[config.key].setBounds({ width: config.width }) + break; + case 'chatSmallWindow': + childWindow[config.key].setBounds({ height: config.height }) + break; } }); // 隐藏主窗口 diff --git a/src/page/Meeting/ChatSmallWindow/index.module.scss b/src/page/Meeting/ChatSmallWindow/index.module.scss index 369294c..5f5f3e9 100644 --- a/src/page/Meeting/ChatSmallWindow/index.module.scss +++ b/src/page/Meeting/ChatSmallWindow/index.module.scss @@ -4,14 +4,16 @@ display: flex; flex-direction: column; height: 100%; + position: relative; >div:nth-child(1) { flex-grow: 1; overflow-y: hidden; max-height: 80%; - padding: 4px; + padding: 0 4px; box-sizing: border-box; display: flex; + background-color: rgba(40, 40, 44, .4); flex-direction: column-reverse; .chatSmallWindowContentLeft { @@ -24,7 +26,7 @@ padding: 4px; box-sizing: border-box; border-radius: 0 15px 15px 15px; - margin: 0 0 10px 0; + margin: 0 0 4px 0; font-size: 12px; display: flex; @@ -50,7 +52,7 @@ padding: 4px; box-sizing: border-box; border-radius: 15px 0 15px 15px; - margin: 0 0 10px 0; + margin: 0 0 4px 0; font-size: 14px; display: flex; flex-direction: row-reverse; @@ -70,4 +72,25 @@ opacity: 1; } } + + >div:nth-child(3) { + position: absolute; + left: 50%; + top: 0px; + transform: translate(-50%, 0); + display: flex; + align-items: center; + margin: 0 auto; + background-color: rgba(40, 40, 44, .2); + padding: 0 6px; + cursor: pointer; + + &:hover { + background-color: rgba(40, 40, 44, 1); + } + + >span { + font-size: 12px; + } + } } \ No newline at end of file diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index 329dff1..c62f53b 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -1,9 +1,11 @@ import styles from '@/page/Meeting/ChatSmallWindow/index.module.scss' +import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons'; import { Input } from 'antd'; import { useEffect, useState } from "react"; const ChatSmallWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') const [chatLists, setChatLists] = useState([]) + const [isExpand, setIsExpand] = useState(false) const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { let time: NodeJS.Timeout; @@ -83,6 +85,16 @@ const ChatSmallWindow: React.FC = () => { } />
+
{ + setIsExpand(!isExpand) + window.electron.setChildWindow({ + height: isExpand ? 150 : 150 / 2, + key: 'chatSmallWindow', + }) + }}> + {isExpand ? '展开' : '收起'} + {isExpand ? : } +
) From c35b87ba905573db91138640d2e81a586149ce84 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 09:15:40 +0800 Subject: [PATCH 55/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 20 -------------------- src/page/Meeting/index.tsx | 30 +++++++++--------------------- src/utils/package/agora.ts | 10 ++++++++-- vite.config.ts | 8 ++++++-- 4 files changed, 23 insertions(+), 45 deletions(-) diff --git a/main.js b/main.js index 8a06cc8..a42b159 100644 --- a/main.js +++ b/main.js @@ -52,26 +52,6 @@ class AppWindow extends BrowserWindow { }); } } - -function showWindow() { - // 如果主窗口已经存在但被最小化了,则恢复显示 - if (mainWindow && mainWindow.isMinimized()) { - mainWindow.show(); - console.log(3); - } - // 如果主窗口已存在但不是焦点窗口,则将其置为焦点 - if (mainWindow && !mainWindow.isFocused()) { - console.log(2); - mainWindow.show(); - mainWindow.focus(); - } - // 如果主窗口还没有被创建,则创建它 - if (!mainWindow) { - console.log(1); - createWindow(); - } -} - function quit() { app.quit() } diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 9894063..f347871 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -14,7 +14,7 @@ import { agora } from '@/utils/package/agora' import { onInvoke, onSignalr, offSignalr } from '@/utils/package/signalr'; import dayjs from 'dayjs'; import durationPlugin from 'dayjs/plugin/duration'; -import { AudioVolumeInfo, ConnectionChangedReasonType, ConnectionStateType, QualityType, RtcConnection, RtcStats, UserOfflineReasonType, VideoSourceType, VideoStreamType } from 'agora-electron-sdk'; +import { AudioVolumeInfo, ConnectionChangedReasonType, ConnectionStateType, LocalVideoStreamReason, LocalVideoStreamState, QualityType, RtcConnection, RtcStats, UserOfflineReasonType, VideoSourceType, VideoStreamType } from 'agora-electron-sdk'; import Avatar from '@/components/Avatar'; import SharedFilesModel from '@/components/SharedFilesModel'; import StupWizard from '@/components/StupWizard'; @@ -190,7 +190,6 @@ const Meeting: React.FC = () => { const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { let time: NodeJS.Timeout; - let getDesktopCapturerVideoTime: NodeJS.Timeout; setUser(userInfo) window.electron.getIsMaximized().then((res: boolean) => { if (!res) { @@ -227,7 +226,7 @@ const Meeting: React.FC = () => { } = event.data; switch (type) { case 'shareScreenWindowGetTime': - setCurrentSeconds((res=>{ + setCurrentSeconds((res => { channel.postMessage({ type: 'time', time: res, @@ -395,28 +394,10 @@ const Meeting: React.FC = () => { }) } }, 10000); - getDesktopCapturerVideoTime = setInterval(() => { - setSharedScreenItem((i: any) => { - if (i && i.type === 0) { - agora.getDesktopCapturerVideo({ width: 0, height: 0 }, { width: 0, height: 0 }, false).then(res => { - if (res.length) { - let row = res.find((item: any) => item.sourceId === i.sourceId) - if (!row) { - stopScreenCapture() - setSharedScreenItem('') - allUserLook(userInfo.uid, userInfo.userName) - } - } - }) - } - return i - }) - }, 3000) return () => { window.removeEventListener('customStorageChange', handleCustomStorageChange); window.removeEventListener('wheel', handleWheelChange); clearInterval(time) - clearInterval(getDesktopCapturerVideoTime) }; }, []); @@ -1023,6 +1004,13 @@ const Meeting: React.FC = () => { message.error('网络断开,请检查网络') } }, + onLocalVideoStateChanged: async (source: VideoSourceType, _state: LocalVideoStreamState, reason: LocalVideoStreamReason) => { + if (source === 2 && reason === 12) { + stopScreenCapture() + setSharedScreenItem('') + allUserLook(userInfo.uid, userInfo.userName) + } + } }) if (state.enableCamera) { await agora.startCameraCapture() diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index 1e18733..c5173bc 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -15,7 +15,9 @@ import { AudioVolumeInfo, UserOfflineReasonType, ConnectionStateType, - ConnectionChangedReasonType + ConnectionChangedReasonType, + LocalVideoStreamReason, + LocalVideoStreamState } from "agora-electron-sdk"; import { GetRoomRtcToken, GetAgoraConf } from "@/api/Home/Index"; import { storage } from '@/utils'; @@ -111,7 +113,7 @@ export const agora = { }, 1000); }, // 事件回调 - registerEventHandler: ({ onJoinChannelSuccess, onUserJoined, onUserOffline, onAudioVolumeIndication, onNetworkQuality, onRtcStats, onConnectionStateChanged }: any) => { + registerEventHandler: ({ onJoinChannelSuccess, onUserJoined, onUserOffline, onAudioVolumeIndication, onNetworkQuality, onRtcStats, onConnectionStateChanged, onLocalVideoStateChanged }: any) => { rtcEngine.registerEventHandler({ // 监听本地用户加入频道事件 onJoinChannelSuccess: async (connection: RtcConnection, elapsed: number) => { @@ -153,6 +155,10 @@ export const agora = { onConnectionStateChanged: async (connection: RtcConnection, state: ConnectionStateType, reason: ConnectionChangedReasonType) => { await onConnectionStateChanged?.(connection, state, reason) }, + // 本地视频状态发生改变回调。 + onLocalVideoStateChanged: async (source: VideoSourceType, state: LocalVideoStreamState, reason: LocalVideoStreamReason) => { + await onLocalVideoStateChanged?.(source, state, reason) + }, }); }, // 获取视图模式 diff --git a/vite.config.ts b/vite.config.ts index 8d788dd..f52346c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -70,7 +70,9 @@ export default defineConfig({ AudioVolumeInfo, UserOfflineReasonType, ConnectionStateType, - ConnectionChangedReasonType + ConnectionChangedReasonType, + LocalVideoStreamState, + LocalVideoStreamReason } = require("agora-electron-sdk") export { createAgoraRtcEngine, @@ -89,7 +91,9 @@ export default defineConfig({ AudioVolumeInfo, UserOfflineReasonType, ConnectionStateType, - ConnectionChangedReasonType + ConnectionChangedReasonType, + LocalVideoStreamState, + LocalVideoStreamReason } `, }) From b5bbee04b69c305e33cca89322f4af93a66074f4 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 09:16:29 +0800 Subject: [PATCH 56/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index f347871..31b308b 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1005,7 +1005,7 @@ const Meeting: React.FC = () => { } }, onLocalVideoStateChanged: async (source: VideoSourceType, _state: LocalVideoStreamState, reason: LocalVideoStreamReason) => { - if (source === 2 && reason === 12) { + if (reason === 12) { stopScreenCapture() setSharedScreenItem('') allUserLook(userInfo.uid, userInfo.userName) From 7ae50eca41f065318341108abc7f11b4bab0a68f Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 09:29:35 +0800 Subject: [PATCH 57/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 31b308b..931172a 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1004,7 +1004,7 @@ const Meeting: React.FC = () => { message.error('网络断开,请检查网络') } }, - onLocalVideoStateChanged: async (source: VideoSourceType, _state: LocalVideoStreamState, reason: LocalVideoStreamReason) => { + onLocalVideoStateChanged: async (_source: VideoSourceType, _state: LocalVideoStreamState, reason: LocalVideoStreamReason) => { if (reason === 12) { stopScreenCapture() setSharedScreenItem('') From 1bfbb47e9558fd04b4b8357b99ac1fcfd330d88e Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 10:56:01 +0800 Subject: [PATCH 58/95] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ChatSmallWindow/index.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index c62f53b..ab7e47d 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -8,17 +8,16 @@ const ChatSmallWindow: React.FC = () => { const [isExpand, setIsExpand] = useState(false) const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { - let time: NodeJS.Timeout; - time = setInterval(() => { - setChatLists((res: any) => { - return res.length ? res.slice(0, -1) : res - }) - }, 10000) channel.onmessage = function (event) { const { type, chatListIten } = event.data; switch (type) { case 'chatListIten': - setChatLists((newChatList: any) => [chatListIten, ...newChatList]) + setChatLists((newChatList: any) => { + chatListIten.timer = setTimeout(() => { + removeItemByIndex(); + }, 3000); + return [chatListIten, ...newChatList] + }) setTimeout(() => { const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; if (chatSmallWindowView) { @@ -28,11 +27,12 @@ const ChatSmallWindow: React.FC = () => { break; } } - return () => { - clearTimeout(time) - } }, []); - + const removeItemByIndex = () => { + setChatLists((res: any) => { + return res.slice(0, -1) + }) + } return ( <> From dabeb8dfef3a02934caa8b18adc13e0cb5da04ca Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 10:57:24 +0800 Subject: [PATCH 59/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E5=8F=91=E8=A8=80=E5=9B=BE=E6=A0=87=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/UserListWindow/index.tsx | 42 +++++++++++------------ src/page/Meeting/index.tsx | 40 ++++++++++----------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx index 4168865..6f29e5f 100644 --- a/src/page/Meeting/UserListWindow/index.tsx +++ b/src/page/Meeting/UserListWindow/index.tsx @@ -96,27 +96,6 @@ const UserListWindow: React.FC = () => {
- {item.uid !== user.uid && !role.ID.includes(item.roleId) ?
{ - if (item.isRoomManager) { - channel.postMessage({ - type: 'userListWindowDeleteRoomManager', - userListWindowDeleteRoomManager: { - uid: item.uid - } - }); - } else { - channel.postMessage({ - type: 'userListWindowPostRoomManager', - userListWindowPostRoomManager: { - uid: item.uid - } - }); - } - }}> - {!item.isRoomManager ? - : - } -
: null} {role.ID.includes(item.roleId) || item.isRoomManager ?
{ channel.postMessage({ @@ -184,6 +163,27 @@ const UserListWindow: React.FC = () => { }} />
: null} + {item.uid !== user.uid && !role.ID.includes(item.roleId) ?
{ + if (item.isRoomManager) { + channel.postMessage({ + type: 'userListWindowDeleteRoomManager', + userListWindowDeleteRoomManager: { + uid: item.uid + } + }); + } else { + channel.postMessage({ + type: 'userListWindowPostRoomManager', + userListWindowPostRoomManager: { + uid: item.uid + } + }); + } + }}> + {!item.isRoomManager ? + : + } +
: null}
: null ) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 931172a..db829da 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -2265,26 +2265,6 @@ const Meeting: React.FC = () => {
- {item.uid !== user.uid && !role.ID.includes(item.roleId) ?
{ - if (item.isRoomManager) { - DeleteRoomManager({ - roomId: state.roomId, - roomNum: state.channelId, - userId: item.uid - }) - } else { - postRoomManager({ - roomId: state.roomId, - roomNum: state.channelId, - userId: item.uid - }) - } - }}> - {!item.isRoomManager ? - : - - } -
: null} {role.ID.includes(item.roleId) || item.isRoomManager ?
{ postOpenMicr(!item.enableMicr, item.uid) @@ -2320,6 +2300,26 @@ const Meeting: React.FC = () => {
: null} + {item.uid !== user.uid && !role.ID.includes(item.roleId) ?
{ + if (item.isRoomManager) { + DeleteRoomManager({ + roomId: state.roomId, + roomNum: state.channelId, + userId: item.uid + }) + } else { + postRoomManager({ + roomId: state.roomId, + roomNum: state.channelId, + userId: item.uid + }) + } + }}> + {!item.isRoomManager ? + : + + } +
: null}
: null ) From b4493cf5d6b5382ae9cad8d200b77800366a3c98 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 10:59:49 +0800 Subject: [PATCH 60/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/package/agora.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index c5173bc..85a2641 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -238,7 +238,7 @@ export const agora = { }, // 加入频道 joinChannel: async () => { - await rtcEngine.enableAudioVolumeIndication(100, 1, true) + await rtcEngine.enableAudioVolumeIndication(3000, 3, true) await rtcEngine.joinChannel(option.token, option.channelId, option.uid); await rtcEngine.setDualStreamModeEx( SimulcastStreamMode.EnableSimulcastStream, From 45557ef41d0d0418753aae890e179e937d40d12f Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 11:17:28 +0800 Subject: [PATCH 61/95] =?UTF-8?q?=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/main.js b/main.js index a42b159..0d64de2 100644 --- a/main.js +++ b/main.js @@ -75,13 +75,7 @@ function createTray() { }, { label: '退出', click: async () => { - const url = mainWindow.webContents.getURL(); - const hash = new URL(url).hash; - if (hash.indexOf('/meeting') === -1) { - quit() - } else { - await mainWindow.webContents.send('quitAndInstall'); - } + quit() }, // icon: iconPath, }, From 0d9d963593d90d770c6719b26bb869d7153e7ef5 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 11:23:57 +0800 Subject: [PATCH 62/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/package/agora.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index 85a2641..4c45306 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -238,7 +238,7 @@ export const agora = { }, // 加入频道 joinChannel: async () => { - await rtcEngine.enableAudioVolumeIndication(3000, 3, true) + await rtcEngine.enableAudioVolumeIndication(100, 3, true) await rtcEngine.joinChannel(option.token, option.channelId, option.uid); await rtcEngine.setDualStreamModeEx( SimulcastStreamMode.EnableSimulcastStream, From e362145da93a4bd8b321cf87903a47c0b6a88b83 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 13:44:17 +0800 Subject: [PATCH 63/95] =?UTF-8?q?=E8=AF=B4=E8=AF=9D=E4=BA=BA=E6=96=87?= =?UTF-8?q?=E5=AD=97=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/CurrentSpeakUserWindow/index.tsx | 15 +++++++++++---- src/page/Meeting/index.tsx | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx index 56ca1c0..622e3e5 100644 --- a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -1,17 +1,24 @@ import styles from '@/page/Meeting/CurrentSpeakUserWindow/index.module.scss' +import { storage } from '@/utils'; import { useEffect, useState } from "react"; const CurrentSpeakUserWindow: React.FC = () => { - const [inputValue, setInputValue] = useState('') + const [inputValue, setInputValue] = useState('') + const [user, setUser] = useState({}); + const [isMeSpeack, setIsMeSpeack] = useState(false) const channel = new BroadcastChannel('meeting_channel'); + const userInfo = JSON.parse(storage.getItem('user') as string) useEffect(() => { + setUser(userInfo) channel.onmessage = function (event) { - const { type, currentSpeakUser } = event.data; + const { type, currentSpeakUser, uidArr } = event.data; switch (type) { case 'currentSpeakUser': if (currentSpeakUser.length) { setInputValue(currentSpeakUser.join('; ')) + setIsMeSpeack(uidArr.find((item: any) => item === 0) ? true : false) } else { setInputValue('') + setIsMeSpeack(false) } break; } @@ -22,8 +29,8 @@ const CurrentSpeakUserWindow: React.FC = () => { return ( <>
-
- {inputValue ? `正在说话: ${inputValue}` : `正在说话:`} +
+ {`正在说话:${isMeSpeack ? user.userName : ''} ${inputValue}`}
diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index db829da..2183654 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -962,11 +962,12 @@ const Meeting: React.FC = () => { }); } }); - const uidArr = (speakers.filter((item: any) => item.volume)).map(item => item.uid || userInfo.uid) as number[]; + const uidArr = (speakers.filter((item: any) => item.volume)) as number[]; const currentSpeakUser = await checkUidsInUsers(uidArr) channel.postMessage({ type: 'currentSpeakUser', currentSpeakUser, + uidArr }); } }, From d70f09f82d1fd9116ff3085de9869111bdc80bed Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 13:51:34 +0800 Subject: [PATCH 64/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 3 +++ src/page/Meeting/NoticeWindow/index.tsx | 7 +++-- src/page/Meeting/index.tsx | 36 +++++++++++-------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/main.js b/main.js index 0d64de2..19a3bd4 100644 --- a/main.js +++ b/main.js @@ -338,6 +338,9 @@ app.on('ready', () => { case 'chatSmallWindow': childWindow[config.key].setBounds({ height: config.height }) break; + case 'noticeWindow': + childWindow[config.key].setBounds({ width: config.width, height: config.height }) + break; } }); // 隐藏主窗口 diff --git a/src/page/Meeting/NoticeWindow/index.tsx b/src/page/Meeting/NoticeWindow/index.tsx index 4748d54..fb0fa36 100644 --- a/src/page/Meeting/NoticeWindow/index.tsx +++ b/src/page/Meeting/NoticeWindow/index.tsx @@ -79,8 +79,11 @@ const NoticeWindow: React.FC = () => { time = setInterval(() => { const dom = document.getElementsByClassName('ant-notification') if (dom.length === 0) { - window.electron.closeChildWindow('noticeWindow') - setKeyOpenChildWindow('noticeWindow', false) + window.electron.setChildWindow({ + height: 0, + window: 0, + key: 'noticeWindow', + }) } }, 1000) }, 4000); diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 2183654..ad030a8 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -627,29 +627,17 @@ const Meeting: React.FC = () => { break; // 申请发言 case 'ApplyToSpeak': - const noticeWindow = await getKeyOpenChildWindow('noticeWindow') setIsScreenCapture(bool => { if (bool) { - if (noticeWindow) { - channel.postMessage({ - type: 'noticeItem', - noticeItem: item - }); - } else { - window.electron.createChildWindow({ - url: location.origin + `/#/noticeWindow`, - width: 388, - height: 150, - key: 'noticeWindow', - }) - setTimeout(() => { - channel.postMessage({ - type: 'noticeItem', - noticeItem: item - }); - }, 2000); - setKeyOpenChildWindow('noticeWindow', true) - } + window.electron.setChildWindow({ + width: 388, + height: 150, + key: 'noticeWindow', + }) + channel.postMessage({ + type: 'noticeItem', + noticeItem: item + }); } else { api.open({ message: '', @@ -1545,6 +1533,12 @@ const Meeting: React.FC = () => { height: 30, key: 'currentSpeakUserWindow', }) + window.electron.createChildWindow({ + url: location.origin + `/#/noticeWindow`, + width: 388, + height: 150, + key: 'noticeWindow', + }) setKeyOpenChildWindow('shareScreenWindow', true) } } else { From 170ff9b12232e754b25123e58e7a184d67adcea6 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 14:21:13 +0800 Subject: [PATCH 65/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Meeting/CurrentSpeakUserWindow/index.tsx | 9 ++-- src/page/Meeting/NoticeWindow/index.tsx | 5 +-- src/page/Meeting/index.tsx | 44 +++++++++---------- src/utils/package/agora.ts | 2 +- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx index 622e3e5..c4c1893 100644 --- a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -14,12 +14,11 @@ const CurrentSpeakUserWindow: React.FC = () => { switch (type) { case 'currentSpeakUser': if (currentSpeakUser.length) { - setInputValue(currentSpeakUser.join('; ')) - setIsMeSpeack(uidArr.find((item: any) => item === 0) ? true : false) + setInputValue(currentSpeakUser.join(';')) } else { setInputValue('') - setIsMeSpeack(false) } + setIsMeSpeack(uidArr.find((item: any) => item === 0) === 0 ? true : false) break; } } @@ -29,8 +28,8 @@ const CurrentSpeakUserWindow: React.FC = () => { return ( <>
-
- {`正在说话:${isMeSpeack ? user.userName : ''} ${inputValue}`} +
+ {`正在说话:${isMeSpeack ? user.userName + ';' : ''} ${inputValue}`}
diff --git a/src/page/Meeting/NoticeWindow/index.tsx b/src/page/Meeting/NoticeWindow/index.tsx index fb0fa36..a2dac73 100644 --- a/src/page/Meeting/NoticeWindow/index.tsx +++ b/src/page/Meeting/NoticeWindow/index.tsx @@ -1,5 +1,4 @@ import styles from '@/page/Meeting/NoticeWindow/index.module.scss' -import { setKeyOpenChildWindow } from '@/utils/package/public'; import { Button, notification } from 'antd'; import { useEffect } from "react"; @@ -80,8 +79,8 @@ const NoticeWindow: React.FC = () => { const dom = document.getElementsByClassName('ant-notification') if (dom.length === 0) { window.electron.setChildWindow({ - height: 0, - window: 0, + height: 1, + width: 1, key: 'noticeWindow', }) } diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index ad030a8..02da424 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -916,24 +916,27 @@ const Meeting: React.FC = () => { } }, onAudioVolumeIndication: async (speakers: AudioVolumeInfo[]) => { - async function checkUidsInUsers(uids: number[]): Promise { - return new Promise(resolve => { - const usernames: string[] = []; + function checkUidsInUsers(uids: number[]): string[] { + const usernames: string[] = []; + setRoomUserList((res: any) => { uids.forEach(uid => { - setRoomUserList((res: any) => { - const user = res.find((item: any) => item.uid == uid); - if (user) { - usernames.push(user.userName); - } - return res - }) - }); - if (uids.length === usernames.length) { - resolve(usernames) - } - }) + const user = res.find((item: any) => item.uid == uid); + if (user) { + usernames.push(user.userName); + } + }) + return res + }); + return usernames } if (speakers.length) { + const uidArr = (speakers.filter((item: any) => item.volume)).map(item => item.uid) as number[]; + const currentSpeakUser = checkUidsInUsers(uidArr) + channel.postMessage({ + type: 'currentSpeakUser', + currentSpeakUser, + uidArr + }); speakers.forEach((item: any) => { let domMe = document.getElementById(`micr-item-${userInfo.uid}`); let dom = document.getElementById(`micr-${item.uid ? item.uid : userInfo.uid}`); @@ -950,13 +953,6 @@ const Meeting: React.FC = () => { }); } }); - const uidArr = (speakers.filter((item: any) => item.volume)) as number[]; - const currentSpeakUser = await checkUidsInUsers(uidArr) - channel.postMessage({ - type: 'currentSpeakUser', - currentSpeakUser, - uidArr - }); } }, onNetworkQuality: async (_connection: RtcConnection, remoteUid: number, _txQuality: QualityType, rxQuality: QualityType) => { @@ -1535,8 +1531,8 @@ const Meeting: React.FC = () => { }) window.electron.createChildWindow({ url: location.origin + `/#/noticeWindow`, - width: 388, - height: 150, + width: 1, + height: 1, key: 'noticeWindow', }) setKeyOpenChildWindow('shareScreenWindow', true) diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index 4c45306..abaf32e 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -238,7 +238,7 @@ export const agora = { }, // 加入频道 joinChannel: async () => { - await rtcEngine.enableAudioVolumeIndication(100, 3, true) + await rtcEngine.enableAudioVolumeIndication(1000, 3, true) await rtcEngine.joinChannel(option.token, option.channelId, option.uid); await rtcEngine.setDualStreamModeEx( SimulcastStreamMode.EnableSimulcastStream, From b7d41eff22cd4936ad10a1731e38f900973ba93b Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 14:27:09 +0800 Subject: [PATCH 66/95] =?UTF-8?q?=E9=80=80=E6=88=B7=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 30c7c87..82e43fc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -24,7 +24,7 @@ import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow"; import ChatBigWindow from "@/page/Meeting/ChatBigWindow"; import CurrentSpeakUserWindow from "@/page/Meeting/CurrentSpeakUserWindow"; import NoticeWindow from "@/page/Meeting/NoticeWindow"; -import { getKeyOpenChildWindow } from "./utils/package/public"; +import { getKeyOpenChildWindow, setKeyOpenChildWindow } from "./utils/package/public"; const fs = require('fs').promises; const { exec } = require('child_process'); const App: React.FC = () => { @@ -234,6 +234,20 @@ const App: React.FC = () => { }; const leaveChannel = async (bool?: boolean): Promise => { if (location.hash.indexOf('/meeting') === 1) { + window.electron.closeChildWindow('shareScreenWindow') + setKeyOpenChildWindow('shareScreenWindow', false) + window.electron.setViewStatus('show') + window.electron.getWindowSize().then((res: any) => { + window.electron.setMainWindowSize({ + width: Math.ceil(res.width / 1.5), + height: Math.ceil(res.height / 1.3), + }) + window.electron.getIsMaximized().then((b: boolean) => { + if (!b) { + window.electron.setViewStatus('maximize') + } + }) + }) const data = JSON.parse(localStorage.stateInfo); if (!bool) { await GetLeave({ From f7c90157675a6364b2d6c102e5122e7c5f7bf4e6 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 14:30:17 +0800 Subject: [PATCH 67/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/package/agora.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index abaf32e..4c45306 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -238,7 +238,7 @@ export const agora = { }, // 加入频道 joinChannel: async () => { - await rtcEngine.enableAudioVolumeIndication(1000, 3, true) + await rtcEngine.enableAudioVolumeIndication(100, 3, true) await rtcEngine.joinChannel(option.token, option.channelId, option.uid); await rtcEngine.setDualStreamModeEx( SimulcastStreamMode.EnableSimulcastStream, From 004e5669644159d72939d7d51efacee37d80e0b7 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 15:19:38 +0800 Subject: [PATCH 68/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Meeting/CurrentSpeakUserWindow/index.tsx | 12 ++--- src/page/Meeting/index.tsx | 52 +++++++++++-------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx index c4c1893..9cf4ec3 100644 --- a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -1,16 +1,11 @@ import styles from '@/page/Meeting/CurrentSpeakUserWindow/index.module.scss' -import { storage } from '@/utils'; import { useEffect, useState } from "react"; const CurrentSpeakUserWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') - const [user, setUser] = useState({}); - const [isMeSpeack, setIsMeSpeack] = useState(false) const channel = new BroadcastChannel('meeting_channel'); - const userInfo = JSON.parse(storage.getItem('user') as string) useEffect(() => { - setUser(userInfo) channel.onmessage = function (event) { - const { type, currentSpeakUser, uidArr } = event.data; + const { type, currentSpeakUser } = event.data; switch (type) { case 'currentSpeakUser': if (currentSpeakUser.length) { @@ -18,7 +13,6 @@ const CurrentSpeakUserWindow: React.FC = () => { } else { setInputValue('') } - setIsMeSpeack(uidArr.find((item: any) => item === 0) === 0 ? true : false) break; } } @@ -28,8 +22,8 @@ const CurrentSpeakUserWindow: React.FC = () => { return ( <>
-
- {`正在说话:${isMeSpeack ? user.userName + ';' : ''} ${inputValue}`} +
+ {`正在说话: ${inputValue}`}
diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 02da424..d6bc6cb 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -144,6 +144,7 @@ const Meeting: React.FC = () => { rowIndex: 0, }); const [roomUserList, setRoomUserList] = useState([]) + const [_speackUid, setSpeackUid] = useState([]) const [chatList, setChatList] = useState([]) const [currentVideoId, setCurrentVideoId] = useState('') let [currentSeconds, setCurrentSeconds] = useState(0) @@ -359,6 +360,24 @@ const Meeting: React.FC = () => { } time = setInterval(() => { setCurrentSeconds(currentSeconds++) + setSpeackUid((uids: any) => { + const usernames: string[] = []; + setRoomUserList((res: any) => { + uids.forEach((uid: any) => { + const user = res.find((item: any) => item.uid == uid); + if (user) { + usernames.push(user.userName); + } + }) + channel.postMessage({ + type: 'currentSpeakUser', + currentSpeakUser: usernames, + }); + return res + }); + + return [] + }) }, 1000) // 首次加载图标更新 const firstFooterList = [...footerList] @@ -382,9 +401,13 @@ const Meeting: React.FC = () => { okText: '确定', cancelText: '取消', async onOk() { - changeStatusList({ - title: '录制' - }, 1, 3) + if (stateInfo) { + changeStatusList({ + title: '录制' + }, 1, 3) + } else { + message.error('当前不在会议室!') + } }, onCancel() { } @@ -916,27 +939,10 @@ const Meeting: React.FC = () => { } }, onAudioVolumeIndication: async (speakers: AudioVolumeInfo[]) => { - function checkUidsInUsers(uids: number[]): string[] { - const usernames: string[] = []; - setRoomUserList((res: any) => { - uids.forEach(uid => { - const user = res.find((item: any) => item.uid == uid); - if (user) { - usernames.push(user.userName); - } - }) - return res - }); - return usernames - } if (speakers.length) { - const uidArr = (speakers.filter((item: any) => item.volume)).map(item => item.uid) as number[]; - const currentSpeakUser = checkUidsInUsers(uidArr) - channel.postMessage({ - type: 'currentSpeakUser', - currentSpeakUser, - uidArr - }); + setSpeackUid((res: any) => { + return [...new Set([...res, ...(speakers.filter((item: any) => item.volume)).map(item => item.uid || userInfo.uid)])] + }) speakers.forEach((item: any) => { let domMe = document.getElementById(`micr-item-${userInfo.uid}`); let dom = document.getElementById(`micr-${item.uid ? item.uid : userInfo.uid}`); From 634d02d28a93ac8ee812e14bea19b373686e5cb6 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 15:43:20 +0800 Subject: [PATCH 69/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=91=E8=A8=80?= =?UTF-8?q?=E4=BA=BA=E7=94=B3=E8=AF=B7=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index d6bc6cb..53277b1 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -657,10 +657,12 @@ const Meeting: React.FC = () => { height: 150, key: 'noticeWindow', }) - channel.postMessage({ - type: 'noticeItem', - noticeItem: item - }); + setTimeout(() => { + channel.postMessage({ + type: 'noticeItem', + noticeItem: item + }); + }, 1000) } else { api.open({ message: '', @@ -1537,8 +1539,8 @@ const Meeting: React.FC = () => { }) window.electron.createChildWindow({ url: location.origin + `/#/noticeWindow`, - width: 1, - height: 1, + width: 388, + height: 150, key: 'noticeWindow', }) setKeyOpenChildWindow('shareScreenWindow', true) From b579f77b9f726a1e3fbc16bf083357a350aecba5 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 15:46:34 +0800 Subject: [PATCH 70/95] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/UserListWindow/index.tsx | 19 +++---------------- src/page/Meeting/index.tsx | 10 ++++++++++ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx index 6f29e5f..2c860c1 100644 --- a/src/page/Meeting/UserListWindow/index.tsx +++ b/src/page/Meeting/UserListWindow/index.tsx @@ -6,7 +6,6 @@ import { Button, Input, Modal, Popover } from 'antd'; import Avatar from '@/components/Avatar'; import { useEffect, useState, useRef } from "react"; import { storage } from '@/utils'; -import { GetRoomUser } from '@/api/Meeting'; import { setKeyOpenChildWindow } from '@/utils/package/public'; import EquipmentManagement from '@/components/EquipmentManagement'; const { confirm } = Modal; @@ -20,7 +19,6 @@ const UserListWindow: React.FC = () => { const userInfo = JSON.parse(storage.getItem('user') as string) useEffect(() => { setUser(userInfo) - getRoomUser() channel.onmessage = function (event) { const { type, roomUserList, showDriverList } = event.data; switch (type) { @@ -32,21 +30,10 @@ const UserListWindow: React.FC = () => { break; } } + channel.postMessage({ + type: 'userListWindowGetRoomUserList' + }); }, []); - // 获取房间用户 - const getRoomUser = async (): Promise => { - const data = JSON.parse(storage.getItem('stateInfo') as string) - GetRoomUser(data.channelId).then(res => { - if (res.code === 200) { - res.data.forEach((item: any) => { - item.isShow = true; - item.isRoom = true; - item.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager - }) - setRoomUserList(res.data) - } - }) - } return ( <>
diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 53277b1..ba86194 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -301,6 +301,16 @@ const Meeting: React.FC = () => { userId: userListWindowPostRoomManager.uid }) break; + case 'userListWindowGetRoomUserList': + setRoomUserList(((res: any) => { + channel.postMessage({ + type: 'roomUserList', + roomUserList: res, + }); + return res + })) + break; + break; case 'userListWindowGetRoomKickout': GetRoomKickout(state.channelId, userListWindowGetRoomKickout.uid) break; From 3423e134876bc2abd47e9d7bbb28b4dccaf21e14 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 15:55:32 +0800 Subject: [PATCH 71/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index ba86194..632fb13 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1009,9 +1009,14 @@ const Meeting: React.FC = () => { }, onLocalVideoStateChanged: async (_source: VideoSourceType, _state: LocalVideoStreamState, reason: LocalVideoStreamReason) => { if (reason === 12) { - stopScreenCapture() - setSharedScreenItem('') - allUserLook(userInfo.uid, userInfo.userName) + setIsScreenCapture(bool => { + if (bool) { + stopScreenCapture() + setSharedScreenItem('') + allUserLook(userInfo.uid, userInfo.userName) + } + return false + }) } } }) From 70dc2321a06b0a792a229dafaceb278c14c420af Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 16:16:23 +0800 Subject: [PATCH 72/95] =?UTF-8?q?=E9=94=80=E6=AF=81channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ChatBigWindow/index.tsx | 3 +++ src/page/Meeting/ChatSmallWindow/index.tsx | 3 +++ src/page/Meeting/CurrentSpeakUserWindow/index.tsx | 3 +++ src/page/Meeting/NoticeWindow/index.tsx | 1 + src/page/Meeting/ShareScreenWindow/index.tsx | 1 + src/page/Meeting/UserListWindow/index.tsx | 3 +++ src/page/Meeting/index.tsx | 1 + 7 files changed, 15 insertions(+) diff --git a/src/page/Meeting/ChatBigWindow/index.tsx b/src/page/Meeting/ChatBigWindow/index.tsx index 56025b5..37ebcd3 100644 --- a/src/page/Meeting/ChatBigWindow/index.tsx +++ b/src/page/Meeting/ChatBigWindow/index.tsx @@ -51,6 +51,9 @@ const ChatBigWindow: React.FC = () => { msg: '', } }); + return () => { + channel.close(); + } }, []); return ( diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index ab7e47d..c228217 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -27,6 +27,9 @@ const ChatSmallWindow: React.FC = () => { break; } } + return () => { + channel.close(); + } }, []); const removeItemByIndex = () => { setChatLists((res: any) => { diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx index 9cf4ec3..f0647ba 100644 --- a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -16,6 +16,9 @@ const CurrentSpeakUserWindow: React.FC = () => { break; } } + return () => { + channel.close(); + } }, []); diff --git a/src/page/Meeting/NoticeWindow/index.tsx b/src/page/Meeting/NoticeWindow/index.tsx index a2dac73..84fcfb1 100644 --- a/src/page/Meeting/NoticeWindow/index.tsx +++ b/src/page/Meeting/NoticeWindow/index.tsx @@ -88,6 +88,7 @@ const NoticeWindow: React.FC = () => { }, 4000); return () => { clearInterval(time) + channel.close(); }; }, []) return ( diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index 5c0a6ae..755f202 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -90,6 +90,7 @@ const ShareScreenWindow: React.FC = () => { }); return () => { clearInterval(timeout) + channel.close(); }; }, []); const changeCurrentSeconds = (time: number): string => { diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx index 2c860c1..7facfa6 100644 --- a/src/page/Meeting/UserListWindow/index.tsx +++ b/src/page/Meeting/UserListWindow/index.tsx @@ -33,6 +33,9 @@ const UserListWindow: React.FC = () => { channel.postMessage({ type: 'userListWindowGetRoomUserList' }); + return () => { + channel.close(); + } }, []); return ( <> diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 632fb13..d5d0c5b 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -431,6 +431,7 @@ const Meeting: React.FC = () => { window.removeEventListener('customStorageChange', handleCustomStorageChange); window.removeEventListener('wheel', handleWheelChange); clearInterval(time) + channel.close(); }; }, []); From 0160d4276fc38d85c167975291db929bf349cd31 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 16:33:49 +0800 Subject: [PATCH 73/95] =?UTF-8?q?=E8=AE=BE=E4=B8=BA=E5=8F=91=E8=A8=80?= =?UTF-8?q?=E4=BA=BA=E6=91=84=E5=83=8F=E5=A4=B4=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index d5d0c5b..1eed1d8 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -647,7 +647,7 @@ const Meeting: React.FC = () => { postOpenMicrApi(item.user.isRoomManager, userInfo.uid, false) } else { postOpenMicrApi(item.user.isRoomManager, userInfo.uid, false) - postOpenCameraApi(item.user.isRoomManager, userInfo.uid) + postOpenCameraApi(false, userInfo.uid) } return '' }) From 027622f5441fb8eeaf28c2e341f63a98255fd996 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 16:59:28 +0800 Subject: [PATCH 74/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 19a3bd4..a9d298a 100644 --- a/main.js +++ b/main.js @@ -298,7 +298,13 @@ app.on('ready', () => { width: config.width, height: config.height, }) - child.loadURL(config.url) + if (env === 'development') { + // 开发 + child.loadURL(config.url) + } else { + // 测试 | 生产 + child.loadURL(`file://${path.join(__dirname, './dist/index.html')}#/${config.key}`); + } childWindow[config.key] = child child.once('ready-to-show', () => { childWindow[config.key].show() From cfd0d1ceef6a6a9b6c371189929ed2acb473d4d1 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 17:34:46 +0800 Subject: [PATCH 75/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=B4=E8=AF=9D?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 1eed1d8..9d5efa2 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -379,10 +379,7 @@ const Meeting: React.FC = () => { usernames.push(user.userName); } }) - channel.postMessage({ - type: 'currentSpeakUser', - currentSpeakUser: usernames, - }); + storage.setItem('currentSpeakUser', JSON.stringify(usernames)) return res }); @@ -1648,6 +1645,12 @@ const Meeting: React.FC = () => { case 'meetingMode': setMeetingMode(e.value) break; + case 'currentSpeakUser': + channel.postMessage({ + type: 'currentSpeakUser', + currentSpeakUser: JSON.parse(e.value), + }); + break; case 'quitMeeting': if (e.value) { setQuitMeetingModal(true) From 30d739c894a45157c5a456739d1ad7c739f21115 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 17:39:27 +0800 Subject: [PATCH 76/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 8 ++++++++ preload.js | 4 ++++ src/page/Meeting/NoticeWindow/index.tsx | 5 ++--- src/page/Meeting/index.tsx | 15 ++++++--------- src/render.d.ts | 1 + 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/main.js b/main.js index a9d298a..0277e83 100644 --- a/main.js +++ b/main.js @@ -349,6 +349,14 @@ app.on('ready', () => { break; } }); + // 隐藏显示子窗口 + ipcMain.handle('setChildWindowShow', (event, config) => { + if (config.bool) { + childWindow[config.key].show() + } else { + childWindow[config.key].hide() + } + }); // 隐藏主窗口 ipcMain.handle('mainWindowHide', () => { mainWindowHide() diff --git a/preload.js b/preload.js index 7613583..20db99d 100644 --- a/preload.js +++ b/preload.js @@ -94,6 +94,10 @@ window.electron = { ipcRenderer.invoke('setChildWindow', config) }, // 隐藏主窗口 + setChildWindowShow: (config) => { + ipcRenderer.invoke('setChildWindowShow', config) + }, + // 隐藏主窗口 mainWindowHide: () => { ipcRenderer.invoke('mainWindowHide') }, diff --git a/src/page/Meeting/NoticeWindow/index.tsx b/src/page/Meeting/NoticeWindow/index.tsx index 84fcfb1..31ca198 100644 --- a/src/page/Meeting/NoticeWindow/index.tsx +++ b/src/page/Meeting/NoticeWindow/index.tsx @@ -78,10 +78,9 @@ const NoticeWindow: React.FC = () => { time = setInterval(() => { const dom = document.getElementsByClassName('ant-notification') if (dom.length === 0) { - window.electron.setChildWindow({ - height: 1, - width: 1, + window.electron.setChildWindowShow({ key: 'noticeWindow', + bool: false }) } }, 1000) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 9d5efa2..7a07382 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -660,17 +660,14 @@ const Meeting: React.FC = () => { case 'ApplyToSpeak': setIsScreenCapture(bool => { if (bool) { - window.electron.setChildWindow({ - width: 388, - height: 150, + window.electron.setChildWindowShow({ key: 'noticeWindow', + bool: true }) - setTimeout(() => { - channel.postMessage({ - type: 'noticeItem', - noticeItem: item - }); - }, 1000) + channel.postMessage({ + type: 'noticeItem', + noticeItem: item + }); } else { api.open({ message: '', diff --git a/src/render.d.ts b/src/render.d.ts index 5d64847..597739c 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -22,6 +22,7 @@ export interface IElectronAPI { getRegistry: () => any; createChildWindow: (config: any) => void; setChildWindow: (config: any) => void; + setChildWindowShow: (config: any) => void; closeChildWindow: (key: string) => void; mainWindowCenter: () => any; mainWindowHide: () => any; From 70469962be257aec28bb6c5571efd0fbb6d01b31 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 17:57:57 +0800 Subject: [PATCH 77/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 0277e83..cfc8957 100644 --- a/main.js +++ b/main.js @@ -354,7 +354,9 @@ app.on('ready', () => { if (config.bool) { childWindow[config.key].show() } else { - childWindow[config.key].hide() + if (childWindow[config.key].isVisible()) { + childWindow[config.key].hide() + } } }); // 隐藏主窗口 From 6449efb56dbe3795cff319c15c55874204d2bf3d Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 10:02:15 +0800 Subject: [PATCH 78/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/NoticeWindow/index.tsx | 26 ++++++++++--------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/page/Meeting/NoticeWindow/index.tsx b/src/page/Meeting/NoticeWindow/index.tsx index 31ca198..ea9a79a 100644 --- a/src/page/Meeting/NoticeWindow/index.tsx +++ b/src/page/Meeting/NoticeWindow/index.tsx @@ -9,7 +9,6 @@ const NoticeWindow: React.FC = () => { } }); const channel = new BroadcastChannel('meeting_channel'); - let time: NodeJS.Timeout; useEffect(() => { channel.onmessage = function (event) { const { type, noticeItem } = event.data; @@ -64,6 +63,15 @@ const NoticeWindow: React.FC = () => { >拒绝
, + onClose: () => { + const dom = document.getElementsByClassName('ant-notification') + if (dom.length === 0) { + window.electron.setChildWindowShow({ + key: 'noticeWindow', + bool: false + }) + } + }, duration: 10, placement: 'bottomRight', showProgress: true, @@ -72,24 +80,10 @@ const NoticeWindow: React.FC = () => { break; } } - }, []); - useEffect(() => { - setTimeout(() => { - time = setInterval(() => { - const dom = document.getElementsByClassName('ant-notification') - if (dom.length === 0) { - window.electron.setChildWindowShow({ - key: 'noticeWindow', - bool: false - }) - } - }, 1000) - }, 4000); return () => { - clearInterval(time) channel.close(); }; - }, []) + }, []); return ( <>
From 5366601bb21f4d32ab7617ff4050778363708b1d Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 11:31:35 +0800 Subject: [PATCH 79/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 5 +++++ preload.js | 8 ++++++++ src/page/Meeting/ShareScreenWindow/index.tsx | 6 ++++++ src/page/Meeting/index.tsx | 10 ++++++---- src/render.d.ts | 2 ++ 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index cfc8957..d921379 100644 --- a/main.js +++ b/main.js @@ -367,6 +367,11 @@ app.on('ready', () => { ipcMain.handle('mainWindowCenter', () => { mainWindowCenter() }); + ipcMain.handle('windowHandleMessage', (event, data) => { + if (childWindow[data.key]) { + childWindow[data.key].webContents.send('windowHandleMessageCallBack', data) + } + }); } }); // 检测更新,在你想要检查更新的时候执行,renderer事件触发后的操作自行编写 diff --git a/preload.js b/preload.js index 20db99d..ba34b71 100644 --- a/preload.js +++ b/preload.js @@ -105,4 +105,12 @@ window.electron = { mainWindowCenter: () => { ipcRenderer.invoke('mainWindowCenter') }, + // 窗口通信传参 + windowHandleMessage: (data) => { + ipcRenderer.invoke('windowHandleMessage', data) + }, + // 窗口通信回调 + windowHandleMessageCallBack: (callback) => { + ipcRenderer.on('windowHandleMessageCallBack', callback) + }, } diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index 755f202..c9b0c01 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -88,6 +88,12 @@ const ShareScreenWindow: React.FC = () => { channel.postMessage({ type: 'shareScreenWindowGetTime' }); + window.electron.windowHandleMessageCallBack((_e: any, data: any) => { + let domMe = document.getElementById(`micr-item-${userInfo.uid}`) as HTMLDivElement; + if (domMe) { + domMe.style.height = `${data.parmes.currentSpeakUserMe}%` + } + }) return () => { clearInterval(timeout) channel.close(); diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 7a07382..4dbe7c0 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -960,10 +960,12 @@ const Meeting: React.FC = () => { if (domMe && !item.uid) { const percentage = (item.volume / 255) * 100 domMe.style.height = `${percentage}%` - channel.postMessage({ - type: 'currentSpeakUserMe', - currentSpeakUserMe: percentage, - }); + window.electron.windowHandleMessage({ + key: 'shareScreenWindow', + parmes: { + currentSpeakUserMe: percentage, + } + }) } }); } diff --git a/src/render.d.ts b/src/render.d.ts index 597739c..3be8a2c 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -26,6 +26,8 @@ export interface IElectronAPI { closeChildWindow: (key: string) => void; mainWindowCenter: () => any; mainWindowHide: () => any; + windowHandleMessage: (data: any) => {} + windowHandleMessageCallBack: (callBack: Function) => void; } declare global { From 7cae77f94645b043226681ab0358209bb3a9238a Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 13:44:12 +0800 Subject: [PATCH 80/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 1 + src/page/Meeting/ChatBigWindow/index.tsx | 20 ++-- src/page/Meeting/ChatSmallWindow/index.tsx | 33 +++--- .../Meeting/CurrentSpeakUserWindow/index.tsx | 22 +--- src/page/Meeting/ShareScreenWindow/index.tsx | 44 ++++---- src/page/Meeting/UserListWindow/index.tsx | 12 +- src/page/Meeting/index.tsx | 103 +++++++++++------- 7 files changed, 125 insertions(+), 110 deletions(-) diff --git a/main.js b/main.js index d921379..a81f6e2 100644 --- a/main.js +++ b/main.js @@ -367,6 +367,7 @@ app.on('ready', () => { ipcMain.handle('mainWindowCenter', () => { mainWindowCenter() }); + // 窗口通信 ipcMain.handle('windowHandleMessage', (event, data) => { if (childWindow[data.key]) { childWindow[data.key].webContents.send('windowHandleMessageCallBack', data) diff --git a/src/page/Meeting/ChatBigWindow/index.tsx b/src/page/Meeting/ChatBigWindow/index.tsx index 37ebcd3..c350841 100644 --- a/src/page/Meeting/ChatBigWindow/index.tsx +++ b/src/page/Meeting/ChatBigWindow/index.tsx @@ -29,22 +29,22 @@ const ChatBigWindow: React.FC = () => { useEffect(() => { setUser(userInfo) channel.onmessage = function (event) { - const { type, chatList, showDriverList } = event.data; + const { type, showDriverList } = event.data; switch (type) { - case 'chatList': - setChatLists(chatList) - setTimeout(() => { - const chatBigWindowView = document.getElementById('chatBigWindowView') as HTMLElement; - if (chatBigWindowView) { - chatBigWindowView.scrollTop = chatBigWindowView.scrollHeight; - } - }, 100) - break; case 'showDriverList': equipmentManagementRef.current.setData(showDriverList) break; } } + window.electron.windowHandleMessageCallBack((_e: any, data: any) => { + setChatLists(data.parmes.chatList) + setTimeout(() => { + const chatBigWindowView = document.getElementById('chatBigWindowView') as HTMLElement; + if (chatBigWindowView) { + chatBigWindowView.scrollTop = chatBigWindowView.scrollHeight; + } + }, 100) + }) channel.postMessage({ type: 'chatBigWindowSendChannelMsg', chatBigWindowSendChannelMsg: { diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index c228217..bcc2c50 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -8,25 +8,20 @@ const ChatSmallWindow: React.FC = () => { const [isExpand, setIsExpand] = useState(false) const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { - channel.onmessage = function (event) { - const { type, chatListIten } = event.data; - switch (type) { - case 'chatListIten': - setChatLists((newChatList: any) => { - chatListIten.timer = setTimeout(() => { - removeItemByIndex(); - }, 3000); - return [chatListIten, ...newChatList] - }) - setTimeout(() => { - const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; - if (chatSmallWindowView) { - chatSmallWindowView.scrollTop = chatSmallWindowView.scrollHeight; - } - }, 100) - break; - } - } + window.electron.windowHandleMessageCallBack((_e: any, data: any) => { + setChatLists((newChatList: any) => { + data.parmes.chatListIten.timer = setTimeout(() => { + removeItemByIndex(); + }, 3000); + return [data.parmes.chatListIten, ...newChatList] + }) + setTimeout(() => { + const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; + if (chatSmallWindowView) { + chatSmallWindowView.scrollTop = chatSmallWindowView.scrollHeight; + } + }, 100) + }) return () => { channel.close(); } diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx index f0647ba..e86c258 100644 --- a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -2,26 +2,16 @@ import styles from '@/page/Meeting/CurrentSpeakUserWindow/index.module.scss' import { useEffect, useState } from "react"; const CurrentSpeakUserWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') - const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { - channel.onmessage = function (event) { - const { type, currentSpeakUser } = event.data; - switch (type) { - case 'currentSpeakUser': - if (currentSpeakUser.length) { - setInputValue(currentSpeakUser.join(';')) - } else { - setInputValue('') - } - break; + window.electron.windowHandleMessageCallBack((_e: any, data: any) => { + if (data.parmes.currentSpeakUser.length) { + setInputValue(data.parmes.currentSpeakUser.join(';')) + } else { + setInputValue('') } - } - return () => { - channel.close(); - } + }) }, []); - return ( <>
diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index c9b0c01..1863674 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -56,8 +56,7 @@ const ShareScreenWindow: React.FC = () => { useEffect(() => { getRoomUser() channel.onmessage = function (event) { - let { type, time, roomUserList, footerList, currentSpeakUserMe } = event.data; - const footerListTemplate = [...footerLists]; + let { type, time } = event.data; switch (type) { case 'time': setTimeStr(time) @@ -65,33 +64,32 @@ const ShareScreenWindow: React.FC = () => { setTimeStr(time++) }, 1000) break; - case 'roomUserList': - setRoomUserLists(roomUserList) - break; - case 'footerList': - footerListTemplate[0].title = footerList[0][0].active ? '解除静音' : '静音'; - footerListTemplate[0].active = footerList[0][0].active; - footerListTemplate[1].title = footerList[0][1].active ? '开启视频' : '关闭视频'; - footerListTemplate[1].active = footerList[0][1].active; - footerListTemplate[4].title = footerList[1][3].active ? '录制中' : '录制'; - footerListTemplate[4].active = footerList[1][3].active; - setFooterLists(footerListTemplate) - break; - case 'currentSpeakUserMe': - let domMe = document.getElementById(`micr-item-${userInfo.uid}`) as HTMLDivElement; - if (domMe) { - domMe.style.height = `${currentSpeakUserMe}%` - } - break; } } channel.postMessage({ type: 'shareScreenWindowGetTime' }); window.electron.windowHandleMessageCallBack((_e: any, data: any) => { - let domMe = document.getElementById(`micr-item-${userInfo.uid}`) as HTMLDivElement; - if (domMe) { - domMe.style.height = `${data.parmes.currentSpeakUserMe}%` + switch (data.parmes.type) { + case 'currentSpeakUserMe': + let domMe = document.getElementById(`micr-item-${userInfo.uid}`) as HTMLDivElement; + if (domMe) { + domMe.style.height = `${data.parmes.currentSpeakUserMe}%` + } + break; + case 'footerList': + const footerListTemplate = [...footerLists]; + footerListTemplate[0].title = data.parmes.footerList[0][0].active ? '解除静音' : '静音'; + footerListTemplate[0].active = data.parmes.footerList[0][0].active; + footerListTemplate[1].title = data.parmes.footerList[0][1].active ? '开启视频' : '关闭视频'; + footerListTemplate[1].active = data.parmes.footerList[0][1].active; + footerListTemplate[4].title = data.parmes.footerList[1][3].active ? '录制中' : '录制'; + footerListTemplate[4].active = data.parmes.footerList[1][3].active; + setFooterLists(footerListTemplate) + break; + case 'roomUserList': + setRoomUserLists(data.parmes.roomUserList) + break; } }) return () => { diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx index 7facfa6..1c75e2f 100644 --- a/src/page/Meeting/UserListWindow/index.tsx +++ b/src/page/Meeting/UserListWindow/index.tsx @@ -20,11 +20,8 @@ const UserListWindow: React.FC = () => { useEffect(() => { setUser(userInfo) channel.onmessage = function (event) { - const { type, roomUserList, showDriverList } = event.data; + const { type, showDriverList } = event.data; switch (type) { - case 'roomUserList': - setRoomUserList(roomUserList) - break; case 'showDriverList': equipmentManagementRef.current.setData(showDriverList) break; @@ -33,6 +30,13 @@ const UserListWindow: React.FC = () => { channel.postMessage({ type: 'userListWindowGetRoomUserList' }); + window.electron.windowHandleMessageCallBack((_e: any, data: any) => { + switch (data.parmes.type) { + case 'roomUserList': + setRoomUserList(data.parmes.roomUserList) + break; + } + }) return () => { channel.close(); } diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 4dbe7c0..c743f61 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -263,10 +263,13 @@ const Meeting: React.FC = () => { break; case 'shareScreenWindowGetFooterLists': setFooterList((res: any) => { - channel.postMessage({ - type: 'footerList', - footerList: res, - }); + window.electron.windowHandleMessage({ + key: 'shareScreenWindow', + parmes: { + footerList: res, + type: 'footerList' + } + }) return res }) break; @@ -303,10 +306,13 @@ const Meeting: React.FC = () => { break; case 'userListWindowGetRoomUserList': setRoomUserList(((res: any) => { - channel.postMessage({ - type: 'roomUserList', - roomUserList: res, - }); + window.electron.windowHandleMessage({ + key: 'userListWindow', + parmes: { + roomUserList: res, + type: 'roomUserList' + } + }) return res })) break; @@ -351,9 +357,11 @@ const Meeting: React.FC = () => { sendMsg(chatBigWindowSendChannelMsg.msg) } else[ setChatList((res: any) => { - channel.postMessage({ - type: 'chatList', - chatList: res, + window.electron.windowHandleMessage({ + key: 'chatBigWindow', + parmes: { + chatList: res, + } }) return res }) @@ -379,7 +387,12 @@ const Meeting: React.FC = () => { usernames.push(user.userName); } }) - storage.setItem('currentSpeakUser', JSON.stringify(usernames)) + window.electron.windowHandleMessage({ + key: 'currentSpeakUserWindow', + parmes: { + currentSpeakUser: usernames, + } + }) return res }); @@ -469,10 +482,12 @@ const Meeting: React.FC = () => { useEffect(() => { if (chatList.length) { - channel.postMessage({ - type: 'chatList', - chatList, - }); + window.electron.windowHandleMessage({ + key: 'chatBigWindow', + parmes: { + chatList, + } + }) } }, [chatList]); @@ -526,10 +541,12 @@ const Meeting: React.FC = () => { setNoViewChatList(storageNoViewChatList) } setChatList((newChatList: any) => [...newChatList, item]) - channel.postMessage({ - type: 'chatListIten', - chatListIten: item, - }); + window.electron.windowHandleMessage({ + key: 'chatSmallWindow', + parmes: { + chatListIten: item, + } + }) setStatusList((res: any) => { if (!res.userChatList) { api.open({ @@ -876,14 +893,27 @@ const Meeting: React.FC = () => { observerObject.observe(element); }); } - channel.postMessage({ - type: 'roomUserList', - roomUserList, - }); - channel.postMessage({ - type: 'footerList', - footerList, - }); + window.electron.windowHandleMessage({ + key: 'shareScreenWindow', + parmes: { + footerList, + type: 'footerList' + } + }) + window.electron.windowHandleMessage({ + key: 'shareScreenWindow', + parmes: { + roomUserList, + type: 'roomUserList' + } + }) + window.electron.windowHandleMessage({ + key: 'userListWindow', + parmes: { + roomUserList, + type: 'roomUserList' + } + }) return () => { elements.forEach(element => { observer?.unobserve(element); @@ -964,6 +994,7 @@ const Meeting: React.FC = () => { key: 'shareScreenWindow', parmes: { currentSpeakUserMe: percentage, + type: 'currentSpeakUserMe' } }) } @@ -1644,12 +1675,6 @@ const Meeting: React.FC = () => { case 'meetingMode': setMeetingMode(e.value) break; - case 'currentSpeakUser': - channel.postMessage({ - type: 'currentSpeakUser', - currentSpeakUser: JSON.parse(e.value), - }); - break; case 'quitMeeting': if (e.value) { setQuitMeetingModal(true) @@ -1694,10 +1719,12 @@ const Meeting: React.FC = () => { timestamp: +new Date() } setChatList((newChatList: any) => [...newChatList, item]) - channel.postMessage({ - type: 'chatListIten', - chatListIten: item, - }); + window.electron.windowHandleMessage({ + key: 'chatSmallWindow', + parmes: { + chatListIten: item, + } + }) setTextMsg(''); chatScrollBotton() } else { From fa6b85e4f56b7d8a0ec7715eaa9d0e969ba6f7ad Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 14:27:15 +0800 Subject: [PATCH 81/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Meeting/CurrentSpeakUserWindow/index.tsx | 10 +++++ src/page/Meeting/index.tsx | 41 ++++++++++--------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx index e86c258..64fbf8a 100644 --- a/src/page/Meeting/CurrentSpeakUserWindow/index.tsx +++ b/src/page/Meeting/CurrentSpeakUserWindow/index.tsx @@ -2,7 +2,14 @@ import styles from '@/page/Meeting/CurrentSpeakUserWindow/index.module.scss' import { useEffect, useState } from "react"; const CurrentSpeakUserWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') + const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { + let time: NodeJS.Timeout; + time = setInterval(() => { + channel.postMessage({ + type: 'currentSpeakUserWindowGetUserName' + }) + }, 1000) window.electron.windowHandleMessageCallBack((_e: any, data: any) => { if (data.parmes.currentSpeakUser.length) { setInputValue(data.parmes.currentSpeakUser.join(';')) @@ -10,6 +17,9 @@ const CurrentSpeakUserWindow: React.FC = () => { setInputValue('') } }) + return () => { + clearInterval(time) + } }, []); return ( diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index c743f61..0a2d665 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -374,30 +374,31 @@ const Meeting: React.FC = () => { userId: noticeWindowPostRoomManager.uid }) break; + case 'currentSpeakUserWindowGetUserName': + setSpeackUid((uids: any) => { + const usernames: string[] = []; + setRoomUserList((res: any) => { + uids.forEach((uid: any) => { + const user = res.find((item: any) => item.uid == uid); + if (user) { + usernames.push(user.userName); + } + }) + window.electron.windowHandleMessage({ + key: 'currentSpeakUserWindow', + parmes: { + currentSpeakUser: usernames, + } + }) + return res + }); + return [] + }) + break; } } time = setInterval(() => { setCurrentSeconds(currentSeconds++) - setSpeackUid((uids: any) => { - const usernames: string[] = []; - setRoomUserList((res: any) => { - uids.forEach((uid: any) => { - const user = res.find((item: any) => item.uid == uid); - if (user) { - usernames.push(user.userName); - } - }) - window.electron.windowHandleMessage({ - key: 'currentSpeakUserWindow', - parmes: { - currentSpeakUser: usernames, - } - }) - return res - }); - - return [] - }) }, 1000) // 首次加载图标更新 const firstFooterList = [...footerList] From 487675d20e54441833f94391c542526a67382073 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 14:58:47 +0800 Subject: [PATCH 82/95] =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ShareScreenWindow/index.tsx | 11 +++++++++-- src/page/Meeting/index.tsx | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index 1863674..91112d0 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -93,8 +93,15 @@ const ShareScreenWindow: React.FC = () => { } }) return () => { - clearInterval(timeout) - channel.close(); + setTimeStr(res => { + channel.postMessage({ + type: 'shareScreenWindowTime', + shareScreenWindowTime: res + }); + clearInterval(timeout) + channel.close(); + return res + }) }; }, []); const changeCurrentSeconds = (time: number): string => { diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 0a2d665..baf08c6 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -208,6 +208,7 @@ const Meeting: React.FC = () => { const { type, shareScreenWindowfooterListsTitle, + shareScreenWindowTime, userListWindowPostOpenMicr, userListWindowPostOpenCamera, userListWindowDeleteRoomManager, @@ -239,6 +240,9 @@ const Meeting: React.FC = () => { await stopScreenCapture() await allUserLook(userInfo.uid, userInfo.userName) break; + case 'shareScreenWindowTime': + setCurrentSeconds(shareScreenWindowTime) + break; case 'shareScreenWindowfooterListsTitle': switch (shareScreenWindowfooterListsTitle) { case '静音': From e4a6cf69d8d6b417f0eb671b497fd9e8d2fac417 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 15:09:27 +0800 Subject: [PATCH 83/95] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=85=B1=E4=BA=AB=E5=BA=94=E7=94=A8=E8=87=AA=E5=8A=A8=E6=89=93?= =?UTF-8?q?=E5=BC=80=E8=BD=AF=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index baf08c6..c7f2e45 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1048,7 +1048,7 @@ const Meeting: React.FC = () => { setSharedScreenItem('') allUserLook(userInfo.uid, userInfo.userName) } - return false + return bool }) } } From e117c03e371b0b017a88f4fbc8451bf23ee4cf78 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 15:43:52 +0800 Subject: [PATCH 84/95] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/NoticeWindow/index.tsx | 4 ++++ src/page/Meeting/index.tsx | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/page/Meeting/NoticeWindow/index.tsx b/src/page/Meeting/NoticeWindow/index.tsx index ea9a79a..61d4c56 100644 --- a/src/page/Meeting/NoticeWindow/index.tsx +++ b/src/page/Meeting/NoticeWindow/index.tsx @@ -10,6 +10,10 @@ const NoticeWindow: React.FC = () => { }); const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { + window.electron.setChildWindowShow({ + key: 'noticeWindow', + bool: false + }) channel.onmessage = function (event) { const { type, noticeItem } = event.data; switch (type) { diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index c7f2e45..acb2e9b 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1702,6 +1702,12 @@ const Meeting: React.FC = () => { userId: userInfo.uid }) } + setIsScreenCapture(bool => { + if (bool) { + allUserLook(userItem.screenShareId, userItem.userName) + } + return bool + }) return res }) From af39a32916021ecc024d8140a10a74c5d1c92845 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 17:49:28 +0800 Subject: [PATCH 85/95] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=97=A0=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index acb2e9b..0d3bc21 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1160,6 +1160,13 @@ const Meeting: React.FC = () => { if (key === 'ManagerRefresh') { callBack && callBack() } + if (key === 'OperCamera' && item.user.uid === userInfo.uid) { + if (item.user.enableCamera) { + agora.startCameraCapture() + } else { + agora.stopCameraCapture(); + } + } return res }) break; From 9aaf69b7d779d9372411f3e70554b271bdd8ba2b Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 21 Oct 2024 17:54:33 +0800 Subject: [PATCH 86/95] =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/ShareScreenWindow/index.tsx | 17 ++++++----------- src/page/Meeting/index.tsx | 6 ++---- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx index 91112d0..82f6d24 100644 --- a/src/page/Meeting/ShareScreenWindow/index.tsx +++ b/src/page/Meeting/ShareScreenWindow/index.tsx @@ -93,15 +93,8 @@ const ShareScreenWindow: React.FC = () => { } }) return () => { - setTimeStr(res => { - channel.postMessage({ - type: 'shareScreenWindowTime', - shareScreenWindowTime: res - }); - clearInterval(timeout) - channel.close(); - return res - }) + clearInterval(timeout) + channel.close(); }; }, []); const changeCurrentSeconds = (time: number): string => { @@ -144,7 +137,8 @@ const ShareScreenWindow: React.FC = () => { {changeCurrentSeconds(timeStr)} 共享中 {isExpand ? { channel.postMessage({ - type: 'shareScreenWindowClose' + type: 'shareScreenWindowClose', + shareScreenWindowClose: timeStr }); }}>结束共享 : 结束共享}
@@ -208,7 +202,8 @@ const ShareScreenWindow: React.FC = () => {