作业布置:新增课堂展示编辑

This commit is contained in:
白了个白 2024-10-09 15:14:42 +08:00
parent 7a878fc5b0
commit 68388b9c86
5 changed files with 37 additions and 56 deletions

View File

@ -66,7 +66,7 @@
"xlsx": "^0.18.5",
"less": "^4.2.0",
"less-loader": "^7.3.0",
"whiteboard_lyc": "^0.0.8"
"whiteboard_lyc": "^0.1.3"
},
"devDependencies": {
"@electron-toolkit/eslint-config": "^1.0.2",

View File

@ -60,10 +60,12 @@
<el-button>{{ type == 'design' ? '形状' : '工具' }}</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="square">正方形</el-dropdown-item>
<el-dropdown-item command="rectangle">矩形</el-dropdown-item>
<el-dropdown-item command="diamond">菱形</el-dropdown-item>
<el-dropdown-item command="triangle">三角形</el-dropdown-item>
<el-dropdown-item command="circle">圆形</el-dropdown-item>
<el-dropdown-item command="elliptic">椭圆形</el-dropdown-item>
<el-dropdown-item command="line">线段</el-dropdown-item>
<el-dropdown-item command="arrow">箭头</el-dropdown-item>
<template v-if="type != 'design'">
@ -397,7 +399,7 @@ const scroll = reactive({
//
const showGrid = ref(false)
//
// const readonly = ref(false)
const readonly = ref(false)
//
const elReadonly = ref(false)
@ -675,8 +677,8 @@ const getCanvasBase64 = async () =>{
let base64 = await app.exportImage({
type: 'image/jpeg',
renderBg: exportRenderBackground.value,
paddingX: 0,
paddingY: 0,
paddingX: 10,
paddingY: 10,
onlySelected: exportOnlySelected.value,
backgroundColor: '#ffffff'
})

View File

@ -461,6 +461,7 @@ let classtaskObj = reactive({
quizlist: [], //
chooseWorkLists: [],// list
fileHomeworkList: [],// list
whiteboardObj: '',//
})
// -
const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
@ -496,7 +497,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
classtaskObj.quizlist= []; //
classtaskObj.chooseWorkLists = []; // list
classtaskObj.fileHomeworkList = []; // list
classtaskObj.whiteboardObj = ''; //
if (row.worktype == '框架梳理') {
@ -515,13 +516,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
res.data.worktype = '框架梳理';
res.data.score = listCourseWork[0].score;
classtaskObj.chooseWorkLists.push(res.data);
// TODO
router.push({
path: '/newClassTask',
query: {
classtaskObj: JSON.stringify(classtaskObj),
}
})
//
}
else if (row.worktype == '习题训练') {
const ids = listCourseWork.map(item => item.id).join(",");
@ -542,45 +537,30 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
});
classtaskObj.quizlist = idres.rows;
// TODO
router.push({
path: '/newClassTask',
query: {
classtaskObj: JSON.stringify(classtaskObj),
}
})
//
}
})
}
else if (row.worktype == '课堂展示') {
// const workcodes = JSON.parse(this.currentTask.workcodes);
// const jsonString = JSON.stringify(workcodes.json);
// await this.$nextTick();
// this.isShowBoard = true
// this.whiteboardObj = jsonString;
console.log('row.课堂展示', row.workcodes);
const workcodes = JSON.parse(row.workcodes);
classtaskObj.whiteboardObj = JSON.stringify(workcodes.json);
//
}
else if (row.worktype == '常规作业') {
if(isJson(row.workcodes)){
classtaskObj.fileHomeworkList = JSON.parse(row.workcodes);
// TODO
router.push({
path: '/newClassTask',
query: {
classtaskObj: JSON.stringify(classtaskObj),
}
})
//
}
}
//
router.push({
path: '/newClassTask',
query: {
classtaskObj: JSON.stringify(classtaskObj),
}
})
}
};

View File

@ -21,12 +21,12 @@
<div v-if="classWorkForm.worktype == '课堂展示'" style="height: 100%; display: flex; flex-direction: column;">
<div style="flex: 0 0 auto;">
<el-form-item label="问题">
<el-input v-model="question" type="text" placeholder="请输入问题" />
<el-input v-model="classWorkForm.title" type="text" placeholder="请输入问题" />
</el-form-item>
</div>
<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="mainHeight - 150" :isShowSave="false" :data="whiteboardObj"/>
<whiteboard ref="boardref" :height="mainHeight - 150" :isShowSave="false" :data="classWorkForm.whiteboardObj"/>
</div>
</div>
<div v-else class="el-form-work-list">
@ -364,16 +364,14 @@ let classWorkForm = reactive({
title: props.propsformobj.title?cloneDeep(props.propsformobj.title):'',//
quizlist: props.propsformobj.quizlist?cloneDeep(props.propsformobj.quizlist):[], //
chooseWorkLists: props.propsformobj.chooseWorkLists?cloneDeep(props.propsformobj.chooseWorkLists):[], // list
fileHomeworkList: props.propsformobj.fileHomeworkList?cloneDeep(props.propsformobj.fileHomeworkList):[] //
fileHomeworkList: props.propsformobj.fileHomeworkList?cloneDeep(props.propsformobj.fileHomeworkList):[], //
whiteboardObj: props.propsformobj.whiteboardObj?cloneDeep(props.propsformobj.whiteboardObj):'', // -
}); //
const whiteboardObj = ref(''); // -
// ---------------------------------------------------
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //
// -------
const boardLoading = ref(false);
const isShowBoard = ref(false); //
const question = ref(''); // --
const prevReadMsg = reactive({
visible: false,
type: ""
@ -718,8 +716,7 @@ const handleClassWorkSave = async () => {
let canvasJson = proxy.$refs.boardref.getCanvasJson()
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
//
// cform.worktag = question.value;
cform.title = question.value;
cform.title = classWorkForm.title;
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
cform.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
try {
@ -733,7 +730,7 @@ const handleClassWorkSave = async () => {
//
classWorkForm.chooseWorkLists = []; // list
whiteboardObj.value = ''; // ? //
classWorkForm.whiteboardObj = ''; // ? //
// refresh the list
//
// this.getClassWorkAllList();
@ -765,8 +762,8 @@ const handleClassWorkSave = async () => {
//
classWorkForm.chooseWorkLists = []; // list
whiteboardObj.value = ''; // ? //
classWorkForm.fileHomeworkList.value = []; // list
classWorkForm.whiteboardObj = ''; // ? //
classWorkForm.fileHomeworkList = []; // list
// refresh the list
//
// this.getClassWorkAllList();
@ -818,7 +815,7 @@ const handleClassWorkSave = async () => {
//
classWorkForm.chooseWorkLists = [];
whiteboardObj.value = ''; // ? //
classWorkForm.whiteboardObj = ''; // ? //
// refresh the list
//
// this.getClassWorkAllList();
@ -930,10 +927,11 @@ const editWork = async (cform) =>{
let res = await updateClassworkeval(uplParams);
}
}
// }else if (classWorkForm.worktype=='') {
// }
else if (classWorkForm.worktype=='课堂展示') {
let canvasJson = proxy.$refs.boardref.getCanvasJson()
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
}
else if (classWorkForm.worktype=='常规作业') {
// 1. (, )
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);

View File

@ -66,6 +66,7 @@ const classWorkForm = reactive({
quizlist: classtaskObj? JSON.parse(classtaskObj).quizlist : [], //
chooseWorkLists: classtaskObj? JSON.parse(classtaskObj).chooseWorkLists : [],// list
fileHomeworkList: classtaskObj? JSON.parse(classtaskObj).fileHomeworkList : [],// list
whiteboardObj: classtaskObj? JSON.parse(classtaskObj).whiteboardObj : '',//
})