diff --git a/main.js b/main.js
index a81f6e2..97828a8 100644
--- a/main.js
+++ b/main.js
@@ -307,7 +307,9 @@ app.on('ready', () => {
}
childWindow[config.key] = child
child.once('ready-to-show', () => {
- childWindow[config.key].show()
+ if (config.show) {
+ childWindow[config.key].show()
+ }
childWindow[config.key].setAlwaysOnTop(true, 'screen-saver')
childWindow[config.key].setSkipTaskbar(true)
windowOperation(config)
@@ -351,11 +353,19 @@ app.on('ready', () => {
});
// 隐藏显示子窗口
ipcMain.handle('setChildWindowShow', (event, config) => {
- if (config.bool) {
- childWindow[config.key].show()
+ if (config.key === 'shareScreenWindow') {
+ if (config.bool) {
+ childWindow[config.key].show()
+ } else {
+ if (childWindow[config.key].isVisible()) {
+ childWindow[config.key].hide()
+ }
+ }
} else {
if (childWindow[config.key].isVisible()) {
childWindow[config.key].hide()
+ } else {
+ childWindow[config.key].show()
}
}
});
diff --git a/src/page/Meeting/ChatBigWindow/index.tsx b/src/page/Meeting/ChatBigWindow/index.tsx
index c350841..cfe6bb2 100644
--- a/src/page/Meeting/ChatBigWindow/index.tsx
+++ b/src/page/Meeting/ChatBigWindow/index.tsx
@@ -2,7 +2,6 @@ import styles from '@/page/Meeting/ChatBigWindow/index.module.scss'
import ImageUrl from '@/utils/package/imageUrl';
import { useEffect, useState, useRef } from "react";
import { storage } from '@/utils';
-import { setKeyOpenChildWindow } from '@/utils/package/public';
import { Button, Input, Modal, Popover } from 'antd';
import { role } from '@/config/role';
import { GetRoomUserItem } from '@/api/Meeting';
@@ -62,8 +61,9 @@ const ChatBigWindow: React.FC = () => {
diff --git a/src/page/Meeting/ShareScreenWindow/index.tsx b/src/page/Meeting/ShareScreenWindow/index.tsx
index 82f6d24..5a29c8a 100644
--- a/src/page/Meeting/ShareScreenWindow/index.tsx
+++ b/src/page/Meeting/ShareScreenWindow/index.tsx
@@ -3,7 +3,6 @@ import { role } from '@/config/role';
import styles from '@/page/Meeting/ShareScreenWindow/index.module.scss'
import { storage } from '@/utils';
import ImageUrl from '@/utils/package/imageUrl';
-import { getKeyOpenChildWindow, setKeyOpenChildWindow } from '@/utils/package/public';
import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import dayjs from 'dayjs';
@@ -164,28 +163,14 @@ const ShareScreenWindow: React.FC = () => {
});
break;
case '聊天':
- const chatBigWindow = await getKeyOpenChildWindow('chatBigWindow')
- if (!chatBigWindow) {
- window.electron.createChildWindow({
- url: location.origin + `/#/chatBigWindow`,
- width: 540,
- height: 640,
- key: 'chatBigWindow',
- })
- setKeyOpenChildWindow('chatBigWindow', true)
- }
+ window.electron.setChildWindowShow({
+ key: 'chatBigWindow',
+ })
break;
case '成员':
- const userListWindow = await getKeyOpenChildWindow('userListWindow')
- if (!userListWindow) {
- window.electron.createChildWindow({
- url: location.origin + `/#/userListWindow`,
- width: 440,
- height: 540,
- key: 'userListWindow',
- })
- setKeyOpenChildWindow('userListWindow', true)
- }
+ window.electron.setChildWindowShow({
+ key: 'userListWindow',
+ })
break;
}
}}
diff --git a/src/page/Meeting/UserListWindow/index.tsx b/src/page/Meeting/UserListWindow/index.tsx
index 1c75e2f..6a4bac2 100644
--- a/src/page/Meeting/UserListWindow/index.tsx
+++ b/src/page/Meeting/UserListWindow/index.tsx
@@ -6,7 +6,6 @@ import { Button, Input, Modal, Popover } from 'antd';
import Avatar from '@/components/Avatar';
import { useEffect, useState, useRef } from "react";
import { storage } from '@/utils';
-import { setKeyOpenChildWindow } from '@/utils/package/public';
import EquipmentManagement from '@/components/EquipmentManagement';
const { confirm } = Modal;
@@ -47,8 +46,9 @@ const UserListWindow: React.FC = () => {
成员列表

{
- window.electron.closeChildWindow('userListWindow')
- setKeyOpenChildWindow('userListWindow', false)
+ window.electron.setChildWindowShow({
+ key: 'userListWindow',
+ })
}} />
diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx
index 08d9750..6fbb3cc 100644
--- a/src/page/Meeting/index.tsx
+++ b/src/page/Meeting/index.tsx
@@ -1577,24 +1577,40 @@ const Meeting: React.FC = () => {
width: 400,
height: 80,
key: 'shareScreenWindow',
+ show: true,
})
window.electron.createChildWindow({
url: location.origin + `/#/chatSmallWindow`,
width: 200,
height: 150,
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 + `/#/noticeWindow`,
width: 388,
height: 150,
key: 'noticeWindow',
+ show: true,
+ })
+ window.electron.createChildWindow({
+ url: location.origin + `/#/chatBigWindow`,
+ width: 540,
+ height: 640,
+ key: 'chatBigWindow',
+ })
+ window.electron.createChildWindow({
+ url: location.origin + `/#/userListWindow`,
+ width: 440,
+ height: 540,
+ key: 'userListWindow',
})
setKeyOpenChildWindow('shareScreenWindow', true)
}