yangjie #22
|
|
@ -3,14 +3,21 @@ import { getKeyOpenChildWindow } from '@/utils/package/public';
|
||||||
import { onInvoke } from '@/utils/package/signalr';
|
import { onInvoke } from '@/utils/package/signalr';
|
||||||
import { Button, Modal, Select, Slider, message } from 'antd';
|
import { Button, Modal, Select, Slider, message } from 'antd';
|
||||||
import { useState, useImperativeHandle, forwardRef } from "react";
|
import { useState, useImperativeHandle, forwardRef } from "react";
|
||||||
const EquipmentManagement = forwardRef((_props: any, ref: any) => {
|
const EquipmentManagement = forwardRef((props: any, ref: any) => {
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
changeModal: async (uid: string, userName: string) => {
|
changeModal: async (uid: string, userName: string) => {
|
||||||
setCallerUid(uid)
|
setCallerUid(uid)
|
||||||
setDeviceInfo({})
|
setDeviceInfo({})
|
||||||
|
let isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
||||||
|
if (isOpen) {
|
||||||
|
if (props.getDriver) {
|
||||||
|
props.getDriver(uid)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
await onInvoke('getDrivers', {
|
await onInvoke('getDrivers', {
|
||||||
uid
|
uid
|
||||||
})
|
})
|
||||||
|
}
|
||||||
setUserName(userName)
|
setUserName(userName)
|
||||||
setEquipmentManagementModal(true)
|
setEquipmentManagementModal(true)
|
||||||
},
|
},
|
||||||
|
|
@ -23,11 +30,6 @@ const EquipmentManagement = forwardRef((_props: any, ref: any) => {
|
||||||
const [deviceInfo, setDeviceInfo] = useState<any>({})
|
const [deviceInfo, setDeviceInfo] = useState<any>({})
|
||||||
const [userName, setUserName] = useState<any>({})
|
const [userName, setUserName] = useState<any>({})
|
||||||
const handleWindowsChange = async (): Promise<void> => {
|
const handleWindowsChange = async (): Promise<void> => {
|
||||||
const isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
|
||||||
if (isOpen) {
|
|
||||||
window.electron.mainWindowHide()
|
|
||||||
window.electron.setViewStatus('hide')
|
|
||||||
}
|
|
||||||
setEquipmentManagementModal(false)
|
setEquipmentManagementModal(false)
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
@ -92,10 +94,20 @@ const EquipmentManagement = forwardRef((_props: any, ref: any) => {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button type="primary" className='m-ant-btn' onClick={async () => {
|
<Button type="primary" className='m-ant-btn' onClick={async () => {
|
||||||
|
let isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
||||||
|
if (isOpen) {
|
||||||
|
if (props.setDriver) {
|
||||||
|
props.setDriver({
|
||||||
|
uid: callerUid,
|
||||||
|
driversJsonString: JSON.stringify(deviceInfo)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
await onInvoke('setDrivers', {
|
await onInvoke('setDrivers', {
|
||||||
uid: callerUid,
|
uid: callerUid,
|
||||||
driversJsonString: JSON.stringify(deviceInfo)
|
driversJsonString: JSON.stringify(deviceInfo)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
handleWindowsChange()
|
handleWindowsChange()
|
||||||
message.success('设置成功')
|
message.success('设置成功')
|
||||||
}}>确定</Button>
|
}}>确定</Button>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import styles from '@/page/Meeting/ChatBigWindow/index.module.scss'
|
import styles from '@/page/Meeting/ChatBigWindow/index.module.scss'
|
||||||
import ImageUrl from '@/utils/package/imageUrl';
|
import ImageUrl from '@/utils/package/imageUrl';
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState, useRef } from "react";
|
||||||
import { storage } from '@/utils';
|
import { storage } from '@/utils';
|
||||||
import { setKeyOpenChildWindow } from '@/utils/package/public';
|
import { setKeyOpenChildWindow } from '@/utils/package/public';
|
||||||
import { Button, Input, Modal, Popover } from 'antd';
|
import { Button, Input, Modal, Popover } from 'antd';
|
||||||
|
|
@ -9,6 +9,7 @@ import { GetRoomUserItem } from '@/api/Meeting';
|
||||||
import Avatar from '@/components/Avatar';
|
import Avatar from '@/components/Avatar';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||||
|
import EquipmentManagement from '@/components/EquipmentManagement';
|
||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
const ChatBigWindow: React.FC = () => {
|
const ChatBigWindow: React.FC = () => {
|
||||||
const [inputValue, setInputValue] = useState<string>('')
|
const [inputValue, setInputValue] = useState<string>('')
|
||||||
|
|
@ -21,13 +22,14 @@ const ChatBigWindow: React.FC = () => {
|
||||||
'听不到',
|
'听不到',
|
||||||
'我要发言',
|
'我要发言',
|
||||||
])
|
])
|
||||||
|
const equipmentManagementRef = useRef<any>();
|
||||||
const userInfo = JSON.parse(storage.getItem('user') as string)
|
const userInfo = JSON.parse(storage.getItem('user') as string)
|
||||||
const stateInfo = JSON.parse(storage.getItem('stateInfo') as string)
|
const stateInfo = JSON.parse(storage.getItem('stateInfo') as string)
|
||||||
const channel = new BroadcastChannel('meeting_channel');
|
const channel = new BroadcastChannel('meeting_channel');
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setUser(userInfo)
|
setUser(userInfo)
|
||||||
channel.onmessage = function (event) {
|
channel.onmessage = function (event) {
|
||||||
const { type, chatList } = event.data;
|
const { type, chatList, showDriverList } = event.data;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'chatList':
|
case 'chatList':
|
||||||
setChatLists(chatList)
|
setChatLists(chatList)
|
||||||
|
|
@ -38,6 +40,9 @@ const ChatBigWindow: React.FC = () => {
|
||||||
}
|
}
|
||||||
}, 100)
|
}, 100)
|
||||||
break;
|
break;
|
||||||
|
case 'showDriverList':
|
||||||
|
equipmentManagementRef.current.setData(showDriverList)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
@ -160,13 +165,7 @@ const ChatBigWindow: React.FC = () => {
|
||||||
className='m-ant-btn'
|
className='m-ant-btn'
|
||||||
size={'small'}
|
size={'small'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
channel.postMessage({
|
equipmentManagementRef.current.changeModal(item.uid, item.userName)
|
||||||
type: 'chatBigWindowEquipmentManagement',
|
|
||||||
chatBigWindowEquipmentManagement: {
|
|
||||||
uid: roomUserItem.uid,
|
|
||||||
userName: roomUserItem.userName
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
>设备管理</Button> : null}
|
>设备管理</Button> : null}
|
||||||
{roomUserItem.uid !== user.uid ? <Button
|
{roomUserItem.uid !== user.uid ? <Button
|
||||||
|
|
@ -256,6 +255,19 @@ const ChatBigWindow: React.FC = () => {
|
||||||
}}>发送</Button>
|
}}>发送</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<EquipmentManagement ref={equipmentManagementRef} getDriver={(uid: string) => {
|
||||||
|
channel.postMessage({
|
||||||
|
type: 'userListWindowEquipmentManagement',
|
||||||
|
userListWindowEquipmentManagement: {
|
||||||
|
uid
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}} setDriver={(data: any) => {
|
||||||
|
channel.postMessage({
|
||||||
|
type: 'userListWindowSetEquipmentManagement',
|
||||||
|
userListWindowSetEquipmentManagement: data
|
||||||
|
});
|
||||||
|
}} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ const ShareScreenWindow: React.FC = () => {
|
||||||
if (!chatBigWindow) {
|
if (!chatBigWindow) {
|
||||||
window.electron.createChildWindow({
|
window.electron.createChildWindow({
|
||||||
url: location.origin + `/#/chatBigWindow`,
|
url: location.origin + `/#/chatBigWindow`,
|
||||||
width: 440,
|
width: 540,
|
||||||
height: 640,
|
height: 640,
|
||||||
key: 'chatBigWindow',
|
key: 'chatBigWindow',
|
||||||
})
|
})
|
||||||
|
|
@ -159,7 +159,7 @@ const ShareScreenWindow: React.FC = () => {
|
||||||
if (!userListWindow) {
|
if (!userListWindow) {
|
||||||
window.electron.createChildWindow({
|
window.electron.createChildWindow({
|
||||||
url: location.origin + `/#/userListWindow`,
|
url: location.origin + `/#/userListWindow`,
|
||||||
width: 340,
|
width: 440,
|
||||||
height: 540,
|
height: 540,
|
||||||
key: 'userListWindow',
|
key: 'userListWindow',
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -4,27 +4,32 @@ import ImageUrl from '@/utils/package/imageUrl';
|
||||||
import { EllipsisOutlined, ExclamationCircleFilled, SearchOutlined } from '@ant-design/icons';
|
import { EllipsisOutlined, ExclamationCircleFilled, SearchOutlined } from '@ant-design/icons';
|
||||||
import { Button, Input, Modal, Popover } from 'antd';
|
import { Button, Input, Modal, Popover } from 'antd';
|
||||||
import Avatar from '@/components/Avatar';
|
import Avatar from '@/components/Avatar';
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState, useRef } from "react";
|
||||||
import { storage } from '@/utils';
|
import { storage } from '@/utils';
|
||||||
import { GetRoomUser } from '@/api/Meeting';
|
import { GetRoomUser } from '@/api/Meeting';
|
||||||
import { setKeyOpenChildWindow } from '@/utils/package/public';
|
import { setKeyOpenChildWindow } from '@/utils/package/public';
|
||||||
|
import EquipmentManagement from '@/components/EquipmentManagement';
|
||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
|
|
||||||
const UserListWindow: React.FC = () => {
|
const UserListWindow: React.FC = () => {
|
||||||
const [userSearchValue, setUserSearchValue] = useState('')
|
const [userSearchValue, setUserSearchValue] = useState('')
|
||||||
const [user, setUser] = useState<any>({});
|
const [user, setUser] = useState<any>({});
|
||||||
const [roomUserList, setRoomUserList] = useState<any>([])
|
const [roomUserList, setRoomUserList] = useState<any>([])
|
||||||
|
const equipmentManagementRef = useRef<any>();
|
||||||
const channel = new BroadcastChannel('meeting_channel');
|
const channel = new BroadcastChannel('meeting_channel');
|
||||||
const userInfo = JSON.parse(storage.getItem('user') as string)
|
const userInfo = JSON.parse(storage.getItem('user') as string)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setUser(userInfo)
|
setUser(userInfo)
|
||||||
getRoomUser()
|
getRoomUser()
|
||||||
channel.onmessage = function (event) {
|
channel.onmessage = function (event) {
|
||||||
const { type, roomUserList } = event.data;
|
const { type, roomUserList, showDriverList } = event.data;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'roomUserList':
|
case 'roomUserList':
|
||||||
setRoomUserList(roomUserList)
|
setRoomUserList(roomUserList)
|
||||||
break;
|
break;
|
||||||
|
case 'showDriverList':
|
||||||
|
equipmentManagementRef.current.setData(showDriverList)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
@ -143,15 +148,7 @@ const UserListWindow: React.FC = () => {
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
size={'small'}
|
size={'small'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
channel.postMessage({
|
equipmentManagementRef.current.changeModal(item.uid, item.userName)
|
||||||
type: 'shareScreenWindowEquipmentManagement',
|
|
||||||
shareScreenWindowEquipmentManagement: {
|
|
||||||
uid: item.uid,
|
|
||||||
userName: item.userName,
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.electron.closeChildWindow('userListWindow')
|
|
||||||
setKeyOpenChildWindow('userListWindow', false)
|
|
||||||
}}
|
}}
|
||||||
>设备管理</Button>
|
>设备管理</Button>
|
||||||
<Button
|
<Button
|
||||||
|
|
@ -201,6 +198,19 @@ const UserListWindow: React.FC = () => {
|
||||||
}}>全员静音</div>
|
}}>全员静音</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<EquipmentManagement ref={equipmentManagementRef} getDriver={(uid: string) => {
|
||||||
|
channel.postMessage({
|
||||||
|
type: 'userListWindowEquipmentManagement',
|
||||||
|
userListWindowEquipmentManagement: {
|
||||||
|
uid
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}} setDriver={(data: any) => {
|
||||||
|
channel.postMessage({
|
||||||
|
type: 'userListWindowSetEquipmentManagement',
|
||||||
|
userListWindowSetEquipmentManagement: data
|
||||||
|
});
|
||||||
|
}} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -212,14 +212,14 @@ const Meeting: React.FC = () => {
|
||||||
userListWindowDeleteRoomManager,
|
userListWindowDeleteRoomManager,
|
||||||
userListWindowPostRoomManager,
|
userListWindowPostRoomManager,
|
||||||
userListWindowGetRoomKickout,
|
userListWindowGetRoomKickout,
|
||||||
shareScreenWindowEquipmentManagement,
|
userListWindowEquipmentManagement,
|
||||||
|
userListWindowSetEquipmentManagement,
|
||||||
chatSmallWindowSendChannelMsg,
|
chatSmallWindowSendChannelMsg,
|
||||||
chatBigWindowSetAllUserLook,
|
chatBigWindowSetAllUserLook,
|
||||||
chatBigWindowDeleteRoomManager,
|
chatBigWindowDeleteRoomManager,
|
||||||
chatBigWindowPostRoomManager,
|
chatBigWindowPostRoomManager,
|
||||||
chatBigWindowPostOpenMicr,
|
chatBigWindowPostOpenMicr,
|
||||||
chatBigWindowPostOpenCamera,
|
chatBigWindowPostOpenCamera,
|
||||||
chatBigWindowEquipmentManagement,
|
|
||||||
chatBigWindowGetRoomKickout,
|
chatBigWindowGetRoomKickout,
|
||||||
chatBigWindowSendChannelMsg,
|
chatBigWindowSendChannelMsg,
|
||||||
noticeWindowPostRoomManager
|
noticeWindowPostRoomManager
|
||||||
|
|
@ -260,10 +260,16 @@ const Meeting: React.FC = () => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 'shareScreenWindowEquipmentManagement':
|
case 'userListWindowEquipmentManagement':
|
||||||
equipmentManagement(shareScreenWindowEquipmentManagement.uid, shareScreenWindowEquipmentManagement.userName)
|
await onInvoke('getDrivers', {
|
||||||
window.electron.mainWindowCenter()
|
uid: userListWindowEquipmentManagement.uid,
|
||||||
window.electron.setViewStatus('show')
|
})
|
||||||
|
break;
|
||||||
|
case 'userListWindowSetEquipmentManagement':
|
||||||
|
await onInvoke('setDrivers', {
|
||||||
|
uid: userListWindowSetEquipmentManagement.uid,
|
||||||
|
driversJsonString: userListWindowSetEquipmentManagement.driversJsonString
|
||||||
|
})
|
||||||
break;
|
break;
|
||||||
case 'userListWindowPostOpenMicr':
|
case 'userListWindowPostOpenMicr':
|
||||||
postOpenMicr(userListWindowPostOpenMicr.enableMicr, userListWindowPostOpenMicr.uid)
|
postOpenMicr(userListWindowPostOpenMicr.enableMicr, userListWindowPostOpenMicr.uid)
|
||||||
|
|
@ -317,11 +323,6 @@ const Meeting: React.FC = () => {
|
||||||
case 'chatBigWindowPostOpenCamera':
|
case 'chatBigWindowPostOpenCamera':
|
||||||
postOpenCamera(chatBigWindowPostOpenCamera.enableCamera, chatBigWindowPostOpenCamera.uid)
|
postOpenCamera(chatBigWindowPostOpenCamera.enableCamera, chatBigWindowPostOpenCamera.uid)
|
||||||
break;
|
break;
|
||||||
case 'chatBigWindowEquipmentManagement':
|
|
||||||
equipmentManagement(chatBigWindowEquipmentManagement.uid, chatBigWindowEquipmentManagement.userName)
|
|
||||||
window.electron.mainWindowCenter()
|
|
||||||
window.electron.setViewStatus('show')
|
|
||||||
break;
|
|
||||||
case 'chatBigWindowGetRoomKickout':
|
case 'chatBigWindowGetRoomKickout':
|
||||||
GetRoomKickout(state.channelId, chatBigWindowGetRoomKickout.uid)
|
GetRoomKickout(state.channelId, chatBigWindowGetRoomKickout.uid)
|
||||||
break;
|
break;
|
||||||
|
|
@ -764,8 +765,13 @@ const Meeting: React.FC = () => {
|
||||||
case 'ShowDriverList':
|
case 'ShowDriverList':
|
||||||
if (item.driversJsonString) {
|
if (item.driversJsonString) {
|
||||||
const data = JSON.parse(item.driversJsonString);
|
const data = JSON.parse(item.driversJsonString);
|
||||||
|
const isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
||||||
|
if (isOpen) {
|
||||||
|
channel.postMessage({ type: 'showDriverList', showDriverList: data })
|
||||||
|
} else {
|
||||||
equipmentManagementRef.current.setData(data)
|
equipmentManagementRef.current.setData(data)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue