作业布置:新增课堂展示编辑
This commit is contained in:
parent
7a878fc5b0
commit
68388b9c86
|
@ -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",
|
||||
|
|
|
@ -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'
|
||||
})
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 : '',// 设计中的 课堂展示 板书作业
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue