diff --git a/src/renderer/src/assets/iconfont/iconfont.css b/src/renderer/src/assets/iconfont/iconfont.css index 8d07e32..4b2269b 100644 --- a/src/renderer/src/assets/iconfont/iconfont.css +++ b/src/renderer/src/assets/iconfont/iconfont.css @@ -1,9 +1,9 @@ @font-face { font-family: "iconfont"; /* Project id 2794390 */ - src: url('iconfont.woff2?t=1722393125520') format('woff2'), - url('iconfont.woff?t=1722393125520') format('woff'), - url('iconfont.ttf?t=1722393125520') format('truetype'), - url('iconfont.svg?t=1722393125520#iconfont') format('svg'); + src: url('iconfont.woff2?t=1723022855912') format('woff2'), + url('iconfont.woff?t=1723022855912') format('woff'), + url('iconfont.ttf?t=1723022855912') format('truetype'), + url('iconfont.svg?t=1723022855912#iconfont') format('svg'); } .iconfont { @@ -14,6 +14,26 @@ -moz-osx-font-smoothing: grayscale; } +.icon-kechengziyuan1:before { + content: "\e647"; +} + +.icon-tubiaozhizuomobanyihuifu-:before { + content: "\e69d"; +} + +.icon-window-01:before { + content: "\e70b"; +} + +.icon-chuangkou-chuangkouhua:before { + content: "\e64b"; +} + +.icon-a-lujing13357:before { + content: "\e64c"; +} + .icon-icon:before { content: "\e640"; } diff --git a/src/renderer/src/assets/iconfont/iconfont.js b/src/renderer/src/assets/iconfont/iconfont.js index 468ab99..009e48d 100644 --- a/src/renderer/src/assets/iconfont/iconfont.js +++ b/src/renderer/src/assets/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_2794390='',function(l){var h=(h=document.getElementsByTagName("script"))[h.length-1],c=h.getAttribute("data-injectcss"),h=h.getAttribute("data-disable-injectsvg");if(!h){var a,v,t,z,i,p=function(h,c){c.parentNode.insertBefore(h,c)};if(c&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}a=function(){var h,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_2794390,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(h=document.body).firstChild?p(c,h.firstChild):h.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(v=function(){document.removeEventListener("DOMContentLoaded",v,!1),a()},document.addEventListener("DOMContentLoaded",v,!1)):document.attachEvent&&(t=a,z=l.document,i=!1,d(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,M())})}function M(){i||(i=!0,t())}function d(){try{z.documentElement.doScroll("left")}catch(h){return void setTimeout(d,50)}M()}}(window); \ No newline at end of file +window._iconfont_svg_string_2794390='',function(l){var h=(h=document.getElementsByTagName("script"))[h.length-1],c=h.getAttribute("data-injectcss"),h=h.getAttribute("data-disable-injectsvg");if(!h){var a,v,t,z,i,p=function(h,c){c.parentNode.insertBefore(h,c)};if(c&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}a=function(){var h,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_2794390,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(h=document.body).firstChild?p(c,h.firstChild):h.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(v=function(){document.removeEventListener("DOMContentLoaded",v,!1),a()},document.addEventListener("DOMContentLoaded",v,!1)):document.attachEvent&&(t=a,z=l.document,i=!1,d(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,M())})}function M(){i||(i=!0,t())}function d(){try{z.documentElement.doScroll("left")}catch(h){return void setTimeout(d,50)}M()}}(window); \ No newline at end of file diff --git a/src/renderer/src/assets/iconfont/iconfont.json b/src/renderer/src/assets/iconfont/iconfont.json index 3db8bfe..d899edc 100644 --- a/src/renderer/src/assets/iconfont/iconfont.json +++ b/src/renderer/src/assets/iconfont/iconfont.json @@ -5,6 +5,41 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "3053509", + "name": "课程资源", + "font_class": "kechengziyuan1", + "unicode": "e647", + "unicode_decimal": 58951 + }, + { + "icon_id": "4427402", + "name": "窗口", + "font_class": "tubiaozhizuomobanyihuifu-", + "unicode": "e69d", + "unicode_decimal": 59037 + }, + { + "icon_id": "18418603", + "name": "窗口", + "font_class": "window-01", + "unicode": "e70b", + "unicode_decimal": 59147 + }, + { + "icon_id": "30970631", + "name": "窗口-窗口化", + "font_class": "chuangkou-chuangkouhua", + "unicode": "e64b", + "unicode_decimal": 58955 + }, + { + "icon_id": "41196567", + "name": "下课", + "font_class": "a-lujing13357", + "unicode": "e64c", + "unicode_decimal": 58956 + }, { "icon_id": "680440", "name": "教材", diff --git a/src/renderer/src/assets/iconfont/iconfont.svg b/src/renderer/src/assets/iconfont/iconfont.svg index f9b4baf..039cc95 100644 --- a/src/renderer/src/assets/iconfont/iconfont.svg +++ b/src/renderer/src/assets/iconfont/iconfont.svg @@ -14,6 +14,16 @@ /> + + + + + + + + + + diff --git a/src/renderer/src/assets/iconfont/iconfont.ttf b/src/renderer/src/assets/iconfont/iconfont.ttf index 714a16f..18826b1 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.ttf and b/src/renderer/src/assets/iconfont/iconfont.ttf differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff b/src/renderer/src/assets/iconfont/iconfont.woff index 1f4f411..86e2bb1 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff and b/src/renderer/src/assets/iconfont/iconfont.woff differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff2 b/src/renderer/src/assets/iconfont/iconfont.woff2 index 550c112..756b9e2 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff2 and b/src/renderer/src/assets/iconfont/iconfont.woff2 differ diff --git a/src/renderer/src/components/upload-dialog/index.vue b/src/renderer/src/components/upload-dialog/index.vue index 9b06e8d..ea86172 100644 --- a/src/renderer/src/components/upload-dialog/index.vue +++ b/src/renderer/src/components/upload-dialog/index.vue @@ -24,8 +24,7 @@
类别: - +
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 2de8a69..0742db6 100644 --- a/src/renderer/src/views/tool/components/side.vue +++ b/src/renderer/src/views/tool/components/side.vue @@ -39,10 +39,10 @@ const props = defineProps({ data: { // 数据 type: Array, default: () => [ - { label: '资源', prop: 'resource', icon: 'icon-hudong' }, + { label: '资源', prop: 'resource', icon: 'icon-kechengziyuan1' }, { label: '互动', prop: 'interact', icon: 'icon-hudong' }, - { label: '窗口', prop: 'win', icon: 'icon-hudong' }, - { label: '下课', prop: 'over', icon: 'icon-hudong' }, + { label: '窗口', prop: 'win', icon: 'icon-tubiaozhizuomobanyihuifu-' }, + { label: '下课', prop: 'over', isExtra: true, icon: 'icon-a-lujing13357' }, ] } }) @@ -75,12 +75,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) } @@ -101,7 +103,6 @@ const clickHandel = (o, e) => { cursor: pointer; .iconfont{ font-size: 20px; - color: attr(color); } span{font-size: 12px;} &:hover{ 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..5a2aef3 100644 --- a/src/renderer/src/views/tool/sphere.vue +++ b/src/renderer/src/views/tool/sphere.vue @@ -3,7 +3,7 @@ - +
{ resetStatus() // 开启重置状态-监听 }) -// const test = (e) => { console.log('test', e) } + + // ==== 方法 === -const tabChange = (val) => { // 切换tab-change +// const test = (e) => { console.log('test', e) } +// 切换tab-change +const tabChange = (val) => { const bool = !toolStore.isPdfWin && !toolStore.showBoardAll if(bool) toolStore.showBoardAll = true // ipcMsgSend('tool-sphere:close') toolStore.model = val // 存储当前tab } -const logoHandle = (e,t) => { // logo 点击-事件 折叠|展开 +// logo 点击-事件 折叠|展开 +const logoHandle = (e,t) => { if (Date.now() - dragtime.value < 200) { isFold.value = !isFold.value } } -const mouseChange = (bool) => { // 鼠标移入工具栏 是否穿透 +// 底部工具栏:移入移出-是否穿透 +const mouseChange = (bool) => { let resBool = false if (tabActive.value == 'select') resBool = !!bool if (!isShow.value) resBool = !!bool setIgnore(resBool) } -const setIgnore = (bool) => { // 忽略鼠标穿透 - ipcMsgSend('tool-sphere:set:ignore', bool) -} -const resetStatus = () => { // 重置状态 +// 忽略鼠标穿透 +const setIgnore = (bool) => {ipcMsgSend('tool-sphere:set:ignore', bool)} +// 重置状态: 鼠标|画板 +const resetStatus = () => { if (toolStore.isToolWin) return // 已经打开过-忽略 ipcMain?.handle?.('tool-sphere:reset', () => { setTimeout(() => { boardVueRef.value.handleMode(tabActive.value) - mouseChange(1) + mouseChange(1) }, 500) }) toolStore.isToolWin = true // 标记状态 } +// 侧边工具栏: 移入移出 +const sideMouse = e => { + const {type} = e.detail + mouseChange(type == 'mouseleave') +} +// 侧边工具栏: 操作变化 +const sideChange = o => { + // console.log(o) + switch(o.prop) { + case 'resource': // 资源 + break + case 'interact': // 互动 + break + case 'win': // 窗口 + break + case 'over': // 下课 + toolStore.isToolWin = false + ipcMsgSend('tool-sphere:close') + break + } +} -watchEffect(() => { // 监听 +// === 监听器 === +watchEffect(() => { // 不同的时候, 更新值: 是否显示-画板 const show = !toolStore.isPdfWin && toolStore.showBoardAll if (show != isShow.value) isShow.value = show @@ -119,6 +146,7 @@ watchEffect(() => { // 监听 height: 5rem; border-radius: 50%; box-shadow: 0px 0px 8px rgb(0 0 0 / 40%); + user-select: none; // &:hover{ // .el-image{transform: scale(1.1);} // }