优化文字

This commit is contained in:
yj 2024-08-16 17:49:04 +08:00
parent 8b4b91c06b
commit 7fcbbfce56
2 changed files with 10 additions and 10 deletions

View File

@ -122,7 +122,7 @@ const Meeting: React.FC = () => {
const [isShareUser, setIsShareUser] = useState<any>(null) const [isShareUser, setIsShareUser] = useState<any>(null)
const [currentLookUserStatus, setCurrentLookUserStatus] = useState<0 | 1 | 2 | 3 | 4>(1) const [currentLookUserStatus, setCurrentLookUserStatus] = useState<0 | 1 | 2 | 3 | 4>(1)
let userInfo = JSON.parse(storage.getItem('user') as string) let userInfo = JSON.parse(storage.getItem('user') as string)
const msgTips = '您不是管理员或主讲人,无法开启此功能!' const msgTips = '您不是管理员或发言人,无法开启此功能!'
useEffect(() => { useEffect(() => {
let time = null as any; let time = null as any;
setUser(userInfo) setUser(userInfo)
@ -295,7 +295,7 @@ const Meeting: React.FC = () => {
case 'OperCamera': case 'OperCamera':
setAllUserListData('OperCamera', item) setAllUserListData('OperCamera', item)
break; break;
// 主讲人用户信息刷新 // 发言人用户信息刷新
case 'ManagerRefresh': case 'ManagerRefresh':
if (item.user.uid === userInfo.uid) { if (item.user.uid === userInfo.uid) {
await agora.updateChannelMediaOptions(item.user.isRoomManager) await agora.updateChannelMediaOptions(item.user.isRoomManager)
@ -348,21 +348,21 @@ const Meeting: React.FC = () => {
const changeAgoraDevice = () => { const changeAgoraDevice = () => {
function moveAdminsAndSpeakersToFront(arr: any[]): any[] { function moveAdminsAndSpeakersToFront(arr: any[]): any[] {
// 创建一个新的数组来存放管理员和主讲 // 创建一个新的数组来存放管理员和发言
const adminsAndSpeakers = [] as any; const adminsAndSpeakers = [] as any;
// 创建一个新的数组来存放其他用户 // 创建一个新的数组来存放其他用户
const otherUsers = [] as any; const otherUsers = [] as any;
// 遍历原始数组 // 遍历原始数组
arr.forEach((item: any) => { arr.forEach((item: any) => {
if (item.roleId === '1' || item.isRoomManager) { if (item.roleId === '1' || item.isRoomManager) {
// 如果是管理员或主讲人,添加到 adminsAndSpeakers 数组 // 如果是管理员或发言人,添加到 adminsAndSpeakers 数组
adminsAndSpeakers.push(item); adminsAndSpeakers.push(item);
} else { } else {
// 否则,添加到 otherUsers 数组 // 否则,添加到 otherUsers 数组
otherUsers.push(item); otherUsers.push(item);
} }
}); });
// 将管理员和主讲人放在数组的最前面 // 将管理员和发言人放在数组的最前面
return [...adminsAndSpeakers, ...otherUsers]; return [...adminsAndSpeakers, ...otherUsers];
} }
setRoomUserList((res: any) => { setRoomUserList((res: any) => {
@ -998,7 +998,7 @@ const Meeting: React.FC = () => {
}) })
} }
}} }}
>{item.isRoomManager ? '取消房间主讲人' : '设为房间主讲人'}</Button> : null} >{item.isRoomManager ? '取消房间发言人' : '设为房间发言人'}</Button> : null}
<Button <Button
type="primary" type="primary"
className='m-ant-btn' className='m-ant-btn'
@ -1129,7 +1129,7 @@ const Meeting: React.FC = () => {
{item.userName}{item.uid === user.uid ? '(我)' : ''} {item.userName}{item.uid === user.uid ? '(我)' : ''}
{item.roleId === '1' || item.isRoomManager ? {item.roleId === '1' || item.isRoomManager ?
<span style={{ color: '#02B188', marginLeft: '4px' }}> <span style={{ color: '#02B188', marginLeft: '4px' }}>
{item.roleId === '1' ? '管理员' : '主讲人'} {item.roleId === '1' ? '管理员' : '发言人'}
</span> </span>
: null} : null}
</span> </span>
@ -1168,7 +1168,7 @@ const Meeting: React.FC = () => {
}) })
} }
}} }}
>{item.isRoomManager ? '取消房间主讲人' : '设为房间主讲人'}</Button> >{item.isRoomManager ? '取消房间发言人' : '设为房间发言人'}</Button>
<Button <Button
type="primary" type="primary"
className='m-ant-btn' className='m-ant-btn'
@ -1369,7 +1369,7 @@ const meetingContentUser = (item: any) => {
<img src={ImageUrl.icon32} alt="" /> <img src={ImageUrl.icon32} alt="" />
</div> : null} </div> : null}
{!item.enableMicr ? <img src={item.enableMicr ? ImageUrl.icon22 : ImageUrl.icon22Active} alt="" /> : ''} {!item.enableMicr ? <img src={item.enableMicr ? ImageUrl.icon22 : ImageUrl.icon22Active} alt="" /> : ''}
<span>{item.userName}{item.roleId === '1' || item.isRoomManager ? item.roleId === '1' ? '(管理员)' : '(主讲人)' : ''}</span> <span>{item.userName}{item.roleId === '1' || item.isRoomManager ? item.roleId === '1' ? '(管理员)' : '(发言人)' : ''}</span>
</div> </div>
</div> </div>
</> </>

View File

@ -131,7 +131,7 @@ export const onSignalr = (callBack: Function) => {
user user
}) })
}); });
// 主讲人用户信息刷新 // 发言人用户信息刷新
connection.on("ManagerRefresh", (user: any) => { connection.on("ManagerRefresh", (user: any) => {
callBack({ callBack({
key: 'ManagerRefresh', key: 'ManagerRefresh',