BUG修复

This commit is contained in:
朱浩 2024-11-21 15:43:28 +08:00
parent adbb4f0067
commit 60f2790b0c
5 changed files with 55 additions and 36 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -1,5 +1,5 @@
<template>
<div class="whiteboart-container">
<div class="whiteboart-container" :style="{ height: height + 'px' }">
<div class="canvasBox" ref="box"></div>
<div class="footerLeft" @click.stop
@ -15,7 +15,7 @@
</el-tooltip>
</div>
<div class="blockBox">
<el-button @click="currentType = 'selection'"><el-image src="/src/assets/icons/pngjpg/mouse-pointer.png"
<el-button @click="currentType = 'selection'"><el-image src="/src/assets/images/mouse-pointer.png"
style="width: 14px; height: 14px; color: silver" /></el-button>
</div>
<template v-if="type == 'design'">
@ -53,7 +53,8 @@
</el-radio-group>
</template>
<div class="blockBox">
<el-button @click="currentType = 'selection'" style="color:#848282" :icon="Camera" disabled></el-button>
<!-- <el-button @click="currentType = 'selection'" style="color:#848282" :icon="Camera" disabled></el-button> -->
<el-button @click="handleToolTypeChange('image')">图片</el-button>
</div>
<div class="blockBox" v-if="!readonly">
<el-dropdown @command="handleToolTypeChange" placement="top">
@ -71,7 +72,7 @@
<template v-if="type != 'design'">
<el-dropdown-item command="freedraw">画笔</el-dropdown-item>
<el-dropdown-item command="text">文字</el-dropdown-item>
<el-dropdown-item command="image">图片</el-dropdown-item>
<!-- <el-dropdown-item command="image">图片</el-dropdown-item> -->
</template>
</el-dropdown-menu>
</template>
@ -122,7 +123,7 @@
<!-- 边框样式 -->
<div class="blockBox">
<el-dropdown @command="updateStyle('lineDash', $event)" placement="top">
<el-button><el-image src="/src/assets/icons/pngjpg/borderstyle.png"
<el-button><el-image src="/src/assets/images/borderstyle.png"
style="width: 14px; height: 14px"></el-image></el-button>
<template #dropdown>
<el-dropdown-menu>
@ -134,8 +135,7 @@
</el-dropdown>
</div>
<!--透明度-->
<div class="blockBox" style="width: 120px"
v-if="type == 'design' ? true : ['image'].includes(activeElement?.type) || hasSelectedElements">
<div class="blockBox" style="width: 120px">
<el-tooltip effect="light" content="透明度" placement="top">
<el-input-number v-model="globalAlpha" :min="0" :max="1" :step="0.1"
@change="updateStyle('globalAlpha', $event)"></el-input-number>
@ -145,7 +145,7 @@
<!-- 边框粗细 -->
<div class="blockBox">
<el-dropdown @command="updateStyle('lineWidth', $event)" placement="top">
<el-button><el-image src="/src/assets/icons/pngjpg/borderwidth.png"
<el-button><el-image src="/src/assets/images/borderwidth.png"
style="width: 14px; height: 14px"></el-image></el-button>
<template #dropdown>
<el-dropdown-menu>
@ -309,11 +309,11 @@ const props = defineProps({
default: true
},
height: {
type: Number,
type: [Number,String],
default: 700,
},
width: {
type: Number,
type: [Number,String],
default: 1000,
},
data: {
@ -685,6 +685,20 @@ const getCanvasBase64 = async () =>{
return base64
}
const getCanvasBlob = async () =>{
return await app.exportImage({
type: 'image/jpeg',
renderBg: exportRenderBackground.value,
paddingX: exportImagePaddingX.value,
paddingY: exportImagePaddingY.value,
onlySelected: exportOnlySelected.value,
useBlob: true,
backgroundColor: '#ffffff'
})
}
watch(() => props.data, (newVal) => {
if (newVal) {
setCanvasData(newVal)
@ -773,7 +787,8 @@ defineExpose({
showFit,
getCanvasJson,
getCanvasBase64,
setCanvasData
setCanvasData,
getCanvasBlob
})
</script>
@ -895,7 +910,7 @@ ol {
font-size: 14px;
color: #000;
:deep(.jsontree_tree) {
/deep/ .jsontree_tree {
font-family: 'Trebuchet MS', Arial, sans-serif !important;
}
}

View File

@ -13,7 +13,7 @@
<div class="page-left">
<el-table
ref="taskTable"
v-loading="loading"
v-loading="tasklist_loading"
:data="taskList"
:tree-props="{checkStrictly: true}"
row-key="id"
@ -62,7 +62,7 @@
<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;">
<!-- <whiteboard v-if="isShowBoard" ref="boardref" :height="mainHeight - 150" :isShowSave="false" :data="whiteboardObj"/> -->
<whiteboard ref="boardref" height=" 100%" :isShowSave="false" :data="classWorkForm.whiteboardObj"/>
<whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false" :data="classWorkForm.whiteboardObj"/>
</div>
</div>
<div v-if="(currentRow.worktype == '常规作业' || classWorkForm.worktype == '常规作业')&& currentRow.id>0" class="page-center">
@ -136,6 +136,10 @@ import whiteboard from '@/components/whiteboard/whiteboard.vue'
import FileUpload from "@/components/FileUpload/index.vue";
import Right from './Right/index.vue'
import {
Delete
} from '@element-plus/icons-vue'
import SetHomework from '@/components/set-homework/index.vue'
import { useGetHomework } from '@/hooks/useGetHomework'
import { sessionStore } from '@/utils/store'
@ -355,13 +359,13 @@ const handleCurrentChange = (val) => {
console.log(val,'???????????')
if(val && val.id >0 ) {
currentRow.value = val;
classWorkForm.worktype = val.worktype; //
editListItem(val, courseObj).then((obj) => {
if(obj){
propsformobj = obj;
//
classWorkForm.id = obj.id;
classWorkForm.uniquekey = cloneDeep(obj.uniquekey); //
classWorkForm.worktype = cloneDeep(obj.worktype); //
classWorkForm.title = cloneDeep(obj.title); //
classWorkForm.quizlist = cloneDeep(obj.quizlist); //
classWorkForm.chooseWorkLists = cloneDeep(obj.chooseWorkLists); // list
@ -744,7 +748,7 @@ const editWork = async (cform) =>{
}
.page-center{
flex: 1;
// width: 100%;
//min-width: calc(100% - 675px);
height: 100%;
padding: 0 5px;
margin: 0 5px;