踢出房间&管理员
This commit is contained in:
parent
3e5c3ddcfd
commit
5def31854b
|
|
@ -60,3 +60,23 @@ export const PostOpenCamera = (data: any) =>
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const PostRoomManager = (roomId: string, data: any) =>
|
||||||
|
request({
|
||||||
|
url: `/room/manager?roomId=${roomId}`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
|
||||||
|
export const DeleteRoomManager = (roomId: string, data: any) =>
|
||||||
|
request({
|
||||||
|
url: `/room/manager?roomId=${roomId}`,
|
||||||
|
method: 'delete',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
|
||||||
|
export const GetRoomKickout = (roomNum: string, kickUid: string) =>
|
||||||
|
request({
|
||||||
|
url: `/room/kickout?roomNum=${roomNum}&kickUid=${kickUid}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@
|
||||||
|
|
||||||
.meetingUserList {
|
.meetingUserList {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 20px;
|
padding: 20px 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #16191E;
|
background-color: #16191E;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -291,6 +291,8 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
padding: 0 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
>span {
|
>span {
|
||||||
color: #EEEEEE;
|
color: #EEEEEE;
|
||||||
|
|
@ -312,7 +314,10 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-bottom: 20px;
|
position: relative;
|
||||||
|
padding: 10px 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
>div:nth-child(1) {
|
>div:nth-child(1) {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -347,6 +352,45 @@
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
>div:nth-child(3) {
|
||||||
|
position: absolute;
|
||||||
|
top: 60px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
width: 200px;
|
||||||
|
z-index: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
display: none;
|
||||||
|
background-color: rgb(16, 19, 23);
|
||||||
|
padding: 20px 0;
|
||||||
|
|
||||||
|
>div {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
border-width: 0 10px 10px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: rgb(52, 52, 52);
|
||||||
|
|
||||||
|
>div:nth-child(3) {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -355,8 +399,11 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
padding: 0 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
>div {
|
>div {
|
||||||
|
font-size: 20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-color: #31353A;
|
background-color: #31353A;
|
||||||
color: #EEEEEE;
|
color: #EEEEEE;
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,10 @@ import { DeleteOutlined, ProfileOutlined, ReloadOutlined, SearchOutlined, Vertic
|
||||||
import { useLocation, useNavigate } from 'react-router-dom';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
import { thumbImageBufferToBase64 } from '@/utils/package/base64'
|
import { thumbImageBufferToBase64 } from '@/utils/package/base64'
|
||||||
import { storage } from '@/utils';
|
import { storage } from '@/utils';
|
||||||
import { GetRoomFile, PostRoomFile, DeleteRoomFile, GetRoomUpFileurl, GetRoomFileDwUrl, GetRoomUser, PostOpenMicr, PostOpenCamera } from '@/api/Meeting';
|
import { GetRoomFile, PostRoomFile, DeleteRoomFile, GetRoomUpFileurl, GetRoomFileDwUrl, GetRoomUser, PostOpenMicr, PostOpenCamera, PostRoomManager, DeleteRoomManager, GetRoomKickout } from '@/api/Meeting';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import ImageUrl from '@/utils/package/imageUrl'
|
import ImageUrl from '@/utils/package/imageUrl'
|
||||||
import agora from '@/utils/package/agora'
|
import agora from '@/utils/package/agora'
|
||||||
import StupWizard from '@/components/StupWizard';
|
|
||||||
import SpeakerModeModal from '@/components/SpeakerModeModal';
|
import SpeakerModeModal from '@/components/SpeakerModeModal';
|
||||||
import { onInvoke, onSignalr, offSignalr } from '@/utils/package/signalr';
|
import { onInvoke, onSignalr, offSignalr } from '@/utils/package/signalr';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
@ -21,7 +20,6 @@ const { Column } = Table
|
||||||
const Meeting: React.FC = () => {
|
const Meeting: React.FC = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { state } = useLocation();
|
const { state } = useLocation();
|
||||||
const stupWizardRef = useRef<any>();
|
|
||||||
const speakerModeModalRef = useRef<any>();
|
const speakerModeModalRef = useRef<any>();
|
||||||
const [statusList, setStatusList] = useState({
|
const [statusList, setStatusList] = useState({
|
||||||
userList: false,
|
userList: false,
|
||||||
|
|
@ -180,12 +178,21 @@ const Meeting: React.FC = () => {
|
||||||
break;
|
break;
|
||||||
case 'Operation':
|
case 'Operation':
|
||||||
// 1:全员退出会议
|
// 1:全员退出会议
|
||||||
|
// 2:设置取消管理员
|
||||||
|
// 3:踢出房间
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 1:
|
case 1:
|
||||||
leaveChannel()
|
leaveChannel()
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
getRoomUser()
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'ForceExitRoom':
|
||||||
|
leaveChannel()
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return () => {
|
return () => {
|
||||||
|
|
@ -258,7 +265,7 @@ const Meeting: React.FC = () => {
|
||||||
postOpenCamera(true)
|
postOpenCamera(true)
|
||||||
break;
|
break;
|
||||||
case '设置向导':
|
case '设置向导':
|
||||||
stupWizardRef.current.changeIsStupWizard()
|
|
||||||
break;
|
break;
|
||||||
case '录制':
|
case '录制':
|
||||||
if (currentVideoId === user.account) {
|
if (currentVideoId === user.account) {
|
||||||
|
|
@ -365,7 +372,7 @@ const Meeting: React.FC = () => {
|
||||||
case 'isRemotJoin':
|
case 'isRemotJoin':
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getRoomUser()
|
getRoomUser()
|
||||||
}, 1000)
|
}, 2000)
|
||||||
break;
|
break;
|
||||||
case 'meetingMode':
|
case 'meetingMode':
|
||||||
setMeetingMode(e.value)
|
setMeetingMode(e.value)
|
||||||
|
|
@ -514,7 +521,13 @@ const Meeting: React.FC = () => {
|
||||||
})
|
})
|
||||||
}} />
|
}} />
|
||||||
</div>
|
</div>
|
||||||
<Input placeholder="请输入用户名" className='drag' prefix={<SearchOutlined style={{ color: 'white' }} />} />
|
<div style={{ padding: '0 14px', boxSizing: 'border-box' }}>
|
||||||
|
<Input
|
||||||
|
placeholder="请输入用户名"
|
||||||
|
className='drag'
|
||||||
|
prefix={<SearchOutlined style={{ color: 'white' }} />}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div className={styles.meetingUserListContent}>
|
<div className={styles.meetingUserListContent}>
|
||||||
{roomUserList.map((item: any, index: number) =>
|
{roomUserList.map((item: any, index: number) =>
|
||||||
<div key={index} className='drag'>
|
<div key={index} className='drag'>
|
||||||
|
|
@ -522,13 +535,63 @@ const Meeting: React.FC = () => {
|
||||||
<div><img src={ImageUrl.avatar} alt="" /></div>
|
<div><img src={ImageUrl.avatar} alt="" /></div>
|
||||||
<span>
|
<span>
|
||||||
{item.userName}
|
{item.userName}
|
||||||
{item.roleId === '1' ? <span style={{ color: '#02B188', marginLeft: '4px' }}>主持人</span> : null}
|
{item.roleId === '1' || item.isManager ? <span style={{ color: '#02B188', marginLeft: '4px' }}>主持人</span> : null}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<img src={item.enableMicr ? ImageUrl.icon22 : ImageUrl.icon22Active} alt="" />
|
<img src={item.enableMicr ? ImageUrl.icon22 : ImageUrl.icon22Active} alt="" />
|
||||||
<img src={item.enableCamera ? ImageUrl.icon23 : ImageUrl.icon23Active} alt="" />
|
<img src={item.enableCamera ? ImageUrl.icon23 : ImageUrl.icon23Active} alt="" />
|
||||||
</div>
|
</div>
|
||||||
|
{item.account !== user.account && user.roleId === '1' ? <div className='drag'>
|
||||||
|
{!item.isManager ? <Button
|
||||||
|
type="primary"
|
||||||
|
className='m-ant-btn'
|
||||||
|
style={{ marginBottom: '10px', width: '80%' }}
|
||||||
|
size={'small'}
|
||||||
|
onClick={() => {
|
||||||
|
PostRoomManager(state.roomId, [item.id]).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
onInvoke('sendOper', {
|
||||||
|
roomNum: state.channelId,
|
||||||
|
type: 2,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
>设为管理员</Button> : <Button
|
||||||
|
type="primary"
|
||||||
|
className='m-ant-btn'
|
||||||
|
style={{ marginBottom: '10px', width: '80%' }}
|
||||||
|
size={'small'}
|
||||||
|
onClick={() => {
|
||||||
|
DeleteRoomManager(state.roomId, [item.id]).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
onInvoke('sendOper', {
|
||||||
|
roomNum: state.channelId,
|
||||||
|
type: 2,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
>取消管理员</Button>}
|
||||||
|
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
className='m-ant-btn'
|
||||||
|
style={{ width: '80%' }}
|
||||||
|
size={'small'}
|
||||||
|
onClick={() => {
|
||||||
|
GetRoomKickout(state.channelId, item.id).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
onInvoke('sendOper', {
|
||||||
|
roomNum: state.channelId,
|
||||||
|
type: 3,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
>踢出房间</Button>
|
||||||
|
</div> : null}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -645,7 +708,6 @@ const Meeting: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
<StupWizard ref={stupWizardRef} />
|
|
||||||
<Modal
|
<Modal
|
||||||
title="共享文件"
|
title="共享文件"
|
||||||
open={isSharedFilesModel}
|
open={isSharedFilesModel}
|
||||||
|
|
@ -814,7 +876,7 @@ const meetingContentUser = (item: any) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.meetingContentUser}>
|
<div className={styles.meetingContentUser}>
|
||||||
{item.roleId === '1' ? <div className={styles.meetingContentUserRole}>
|
{item.roleId === '1' || item.isManager ? <div className={styles.meetingContentUserRole}>
|
||||||
<img src={ImageUrl.icon32} alt="" />
|
<img src={ImageUrl.icon32} alt="" />
|
||||||
</div> : null}
|
</div> : null}
|
||||||
<div className={styles.meetingContentUserName}>
|
<div className={styles.meetingContentUserName}>
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,11 @@ export const onSignalr = (callBack: Function) => {
|
||||||
type
|
type
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
connection.on("ForceExitRoom", () => {
|
||||||
|
callBack({
|
||||||
|
key: 'ForceExitRoom',
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const offSignalr = () => {
|
export const offSignalr = () => {
|
||||||
|
|
@ -42,6 +47,7 @@ export const offSignalr = () => {
|
||||||
connection.off('ReceiveMessage');
|
connection.off('ReceiveMessage');
|
||||||
connection.off('RefreshUserList');
|
connection.off('RefreshUserList');
|
||||||
connection.off('Operation');
|
connection.off('Operation');
|
||||||
|
connection.off('ForceExitRoom');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const onInvoke = async (str: string, data: any) => {
|
export const onInvoke = async (str: string, data: any) => {
|
||||||
|
|
@ -57,6 +63,8 @@ export const onInvoke = async (str: string, data: any) => {
|
||||||
break;
|
break;
|
||||||
case 'sendOper':
|
case 'sendOper':
|
||||||
// 1:全员退出会议
|
// 1:全员退出会议
|
||||||
|
// 2:设置取消管理员
|
||||||
|
// 3:踢出房间
|
||||||
await connection.invoke(str, data.roomNum, data.type)
|
await connection.invoke(str, data.roomNum, data.type)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue