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

View File

@ -20,7 +20,6 @@ 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 CurrentSpeakUserWindow from "@/page/Meeting/CurrentSpeakUserWindow";
import NoticeWindow from "@/page/Meeting/NoticeWindow";
import { getKeyOpenChildWindow, setKeyOpenChildWindow, storageSeeting } from "./utils/package/public";
const fs = require('fs').promises;
@ -37,7 +36,7 @@ const App: React.FC = () => {
});
const [spinning, setSpinning] = useState(false);
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) {
useEffect(() => {
let userInfo = JSON.parse(storage.getItem('user') as string)
@ -276,7 +275,6 @@ const App: React.FC = () => {
<Route path='/userListWindow' element={<UserListWindow />} />
<Route path='/chatSmallWindow' element={<ChatSmallWindow />} />
<Route path='/chatBigWindow' element={<ChatBigWindow />} />
<Route path='/currentSpeakUserWindow' element={<CurrentSpeakUserWindow />} />
<Route path='/noticeWindow' element={<NoticeWindow />} />
<Route path='*' element={<NotFound />} />
</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 {
position: absolute;
width: 100%;
bottom: 0;
left: 0;
color: white;
text-align: center;
z-index: 1;
z-index: 2;
background-color: rgba(0, 0, 0, 0.5);
cursor: pointer;
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 [_speackUid, setSpeackUid] = useState<any>([])
const [currentSpeakUser, setCurrentSpeakUser] = useState<any>([])
const [chatList, setChatList] = useState<any>([])
const [isExpand, setIsExpand] = useState(false)
const [currentVideoId, setCurrentVideoId] = useState('')
@ -380,7 +381,12 @@ const Meeting: React.FC = () => {
userId: noticeWindowPostRoomManager.uid
})
break;
case 'currentSpeakUserWindowGetUserName':
}
}
time = setInterval(() => {
setCurrentSeconds(currentSeconds => {
return currentSeconds += 1
})
setSpeackUid((uids: any) => {
const usernames: string[] = [];
setRoomUserList((res: any) => {
@ -390,23 +396,11 @@ const Meeting: React.FC = () => {
usernames.push(user.userName);
}
})
window.electron.windowHandleMessage({
key: 'currentSpeakUserWindow',
parmes: {
currentSpeakUser: usernames,
}
})
setCurrentSpeakUser(usernames)
return res
});
return []
})
break;
}
}
time = setInterval(() => {
setCurrentSeconds(currentSeconds => {
return currentSeconds += 1
})
}, 1000)
// 首次加载图标更新
const firstFooterList = [...footerList]
@ -418,9 +412,13 @@ const Meeting: React.FC = () => {
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) {
console.log(isScreenCapture);
if (stateInfo && setting.isRecordingTips) {
setRecorder((data: any) => {
if (!data) {
setIsScreenCapture(bool => {
if (!bool) {
confirm({
title: '提示',
icon: <ExclamationCircleFilled />,
@ -441,6 +439,9 @@ const Meeting: React.FC = () => {
}
})
}
return bool
})
}
return data
})
}
@ -1628,13 +1629,6 @@ const Meeting: React.FC = () => {
key: 'chatSmallWindow',
show: true,
})
window.electron.createChildWindow({
url: location.origin + `/#/currentSpeakUserWindow`,
width: 200,
height: 30,
key: 'currentSpeakUserWindow',
show: true,
})
window.electron.createChildWindow({
url: location.origin + `/#/chatBigWindow`,
width: 540,
@ -2090,13 +2084,14 @@ const Meeting: React.FC = () => {
<>
<div className={styles.meeting}>
{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}>
<Avatar name={user.userName} />
</div> : null}
<div className={`${styles.meetingAbsoluteText} drag`} onClick={() => {
<div style={{ bottom: '0px' }} className={`${styles.meetingAbsoluteText} drag`} onClick={() => {
setIsExpand(!isExpand)
window.electron.setChildWindow({
height: isExpand ? 160 : 20,
height: isExpand ? 160 : 40,
key: 'main'
})
}}><span>{isExpand ? '展开' : '收起'}</span></div>
@ -2104,7 +2099,7 @@ const Meeting: React.FC = () => {
{contextHolder}
<div className={styles.meetingHeader}>
<div>
<Popover
{isScreenCapture ? null : <Popover
content={
<div style={{ color: 'white' }}>
<div>
@ -2148,7 +2143,7 @@ const Meeting: React.FC = () => {
{networkIcon(currentEffective)}
<span></span>
</div>
</Popover>
</Popover>}
<div>{changeCurrentSeconds()}</div>
</div>
<div>{state.channelId} {state.roomName}</div>
@ -2663,7 +2658,7 @@ const Meeting: React.FC = () => {
) : null
}
</div>
<div className={styles.meetingContentFooter}>
{isScreenCapture ? null : <div className={styles.meetingContentFooter}>
{footerList.map((item: any, itemIndex: number) => {
return (
<div key={itemIndex}>
@ -2816,7 +2811,7 @@ const Meeting: React.FC = () => {
</div>
)
})}
</div>
</div>}
</div>
</div>
<Modal title="共享屏幕" open={isSharedScreenModal} footer={null} closable={false} centered width={'800px'}>