邀请完成
This commit is contained in:
parent
d7eaf1584d
commit
7a75abc22c
|
|
@ -72,7 +72,7 @@ const App: React.FC = () => {
|
|||
break;
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
}, [navigate])
|
||||
const handleResize = (): void => {
|
||||
setWindowSize({
|
||||
width: window.innerWidth,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { SearchOutlined } from '@ant-design/icons';
|
|||
import { GetUserList } from '@/api/Home/User';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { PostRoomInvite } from '@/api/Meeting';
|
||||
import { storage } from '@/utils';
|
||||
const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {
|
||||
useImperativeHandle(ref, () => ({
|
||||
changeInvitingPersonnelModal: () => {
|
||||
|
|
@ -164,8 +165,18 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {
|
|||
<Button type="primary" onClick={() => { setIsInvitingPersonnelModal(false) }} style={{ backgroundColor: '#31353A', marginRight: '14px' }}>取消</Button>
|
||||
<Button type="primary" className='m-ant-btn' onClick={() => {
|
||||
if (checkedList.length) {
|
||||
PostRoomInvite(state.roomId, checkedList.map((item: any) => item.id))
|
||||
setIsInvitingPersonnelModal(false)
|
||||
let userInfo = JSON.parse(storage.getItem('user') as string)
|
||||
let me = checkedList.find((item: any) => item.id === userInfo.uid)
|
||||
if (me) {
|
||||
message.error('您不能邀请自己')
|
||||
} else {
|
||||
PostRoomInvite(state.roomId, checkedList.map((item: any) => item.id)).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success('邀请成功')
|
||||
setIsInvitingPersonnelModal(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
message.error('请选择人员')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ const JoinMeetingModal = forwardRef((props: any, ref: any) => {
|
|||
<span>拒绝</span>
|
||||
</div>
|
||||
<div onClick={() => {
|
||||
if (location.hash.indexOf('/meeting') !== -1) {
|
||||
setIsJoinMeetingModal(false)
|
||||
return message.error('您已经在房间中了,请退出房间重试。')
|
||||
}
|
||||
isGetCheckoutRoomNum(info.roomNum, (bool: boolean) => {
|
||||
if (bool) {
|
||||
getRoomRtcToken(info.roomNum, (token: string) => {
|
||||
|
|
|
|||
|
|
@ -638,7 +638,7 @@ const Meeting: React.FC = () => {
|
|||
}
|
||||
)}
|
||||
</div>
|
||||
<div className={`${styles.meetingUserListFooter} drag`}>
|
||||
<div className={`${styles.meetingUserListFooter} drag`} onClick={() => invitingPersonnelRef.current.changeInvitingPersonnelModal()}>
|
||||
<div>邀请</div>
|
||||
<div onClick={() => postOpenMicr(false, true)}>全员静音</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,12 +17,14 @@ export const startSignalr = () => {
|
|||
}
|
||||
|
||||
export const onInvitation = (callBack: Function) => {
|
||||
connection.on("Invitation", (roomNum: string, roomName: string, InviterName: string) => {
|
||||
callBack({
|
||||
key: 'Invitation',
|
||||
roomNum, roomName, InviterName
|
||||
})
|
||||
});
|
||||
if (connection) {
|
||||
connection.on("Invitation", (roomNum: string, roomName: string, InviterName: string) => {
|
||||
callBack({
|
||||
key: 'Invitation',
|
||||
roomNum, roomName, InviterName
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
export const onSignalr = (callBack: Function) => {
|
||||
if (connection) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue