diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js
index 09a1fb1..87ee641 100644
--- a/src/renderer/src/utils/tool.js
+++ b/src/renderer/src/utils/tool.js
@@ -58,6 +58,12 @@ export function ipcMsgSend(key, data, type) {
return ipcRenderer?.invoke(key, data)
}
}
+export function ipcMsgSend2(key, ...args) {
+ return ipcRenderer?.send(key, ...args)
+}
+export function ipcMsgInvoke(key, ...args) {
+ return ipcRenderer?.invoke(key, ...args)
+}
/**
* @description 封装ipcRenderer事件监听
* @param {*} fn on once handle invoke
@@ -197,9 +203,9 @@ const eventHandles = (type, win) => {
const setIgnore = (_, ignore) => {win.setIgnoreMouseEvents(ignore, {forward: true})}
Remote.ipcMain.handle('tool-sphere:set:ignore', setIgnore) // 异步
// 关闭窗口
- Remote.ipcMain.once('tool-sphere:close', () => { win&&win.destroy() })
- // 放大监听-测试
- Remote.ipcMain.once('maximize-window', () => {win&&win.destroy()})
+ Remote.ipcMain.handleOnce('tool-sphere:close', () => {win&&win.destroy()})
+ // // 放大监听-测试
+ // Remote.ipcMain.once('maximize-window', () => {win&&win.destroy()})
const on = {
onClosed: () => {
Remote.ipcMain.removeHandler('tool-sphere:set:ignore', setIgnore)
diff --git a/src/renderer/src/views/tool/components/side.vue b/src/renderer/src/views/tool/components/side.vue
index 63b766e..184518e 100644
--- a/src/renderer/src/views/tool/components/side.vue
+++ b/src/renderer/src/views/tool/components/side.vue
@@ -38,7 +38,7 @@ const props = defineProps({
{ label: '资源', prop: 'resource', icon: 'icon-hudong' },
{ label: '互动', prop: 'interact', icon: 'icon-hudong' },
{ label: '窗口', prop: 'win', icon: 'icon-hudong' },
- { label: '下课', prop: 'over', icon: 'icon-hudong' },
+ { label: '下课', prop: 'over', isExtra: true, icon: 'icon-hudong' },
]
}
})
@@ -71,12 +71,14 @@ const getStyle = (style,index) => {
}
// 事件
const clickHandel = (o, e) => {
- const node = e.target.parentNode.getBoundingClientRect()
- const isColse = activeObj.value && activeObj.value.prop === o.prop && isVisible.value
- isVisible.value = !isColse // 相同的按钮且打开状态,点击关闭
- activeObj.value = o
- const nodeH = parseInt(node.height / 2) // 高度的一半
- topPos.value = parseInt(node.top) - posBtnAll.top + nodeH
+ if (!o.isExtra) { // 忽略其他操作: 打开内容窗口,指示器指向当前
+ const node = e.target.parentNode.getBoundingClientRect()
+ const isColse = activeObj.value && activeObj.value.prop === o.prop && isVisible.value
+ isVisible.value = !isColse // 相同的按钮且打开状态,点击关闭
+ activeObj.value = o
+ const nodeH = parseInt(node.height / 2) // 高度的一半
+ topPos.value = parseInt(node.top) - posBtnAll.top + nodeH
+ }
emit('change', o)
}
diff --git a/src/renderer/src/views/tool/directive/ignore.js b/src/renderer/src/views/tool/directive/ignore.js
index 63a3ca3..b7e3e26 100644
--- a/src/renderer/src/views/tool/directive/ignore.js
+++ b/src/renderer/src/views/tool/directive/ignore.js
@@ -29,7 +29,8 @@ class Ignore {
})
}
changeHandle(e) {
- const customEvent = new CustomEvent('ignore-mounted', {detail:{ignore: this, e}})
+ const data = {detail:{ignore: this, e, type: e.type}}
+ const customEvent = new CustomEvent('ignore-mounted', data)
this.el.dispatchEvent(customEvent)
}
}
diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue
index 9559937..834b317 100644
--- a/src/renderer/src/views/tool/sphere.vue
+++ b/src/renderer/src/views/tool/sphere.vue
@@ -3,7 +3,7 @@