Compare commits

..

9 Commits

2 changed files with 27 additions and 14 deletions

View File

@ -2,7 +2,7 @@
* @description * @description
*/ */
import { watch } from 'vue' import { watch, render } from 'vue'
import { PPTApi } from './index' import { PPTApi } from './index'
import * as store from '../store' import * as store from '../store'
import { sessionStore } from '@/utils/store' // electron-store 状态管理 import { sessionStore } from '@/utils/store' // electron-store 状态管理
@ -99,6 +99,7 @@ export default () => {
} }
break break
case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页 case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页
render(null, document.body) //移除弹窗
emitter.emit('closegridPic') //如果有推图片窗口 就关闭 emitter.emit('closegridPic') //如果有推图片窗口 就关闭
const slideIndex = content?.current || 0 const slideIndex = content?.current || 0
const type = content?.animation // 上下动作 const type = content?.animation // 上下动作
@ -148,14 +149,4 @@ export default () => {
window.close() // 关闭窗口 window.close() // 关闭窗口
}, 1000) }, 1000)
} }
// setTimeout(async () => {
// emitter.emit('opengridPic',{arr:['https://prev.ysaix.com:7868/src/assets/images/homecard4.jpg']})
// }, 3000)
// setTimeout(async () => {
// emitter.emit('closegridPic')
// }, 6000)
// setTimeout(async () => {
// emitter.emit('opengridPic',{arr:['https://prev.ysaix.com:7868/src/assets/images/homecard4.jpg','https://prev.ysaix.com:7868/src/assets/images/homecard4.jpg']})
// }, 9000)
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="whiteboart-container" :style="{ height: height + 'px' }"> <div class="whiteboart-container" :style="{ height: height + 'px' }">
<div class="canvasBox" ref="box" @mouseleave="handleMouseLeave" ></div> <div class="canvasBox" ref="box" @mouseenter.capture="handleMouseEnter" @mouseleave.capture="handleMouseLeave"></div>
<div class="footerLeft" @click.stop <div class="footerLeft" @click.stop
:style="type == 'design' ? ['top: 10px', 'justify-content: space-between'] : ['bottom: 10px', 'justify-content: center']"> :style="type == 'design' ? ['top: 10px', 'justify-content: space-between'] : ['bottom: 10px', 'justify-content: center']">
@ -278,7 +278,7 @@
</template> </template>
<script setup> <script setup>
import { onMounted, ref, getCurrentInstance, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue' import { onMounted, onBeforeUnmount, ref, getCurrentInstance, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue'
import TinyWhiteboard from 'whiteboard_lyc' import TinyWhiteboard from 'whiteboard_lyc'
import ColorPicker from './components/ColorPicker.vue' import ColorPicker from './components/ColorPicker.vue'
import { import {
@ -791,6 +791,25 @@ const init = () => {
}) })
} }
const isMyCanvas = ref(false); //
const handleKeyDown=(event)=> {
// console.log(':', event.key);
// console.log(isMyCanvas.value,'??????????')
if(isMyCanvas.value == false){
event.stopPropagation();
// console.log(':', event.key);
}
}
/**
* 鼠标进入事件
*/
const handleMouseEnter = () => {
console.log('进入白板')
isMyCanvas.value = true;
document.addEventListener('keydown', handleKeyDown, true);
}
/** /**
* 课堂展示-鼠标离开白板监听事件该事件是避免选中状态在其他地方点击后退删除等事件会删除白板内选中的元素 * 课堂展示-鼠标离开白板监听事件该事件是避免选中状态在其他地方点击后退删除等事件会删除白板内选中的元素
*/ */
@ -798,7 +817,10 @@ const handleMouseLeave = () => {
console.log('离开白板') console.log('离开白板')
// -- // --
app.cancelActiveElement() app.cancelActiveElement()
// TODO //
isMyCanvas.value = false;
//
document.addEventListener('keydown', handleKeyDown, true);
}; };
// //