Merge branch 'main' into zouyf_dev

# Conflicts:
#	src/renderer/src/views/classTask/newClassTaskAssign/index.vue
This commit is contained in:
“zouyf” 2024-12-26 14:52:06 +08:00
commit 6da745ced8
5 changed files with 27 additions and 15 deletions

View File

@ -89,8 +89,6 @@ import ButtonGroup from '../../../../components/ButtonGroup.vue'
import Popover from '../../../../components/Popover.vue' import Popover from '../../../../components/Popover.vue'
import NumberInput from '../../../../components/NumberInput.vue' import NumberInput from '../../../../components/NumberInput.vue'
import { PPTApi } from '../../../../api' import { PPTApi } from '../../../../api'
import { Console } from 'node:console'
import { x64 } from 'crypto-js'
const shapeClipPathOptions = CLIPPATHS const shapeClipPathOptions = CLIPPATHS
const ratioClipOptions = [ const ratioClipOptions = [
{ {

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"></div> <div class="canvasBox" ref="box" @mouseleave="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, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue' import { onMounted, 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 {
@ -305,6 +305,7 @@ import { fontFamilyList, fontSizeList } from './constants'
const borderImg = new URL('../../../src/assets/images/borderwidth.png', import.meta.url).href const borderImg = new URL('../../../src/assets/images/borderwidth.png', import.meta.url).href
const pointerImg = new URL('../../../src/assets/images/mouse-pointer.png', import.meta.url).href const pointerImg = new URL('../../../src/assets/images/mouse-pointer.png', import.meta.url).href
const { proxy } = getCurrentInstance()
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
@ -507,10 +508,6 @@ const backToCenter = () => {
app.scrollToCenter() app.scrollToCenter()
} }
const cancelActiveElement = () =>{
app.cancelActiveElement()
}
// //
const showFit = () => { const showFit = () => {
@ -716,6 +713,13 @@ watch(() => props.data, (newVal) => {
// dom // dom
onMounted(() => { onMounted(() => {
init();
})
/**
* 初始化画布内容
*/
const init = () => {
// //
app = new TinyWhiteboard({ app = new TinyWhiteboard({
container: box.value, container: box.value,
@ -737,6 +741,7 @@ onMounted(() => {
}) })
// //
app.on('activeElementChange', element => { app.on('activeElementChange', element => {
console.log('点击元素 监听 activeElementChange-----------')
if (activeElement.value) { if (activeElement.value) {
activeElement.value.off('elementRotateChange', onElementRotateChange) activeElement.value.off('elementRotateChange', onElementRotateChange)
} }
@ -784,7 +789,17 @@ onMounted(() => {
app.resize() app.resize()
}, 300) }, 300)
}) })
}) }
/**
* 课堂展示-鼠标离开白板监听事件该事件是避免选中状态在其他地方点击后退删除等事件会删除白板内选中的元素
*/
const handleMouseLeave = () => {
console.log('离开白板')
// --
app.cancelActiveElement()
// TODO
};
// //
defineExpose({ defineExpose({
@ -795,7 +810,6 @@ defineExpose({
getCanvasBase64, getCanvasBase64,
setCanvasData, setCanvasData,
getCanvasBlob, getCanvasBlob,
cancelActiveElement
}) })
</script> </script>

View File

@ -68,7 +68,6 @@
</div> </div>
<div v-if="(currentRow.worktype == '课堂展示' || classWorkForm.worktype == '课堂展示') && currentRow.id>0" class="page-center"> <div v-if="(currentRow.worktype == '课堂展示' || classWorkForm.worktype == '课堂展示') && currentRow.id>0" class="page-center">
<div v-loading="boardLoading" class="board-wrap" style="height: 100%; flex: 1; overflow: hidden;"> <div v-loading="boardLoading" class="board-wrap" style="height: 100%; flex: 1; overflow: hidden;">
<!-- <whiteboard v-if="isShowBoard" ref="boardref" :height="mainHeight - 150" :isShowSave="false" :data="whiteboardObj"/> -->
<whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false" :data="classWorkForm.whiteboardObj" /> <whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false" :data="classWorkForm.whiteboardObj" />
</div> </div>
</div> </div>

View File

@ -206,7 +206,7 @@ export default {
width: 200px; width: 200px;
height: 200px; height: 200px;
position: relative; position: relative;
left: 150px; left: 100px;
overflow: hidden; overflow: hidden;
border-radius: 50%; border-radius: 50%;
} }

View File

@ -6,6 +6,7 @@
append-to-body append-to-body
@opened="modalOpened" @opened="modalOpened"
@close="closeDialog" @close="closeDialog"
width="100px"
> >
<CropperImage <CropperImage
ref="cropper" ref="cropper"