yangjie #35

Merged
yangqiang merged 8 commits from yangjie into master 2024-11-13 10:41:16 +08:00
6 changed files with 54 additions and 117 deletions
Showing only changes of commit d2cf731a34 - Show all commits

View File

@ -552,6 +552,7 @@ app.on('ready', () => {
} }
} }
mainWindow.setSkipTaskbar(false) mainWindow.setSkipTaskbar(false)
mainWindow.setResizable(true)
mainWindow.setAlwaysOnTop(false) mainWindow.setAlwaysOnTop(false)
} else { } else {
childWindow[key].close() childWindow[key].close()
@ -574,7 +575,6 @@ app.on('ready', () => {
mainWindow.setMinimumSize(250, config.height); mainWindow.setMinimumSize(250, config.height);
mainWindow.setMaximumSize(250, config.height); mainWindow.setMaximumSize(250, config.height);
mainWindow.setSize(250, config.height) mainWindow.setSize(250, config.height)
mainWindow.setBounds({ height: config.height })
break; break;
} }
}); });
@ -695,16 +695,13 @@ function windowOperation(config) {
x = Math.round((display.workArea.width - child.getSize()[0]) / 2); x = Math.round((display.workArea.width - child.getSize()[0]) / 2);
child.setPosition(x, 0); child.setPosition(x, 0);
mainWindow.setSkipTaskbar(true) mainWindow.setSkipTaskbar(true)
mainWindow.setResizable(false)
mainWindow.setAlwaysOnTop(true, 'screen-saver') mainWindow.setAlwaysOnTop(true, 'screen-saver')
break; break;
case 'chatSmallWindow': case 'chatSmallWindow':
y = height - child.getSize()[1]; y = height - child.getSize()[1];
child.setPosition(40, y - 200); child.setPosition(40, y - 200);
break; break;
case 'currentSpeakUserWindow':
x = width - child.getSize()[0];
child.setPosition(x - 40, 210);
break;
case 'noticeWindow': case 'noticeWindow':
x = width - child.getSize()[0]; x = width - child.getSize()[0];
y = height - child.getSize()[1]; y = height - child.getSize()[1];

View File

@ -20,7 +20,6 @@ import ShareScreenWindow from "@/page/Meeting/ShareScreenWindow";
import UserListWindow from "@/page/Meeting/UserListWindow"; import UserListWindow from "@/page/Meeting/UserListWindow";
import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow"; import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow";
import ChatBigWindow from "@/page/Meeting/ChatBigWindow"; import ChatBigWindow from "@/page/Meeting/ChatBigWindow";
import CurrentSpeakUserWindow from "@/page/Meeting/CurrentSpeakUserWindow";
import NoticeWindow from "@/page/Meeting/NoticeWindow"; import NoticeWindow from "@/page/Meeting/NoticeWindow";
import { getKeyOpenChildWindow, setKeyOpenChildWindow, storageSeeting } from "./utils/package/public"; import { getKeyOpenChildWindow, setKeyOpenChildWindow, storageSeeting } from "./utils/package/public";
const fs = require('fs').promises; const fs = require('fs').promises;
@ -37,7 +36,7 @@ const App: React.FC = () => {
}); });
const [spinning, setSpinning] = useState(false); const [spinning, setSpinning] = useState(false);
const [isState, setIsState] = useState(true); const [isState, setIsState] = useState(true);
const urlHashArr = ['#/userListWindow', '#/shareScreenWindow', '#/chatSmallWindow', '#/chatBigWindow', '#/currentSpeakUserWindow', '#/noticeWindow'] const urlHashArr = ['#/userListWindow', '#/shareScreenWindow', '#/chatSmallWindow', '#/chatBigWindow', '#/noticeWindow']
if (urlHashArr.indexOf(location.hash) == -1) { if (urlHashArr.indexOf(location.hash) == -1) {
useEffect(() => { useEffect(() => {
let userInfo = JSON.parse(storage.getItem('user') as string) let userInfo = JSON.parse(storage.getItem('user') as string)
@ -276,7 +275,6 @@ const App: React.FC = () => {
<Route path='/userListWindow' element={<UserListWindow />} /> <Route path='/userListWindow' element={<UserListWindow />} />
<Route path='/chatSmallWindow' element={<ChatSmallWindow />} /> <Route path='/chatSmallWindow' element={<ChatSmallWindow />} />
<Route path='/chatBigWindow' element={<ChatBigWindow />} /> <Route path='/chatBigWindow' element={<ChatBigWindow />} />
<Route path='/currentSpeakUserWindow' element={<CurrentSpeakUserWindow />} />
<Route path='/noticeWindow' element={<NoticeWindow />} /> <Route path='/noticeWindow' element={<NoticeWindow />} />
<Route path='*' element={<NotFound />} /> <Route path='*' element={<NotFound />} />
</Routes> </Routes>

View File

@ -1,19 +0,0 @@
.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;
}
}

View File

@ -1,36 +0,0 @@
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(';'))
} else {
setInputValue('')
}
})
return () => {
clearInterval(time)
}
}, []);
return (
<>
<div className={styles.currentSpeakUserWindow}>
<div title={`正在说话: ${inputValue}`}>
{`正在说话: ${inputValue}`}
</div>
</div >
</>
)
}
export default CurrentSpeakUserWindow

View File

@ -121,14 +121,16 @@
.meetingAbsoluteText { .meetingAbsoluteText {
position: absolute; position: absolute;
width: 100%; width: 100%;
bottom: 0;
left: 0; left: 0;
color: white; color: white;
text-align: center; text-align: center;
z-index: 1; z-index: 2;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
} }
} }

View File

@ -146,6 +146,7 @@ const Meeting: React.FC = () => {
}); });
const [roomUserList, setRoomUserList] = useState<any>([]) const [roomUserList, setRoomUserList] = useState<any>([])
const [_speackUid, setSpeackUid] = useState<any>([]) const [_speackUid, setSpeackUid] = useState<any>([])
const [currentSpeakUser, setCurrentSpeakUser] = useState<any>([])
const [chatList, setChatList] = useState<any>([]) const [chatList, setChatList] = useState<any>([])
const [isExpand, setIsExpand] = useState(false) const [isExpand, setIsExpand] = useState(false)
const [currentVideoId, setCurrentVideoId] = useState('') const [currentVideoId, setCurrentVideoId] = useState('')
@ -380,7 +381,12 @@ const Meeting: React.FC = () => {
userId: noticeWindowPostRoomManager.uid userId: noticeWindowPostRoomManager.uid
}) })
break; break;
case 'currentSpeakUserWindowGetUserName': }
}
time = setInterval(() => {
setCurrentSeconds(currentSeconds => {
return currentSeconds += 1
})
setSpeackUid((uids: any) => { setSpeackUid((uids: any) => {
const usernames: string[] = []; const usernames: string[] = [];
setRoomUserList((res: any) => { setRoomUserList((res: any) => {
@ -390,23 +396,11 @@ const Meeting: React.FC = () => {
usernames.push(user.userName); usernames.push(user.userName);
} }
}) })
window.electron.windowHandleMessage({ setCurrentSpeakUser(usernames)
key: 'currentSpeakUserWindow',
parmes: {
currentSpeakUser: usernames,
}
})
return res return res
}); });
return [] return []
}) })
break;
}
}
time = setInterval(() => {
setCurrentSeconds(currentSeconds => {
return currentSeconds += 1
})
}, 1000) }, 1000)
// 首次加载图标更新 // 首次加载图标更新
const firstFooterList = [...footerList] const firstFooterList = [...footerList]
@ -418,9 +412,13 @@ const Meeting: React.FC = () => {
setTimeout(async () => { setTimeout(async () => {
const setting = await JSON.parse(storage.getItem('setting') as string); const setting = await JSON.parse(storage.getItem('setting') as string);
const stateInfo = await JSON.parse(storage.getItem('stateInfo') as string); const stateInfo = await JSON.parse(storage.getItem('stateInfo') as string);
if (stateInfo && setting.isRecordingTips && !recorder) { console.log(isScreenCapture);
if (stateInfo && setting.isRecordingTips) {
setRecorder((data: any) => { setRecorder((data: any) => {
if (!data) { if (!data) {
setIsScreenCapture(bool => {
if (!bool) {
confirm({ confirm({
title: '提示', title: '提示',
icon: <ExclamationCircleFilled />, icon: <ExclamationCircleFilled />,
@ -441,6 +439,9 @@ const Meeting: React.FC = () => {
} }
}) })
} }
return bool
})
}
return data return data
}) })
} }
@ -1628,13 +1629,6 @@ const Meeting: React.FC = () => {
key: 'chatSmallWindow', key: 'chatSmallWindow',
show: true, show: true,
}) })
window.electron.createChildWindow({
url: location.origin + `/#/currentSpeakUserWindow`,
width: 200,
height: 30,
key: 'currentSpeakUserWindow',
show: true,
})
window.electron.createChildWindow({ window.electron.createChildWindow({
url: location.origin + `/#/chatBigWindow`, url: location.origin + `/#/chatBigWindow`,
width: 540, width: 540,
@ -2090,13 +2084,14 @@ const Meeting: React.FC = () => {
<> <>
<div className={styles.meeting}> <div className={styles.meeting}>
{isScreenCapture ? <div className={`${styles.meetingAbsolute}`} id='meetingAbsoluteVideo'> {isScreenCapture ? <div className={`${styles.meetingAbsolute}`} id='meetingAbsoluteVideo'>
<div style={{ top: '0px' }} className={`${styles.meetingAbsoluteText}`}>{currentSpeakUser.length ? '正在说话:' + currentSpeakUser.join(';') : '正在说话:'}</div>
{footerList[0][1].active ? <div className={styles.meetingAbsoluteLoading}> {footerList[0][1].active ? <div className={styles.meetingAbsoluteLoading}>
<Avatar name={user.userName} /> <Avatar name={user.userName} />
</div> : null} </div> : null}
<div className={`${styles.meetingAbsoluteText} drag`} onClick={() => { <div style={{ bottom: '0px' }} className={`${styles.meetingAbsoluteText} drag`} onClick={() => {
setIsExpand(!isExpand) setIsExpand(!isExpand)
window.electron.setChildWindow({ window.electron.setChildWindow({
height: isExpand ? 160 : 20, height: isExpand ? 160 : 40,
key: 'main' key: 'main'
}) })
}}><span>{isExpand ? '展开' : '收起'}</span></div> }}><span>{isExpand ? '展开' : '收起'}</span></div>
@ -2104,7 +2099,7 @@ const Meeting: React.FC = () => {
{contextHolder} {contextHolder}
<div className={styles.meetingHeader}> <div className={styles.meetingHeader}>
<div> <div>
<Popover {isScreenCapture ? null : <Popover
content={ content={
<div style={{ color: 'white' }}> <div style={{ color: 'white' }}>
<div> <div>
@ -2148,7 +2143,7 @@ const Meeting: React.FC = () => {
{networkIcon(currentEffective)} {networkIcon(currentEffective)}
<span></span> <span></span>
</div> </div>
</Popover> </Popover>}
<div>{changeCurrentSeconds()}</div> <div>{changeCurrentSeconds()}</div>
</div> </div>
<div>{state.channelId} {state.roomName}</div> <div>{state.channelId} {state.roomName}</div>
@ -2663,7 +2658,7 @@ const Meeting: React.FC = () => {
) : null ) : null
} }
</div> </div>
<div className={styles.meetingContentFooter}> {isScreenCapture ? null : <div className={styles.meetingContentFooter}>
{footerList.map((item: any, itemIndex: number) => { {footerList.map((item: any, itemIndex: number) => {
return ( return (
<div key={itemIndex}> <div key={itemIndex}>
@ -2816,7 +2811,7 @@ const Meeting: React.FC = () => {
</div> </div>
) )
})} })}
</div> </div>}
</div> </div>
</div> </div>
<Modal title="共享屏幕" open={isSharedScreenModal} footer={null} closable={false} centered width={'800px'}> <Modal title="共享屏幕" open={isSharedScreenModal} footer={null} closable={false} centered width={'800px'}>