commit
776e77a88c
|
@ -23,11 +23,12 @@ export const useToolState = defineStore('tool', {
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
async resetDef() { // 重置数据-下课
|
async resetDef() { // 重置数据-下课
|
||||||
this.model = 'select' // 悬浮球-当前模式
|
// this.model = 'select' // 悬浮球-当前模式
|
||||||
await sleep(20) // 休眠20ms
|
await sleep(50) // 休眠50ms
|
||||||
this.showBoardAll = false // 全屏画板-是否显示
|
this.showBoardAll = false // 全屏画板-是否显示
|
||||||
await sleep(20) // 休眠20ms
|
await sleep(50) // 休眠50ms
|
||||||
this.isToolWin = false // 工具窗口是否打开
|
this.isToolWin = false // 工具窗口是否打开
|
||||||
|
await sleep(50) // 休眠50ms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -243,6 +243,7 @@ const sideChange = async o => {
|
||||||
|
|
||||||
// === 监听器 ===
|
// === 监听器 ===
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
if (isOver.value) return // 下课, 不往下执行
|
||||||
// 不同的时候, 更新值: 是否显示-画板
|
// 不同的时候, 更新值: 是否显示-画板
|
||||||
const show = !toolStore.isPdfWin && toolStore.showBoardAll
|
const show = !toolStore.isPdfWin && toolStore.showBoardAll
|
||||||
if (show != isShow.value) isShow.value = show
|
if (show != isShow.value) isShow.value = show
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<canvas ref="canvasRef" />
|
<canvas ref="canvasRef" style="pointer-events: none;" />
|
||||||
<button @click="eraseTo">橡皮擦
|
<div style="position: absolute;top: 0;" @click="test('click')"
|
||||||
<i class="iconfont icon-xiangpica"></i>
|
@mouseenter="test('mouseenter')" @mousemove="test('mousemove')" @mouseleave="test('mouseleave')"
|
||||||
</button>
|
@touchstart="test('touchstart')" @touchmove="test('touchmove')" @touchend="test('touchend')"
|
||||||
<button @click="close">销毁</button>
|
@touchcancel="test('touchcancel')" @mousedown="test('mousedown')" @mouseup="test('mouseup')"
|
||||||
|
@mouseout="test('mouseout')" @mouseover="test('mouseover')" @mousewheel="test('mousewheel')">
|
||||||
|
<!-- <button @click="eraseTo">橡皮擦</button> -->
|
||||||
|
<!-- <i class="iconfont icon-xiangpica"></i> -->
|
||||||
|
<!-- <button @click="close">销毁</button> -->
|
||||||
|
<div style="width: 100px;height: 100px;background: #ffbcbc;">小星星</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -43,6 +49,10 @@ const eraseTo = () => { // 橡皮擦
|
||||||
// canvas.dispose()
|
// canvas.dispose()
|
||||||
}
|
}
|
||||||
const close = () => { FabricVue.removeCanvas() }
|
const close = () => { FabricVue.removeCanvas() }
|
||||||
|
|
||||||
|
const test = (key, e) => {
|
||||||
|
console.log('event: ', key)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in New Issue