From 02a25db5e2ecb858f242bb2f8577e9e27878dda6 Mon Sep 17 00:00:00 2001 From: zdg Date: Thu, 19 Sep 2024 16:35:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/prepare/index.vue | 2 +- src/renderer/src/views/tool/directive/drag.js | 3 +++ src/renderer/src/views/tool/sphere.vue | 13 +++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index ca2b197..9b7592e 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -308,7 +308,7 @@ export default { if(item.fileFlag === '课件') { // 关闭状态,打开上课相关功能(已打开,忽略) const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null - if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作') + // if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作') this.openReserv() } if(item.fileFlag === 'apt') { diff --git a/src/renderer/src/views/tool/directive/drag.js b/src/renderer/src/views/tool/directive/drag.js index 5565441..9751fde 100644 --- a/src/renderer/src/views/tool/directive/drag.js +++ b/src/renderer/src/views/tool/directive/drag.js @@ -57,6 +57,8 @@ class Drag { document.removeEventListener('mouseup', this.up); document.addEventListener('touchmove', this.move); document.addEventListener('touchend', this.up); + // 手动-触发事件 v-drag-start + this.el.dispatchEvent(new CustomEvent('v-drag-end', {detail:{drag: this}})) } // 业务逻辑 updatePosition(e) { @@ -108,6 +110,7 @@ export default { // const { style } = binding.value const drag = new Drag(el, binding) const dragStart = (e) => { + // console.log('start', e) drag.down(e) document.addEventListener('mousemove', drag.move); document.addEventListener('mouseup', drag.up); diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue index 09be0e0..a2f69a9 100644 --- a/src/renderer/src/views/tool/sphere.vue +++ b/src/renderer/src/views/tool/sphere.vue @@ -13,9 +13,11 @@ -
+
+ @v-drag-start="dragtime = Date.now()" + @v-drag-end="mouseChange(1)"> @@ -106,7 +108,7 @@ const getClassInfo = async () => { const tabChange = (val) => { const bool = !toolStore.isPdfWin && !toolStore.showBoardAll if(bool) toolStore.showBoardAll = true - console.log('tabChange:', val, bool) + // console.log('tabChange:', val, bool) toolStore.model = val // 存储当前tab } // logo 点击-事件 折叠|展开 @@ -143,9 +145,12 @@ const mouseChange = (bool) => { const isPdf = !resBool && toolStore.isPdfWin if (isPdf) resBool = true } - // console.log('mouseChange:', bool, resBool) + console.log('mouseChange:', bool, resBool) setIgnore(resBool) } +const touchChange = (e) => { + console.log(e) +} // im-chat: 聊天事件 {type, data} const chatChange = (type, data, ...args) => { if (type == 'createGroup') { // 创建群-监听 -- 2.44.0.windows.1 From c5075af2fc26961c0e8a69ec88956369206a6486 Mon Sep 17 00:00:00 2001 From: zdg Date: Thu, 19 Sep 2024 16:37:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B7=B2=E4=B8=8A=E8=AF=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/prepare/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 9b7592e..ca2b197 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -308,7 +308,7 @@ export default { if(item.fileFlag === '课件') { // 关闭状态,打开上课相关功能(已打开,忽略) const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null - // if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作') + if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作') this.openReserv() } if(item.fileFlag === 'apt') { -- 2.44.0.windows.1