Compare commits

...

4 Commits

Author SHA1 Message Date
朱浩 c8aa529621 Merge remote-tracking branch 'origin/main' 2024-11-21 15:43:56 +08:00
朱浩 60f2790b0c BUG修复 2024-11-21 15:43:28 +08:00
朱浩 adbb4f0067 Merge remote-tracking branch 'origin/main' 2024-11-21 13:52:29 +08:00
朱浩 def9433647 PPTist接入 2024-11-21 13:52:17 +08:00
6 changed files with 56 additions and 37 deletions

View File

@ -8,7 +8,7 @@
http-equiv="Content-Security-Policy" http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
/> --> /> -->
<meta http-equiv="Content-Security-Policy" content="connect-src *; default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *;img-src * 'self' data: blob:" /> <meta http-equiv="Content-Security-Policy" content="connect-src *; default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src * blob:;img-src * 'self' data: blob:" />
</head> </head>

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

View File

@ -9,11 +9,11 @@
<el-button type="primary" @click="handleNewAllClass">设计新作业</el-button> <el-button type="primary" @click="handleNewAllClass">设计新作业</el-button>
</div> </div>
</div> </div>
<div class="page-resource"> <div class="page-resource">
<div class="page-left"> <div class="page-left">
<el-table <el-table
ref="taskTable" ref="taskTable"
v-loading="loading" v-loading="tasklist_loading"
:data="taskList" :data="taskList"
:tree-props="{checkStrictly: true}" :tree-props="{checkStrictly: true}"
row-key="id" row-key="id"
@ -41,11 +41,11 @@
</el-table> </el-table>
</div> </div>
<div v-if="currentRow.id == 0" style="width: 100%; height: 100%;"> <div v-if="currentRow.id == 0" style="width: 100%; height: 100%;">
<!-- 默认的习题类型卡片 --> <!-- 默认的习题类型卡片 -->
<Right @itemClick="handleItemClick" /> <Right @itemClick="handleItemClick" />
</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">
<el-tabs v-model="activeAptTab" style="height: 100%;"> <el-tabs v-model="activeAptTab" style="height: 100%;">
<el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst"> <el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst">
@ -62,7 +62,7 @@
<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 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> </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">
@ -70,20 +70,20 @@
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/> <FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
</div> </div>
</div> </div>
<div v-if="currentRow.id>0 " class="page-right"> <div v-if="currentRow.id>0 " class="page-right">
<div class="prepare-top" > <div class="prepare-top" >
<el-button v-if="currentRow.id != 1 " type="success" @click="openSet(currentRow,'item')"> </el-button> <el-button v-if="currentRow.id != 1 " type="success" @click="openSet(currentRow,'item')"> </el-button>
<el-button type="primary" @click="handleClassWorkSave"> </el-button> <el-button type="primary" @click="handleClassWorkSave"> </el-button>
</div> </div>
<div class="prepare-con" > <div class="prepare-con" >
<el-form <el-form
ref="classWorkFormRef" ref="classWorkFormRef"
:model="classWorkForm" :model="classWorkForm"
label-width="90" label-width="90"
style=" height: 100%; overflow: hidden;display: flex;flex-direction: column;" style=" height: 100%; overflow: hidden;display: flex;flex-direction: column;"
> >
<div > <div >
<el-form-item label="作业名称"> <el-form-item label="作业名称">
<el-input v-model="classWorkForm.uniquekey" type="text" placeholder="请输入作业名称"/> <el-input v-model="classWorkForm.uniquekey" type="text" placeholder="请输入作业名称"/>
</el-form-item> </el-form-item>
@ -93,8 +93,8 @@
<el-input v-if="classWorkForm.worktype == '课堂展示'" v-model="classWorkForm.question" type="textarea" placeholder="请输入作业说明" /> <el-input v-if="classWorkForm.worktype == '课堂展示'" v-model="classWorkForm.question" type="textarea" placeholder="请输入作业说明" />
</el-form-item> </el-form-item>
</div> </div>
<div v-if="classWorkForm.worktype == '习题训练'" class="pageRight-list"> <div v-if="classWorkForm.worktype == '习题训练'" class="pageRight-list">
<div :style="{height: '100%', 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}"> <div :style="{height: '100%', 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
<template v-for="(item,index) in classWorkForm.quizlist" :key="item.id"> <template v-for="(item,index) in classWorkForm.quizlist" :key="item.id">
<div style="margin: 5px; background-color: white"> <div style="margin: 5px; background-color: white">
@ -136,6 +136,10 @@ import whiteboard from '@/components/whiteboard/whiteboard.vue'
import FileUpload from "@/components/FileUpload/index.vue"; import FileUpload from "@/components/FileUpload/index.vue";
import Right from './Right/index.vue' import Right from './Right/index.vue'
import {
Delete
} from '@element-plus/icons-vue'
import SetHomework from '@/components/set-homework/index.vue' import SetHomework from '@/components/set-homework/index.vue'
import { useGetHomework } from '@/hooks/useGetHomework' import { useGetHomework } from '@/hooks/useGetHomework'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
@ -221,7 +225,7 @@ const selectable=(row, index)=>{
* 获取 entpcourseid 获取作业列表 * 获取 entpcourseid 获取作业列表
*/ */
const initHomeWork = async()=> { const initHomeWork = async()=> {
tasklist_loading.value = true; tasklist_loading.value = true;
// const { res, chapterId } = await useGetHomework(courseObj.node); // const { res, chapterId } = await useGetHomework(courseObj.node);
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode')); const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
console.log('entpcourseid', chapterId); console.log('entpcourseid', chapterId);
@ -233,7 +237,7 @@ const initHomeWork = async()=> {
const handleNewAllClass = () => { const handleNewAllClass = () => {
taskTable.value.setCurrentRow({});// taskTable.value.setCurrentRow({});//
currentRow.value = {id:0}; // currentRow.value = {id:0}; //
//-------- //--------
classWorkForm.id = 0; classWorkForm.id = 0;
classWorkForm.uniquekey = ""; // classWorkForm.uniquekey = ""; //
@ -260,7 +264,7 @@ const handleDelete =() => {
return delClasswork(ids.join(',')); return delClasswork(ids.join(','));
}).then(() => { }).then(() => {
taskTable.value.setCurrentRow({});// taskTable.value.setCurrentRow({});//
currentRow.value = {id:0}; // currentRow.value = {id:0}; //
taskList.value = []; taskList.value = [];
// initHomeWork(); // initHomeWork();
setTimeout(() => { setTimeout(() => {
@ -351,17 +355,17 @@ let propsformobj = reactive({
* 选中的布置作业行 * 选中的布置作业行
*/ */
const handleCurrentChange = (val) => { const handleCurrentChange = (val) => {
console.log(val,'???????????') console.log(val,'???????????')
if(val && val.id >0 ) { if(val && val.id >0 ) {
currentRow.value = val; currentRow.value = val;
classWorkForm.worktype = val.worktype; //
editListItem(val, courseObj).then((obj) => { editListItem(val, courseObj).then((obj) => {
if(obj){ if(obj){
propsformobj = obj; propsformobj = obj;
// //
classWorkForm.id = obj.id; classWorkForm.id = obj.id;
classWorkForm.uniquekey = cloneDeep(obj.uniquekey); // classWorkForm.uniquekey = cloneDeep(obj.uniquekey); //
classWorkForm.worktype = cloneDeep(obj.worktype); //
classWorkForm.title = cloneDeep(obj.title); // classWorkForm.title = cloneDeep(obj.title); //
classWorkForm.quizlist = cloneDeep(obj.quizlist); // classWorkForm.quizlist = cloneDeep(obj.quizlist); //
classWorkForm.chooseWorkLists = cloneDeep(obj.chooseWorkLists); // list classWorkForm.chooseWorkLists = cloneDeep(obj.chooseWorkLists); // list
@ -375,7 +379,7 @@ const handleCurrentChange = (val) => {
/** /**
* 添加作业 * 添加作业
* @param entpcourseworkid * @param entpcourseworkid
*/ */
const handleClassWorkQuizAdd = (entpcourseworkid) => { const handleClassWorkQuizAdd = (entpcourseworkid) => {
var exist = false; var exist = false;
@ -679,7 +683,7 @@ const editWork = async (cform) =>{
// // // //
// router.back() // router.back()
} }
} }
//---- //----
@ -740,11 +744,11 @@ const editWork = async (cform) =>{
text-align: left; text-align: left;
} }
} }
} }
.page-center{ .page-center{
flex: 1; flex: 1;
// width: 100%; //min-width: calc(100% - 675px);
height: 100%; height: 100%;
padding: 0 5px; padding: 0 5px;
margin: 0 5px; margin: 0 5px;
@ -756,8 +760,8 @@ const editWork = async (cform) =>{
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.prepare-center-xbtk{ .prepare-center-xbtk{
height: 100%; height: 100%;