作业设计:习题训练添加
This commit is contained in:
parent
e59071c16b
commit
6b24749db9
|
@ -197,7 +197,7 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="9" class="work-right">
|
<el-col :span="9" class="work-right">
|
||||||
<div v-if="classWorkForm.worktype=='习题训练'" :style="{ 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
<div v-if="classWorkForm.worktype=='习题训练'" :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">
|
||||||
<div v-html="item.titleFormat" style="padding: 15px 20px 5px 20px"></div>
|
<div v-html="item.titleFormat" style="padding: 15px 20px 5px 20px"></div>
|
||||||
|
@ -264,6 +264,7 @@ import { processList } from '@/hooks/useProcessList'
|
||||||
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
||||||
import { updateClasswork } from '@/api/classTask'
|
import { updateClasswork } from '@/api/classTask'
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
|
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
||||||
|
|
||||||
|
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
@ -362,8 +363,9 @@ let classWorkForm = reactive({
|
||||||
worktype: '习题训练', //作业类型
|
worktype: '习题训练', //作业类型
|
||||||
title: '',// 作业说明
|
title: '',// 作业说明
|
||||||
quizlist: [], // 作业习题列表内容
|
quizlist: [], // 作业习题列表内容
|
||||||
})
|
}); // 提交的作业内容
|
||||||
|
const chooseWorkLists = ref([]); // 选择作业资源列表? 非习题训练的list
|
||||||
|
const whiteboardObj = ref(''); // 作业资源 - 课堂展示 白板
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
@ -640,7 +642,8 @@ const handleClassWorkSave = async () => {
|
||||||
this.chooseWorkLists = [];
|
this.chooseWorkLists = [];
|
||||||
|
|
||||||
// 4.操作完成后重新更新表单数据
|
// 4.操作完成后重新更新表单数据
|
||||||
this.getClassWorkAllList();
|
//这里分离了,所以不需要更新表单数据了
|
||||||
|
// this.getClassWorkAllList();
|
||||||
|
|
||||||
this.classWorkForm.worktype = "习题训练";
|
this.classWorkForm.worktype = "习题训练";
|
||||||
this.newWorkSpace = false;
|
this.newWorkSpace = false;
|
||||||
|
@ -649,10 +652,10 @@ const handleClassWorkSave = async () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { res, chapterId } = await useGetHomework(this.currentNode)
|
//
|
||||||
|
const { chapterId } = await useGetHomework(props.bookobj.node)
|
||||||
// this.entpcourseid = chapterId
|
// this.entpcourseid = chapterId
|
||||||
|
|
||||||
|
|
||||||
if (classWorkForm.worktype === "课堂展示") {
|
if (classWorkForm.worktype === "课堂展示") {
|
||||||
this.boardLoading = true
|
this.boardLoading = true
|
||||||
let canvasJson = this.$refs.boardref.getCanvasJson()
|
let canvasJson = this.$refs.boardref.getCanvasJson()
|
||||||
|
@ -670,7 +673,7 @@ const handleClassWorkSave = async () => {
|
||||||
formObj.uniquekey = this.classWorkForm.uniquekey;
|
formObj.uniquekey = this.classWorkForm.uniquekey;
|
||||||
formObj.classid = 0;
|
formObj.classid = 0;
|
||||||
formObj.classcourseid = 0;
|
formObj.classcourseid = 0;
|
||||||
formObj.entpcourseid = this.courseObj.id;
|
formObj.entpcourseid = chapterId;// 这个字段很特别
|
||||||
formObj.slideid = 0;
|
formObj.slideid = 0;
|
||||||
formObj.title = this.classWorkForm.title;
|
formObj.title = this.classWorkForm.title;
|
||||||
formObj.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
formObj.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
||||||
|
@ -686,7 +689,8 @@ const handleClassWorkSave = async () => {
|
||||||
this.chooseWorkLists = [];
|
this.chooseWorkLists = [];
|
||||||
this.whiteboardObj = '';
|
this.whiteboardObj = '';
|
||||||
// refresh the list
|
// refresh the list
|
||||||
this.getClassWorkAllList();
|
//这里分离了,所以不需要更新表单数据了
|
||||||
|
// this.getClassWorkAllList();
|
||||||
this.newWorkSpace = false;
|
this.newWorkSpace = false;
|
||||||
this.newWorkSpaceEdit = false;
|
this.newWorkSpaceEdit = false;
|
||||||
this.workEdit = false;
|
this.workEdit = false;
|
||||||
|
@ -727,7 +731,8 @@ const handleClassWorkSave = async () => {
|
||||||
this.fileHomeworkList = []
|
this.fileHomeworkList = []
|
||||||
this.whiteboardObj = '';
|
this.whiteboardObj = '';
|
||||||
// refresh the list
|
// refresh the list
|
||||||
this.getClassWorkAllList();
|
//这里分离了,所以不需要更新表单数据了
|
||||||
|
// this.getClassWorkAllList();
|
||||||
this.newWorkSpace = false;
|
this.newWorkSpace = false;
|
||||||
this.newWorkSpaceEdit = false;
|
this.newWorkSpaceEdit = false;
|
||||||
this.workEdit = false;
|
this.workEdit = false;
|
||||||
|
@ -756,7 +761,7 @@ const handleClassWorkSave = async () => {
|
||||||
console.log(userStore,'userStoreuserStoreuserStore')
|
console.log(userStore,'userStoreuserStoreuserStore')
|
||||||
const cform = {
|
const cform = {
|
||||||
id: 0,
|
id: 0,
|
||||||
workdate: classWorkForm.workdate, // //作业类型
|
workdate: classWorkForm.workdate, // //作业类型?web端这里貌似没有这个时间
|
||||||
deaddate: '', // 截止时间
|
deaddate: '', // 截止时间
|
||||||
entpid: userStore.deptId, //
|
entpid: userStore.deptId, //
|
||||||
level: 1,
|
level: 1,
|
||||||
|
@ -767,7 +772,7 @@ const handleClassWorkSave = async () => {
|
||||||
uniquekey: classWorkForm.uniquekey,// 作业名称、编码
|
uniquekey: classWorkForm.uniquekey,// 作业名称、编码
|
||||||
classid: 0,
|
classid: 0,
|
||||||
classcourseid: 0,
|
classcourseid: 0,
|
||||||
entpcourseid: chapterId, // 当前课程
|
entpcourseid: chapterId, // 这个字段很特别
|
||||||
slideid: 0,
|
slideid: 0,
|
||||||
title: classWorkForm.title, // 作业说明?
|
title: classWorkForm.title, // 作业说明?
|
||||||
workcodes: JSON.stringify(classWorkForm.workcodes), // 作业内容?
|
workcodes: JSON.stringify(classWorkForm.workcodes), // 作业内容?
|
||||||
|
@ -786,39 +791,28 @@ const handleClassWorkSave = async () => {
|
||||||
|
|
||||||
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
|
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
|
||||||
console.log(cform,'提交的数据');
|
console.log(cform,'提交的数据');
|
||||||
// addClassworkReturnId(cform).then(workres => {
|
addClassworkReturnId(cform).then(workres => {
|
||||||
// this.classWorkForm.worktype = "习题训练";
|
ElMessage({ type: 'success', message: '作业设计成功!'});
|
||||||
// this.chooseWorkLists = [];
|
// 重置提交表单
|
||||||
// this.whiteboardObj = '';
|
classWorkForm.worktype = "习题训练";
|
||||||
// // refresh the list
|
classWorkForm.uniquekey = props.uniquekey, // 作业唯一标识 作业名称
|
||||||
|
classWorkForm.title = "";
|
||||||
|
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||||
|
|
||||||
|
// 情况选择的资源缓存
|
||||||
|
chooseWorkLists.value = [];
|
||||||
|
whiteboardObj.value = ''; // ? // 清空白板
|
||||||
|
// refresh the list
|
||||||
|
//这里分离了,所以不需要更新表单数据了
|
||||||
// this.getClassWorkAllList();
|
// this.getClassWorkAllList();
|
||||||
|
|
||||||
// // 此方法此处不再使用 240603
|
// TODO 后续看是否跳转到 作业布置页面
|
||||||
// // var slist = [];
|
|
||||||
// // for (var i=0; i<this.classStudentList.length; i++) {
|
|
||||||
// // slist.push({studentid: this.classStudentList[i].studentid, name: this.classStudentList[i].name});
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // var quizll = [];
|
|
||||||
// // for (var i=0; i<this.classWorkForm.quizlist.length; i++) {
|
|
||||||
// // quizll.push({id: this.classWorkForm.quizlist[i].id});
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // var ttt = {
|
|
||||||
// // id: workres,
|
|
||||||
// // studentlist: slist,
|
|
||||||
// // entpcourseworklist: quizll
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // var wForm = {};
|
|
||||||
// // wForm.classworkarray = '['+JSON.stringify(ttt)+']';
|
|
||||||
|
|
||||||
// //pushClassWorkByArray(wForm).then(response => {});
|
|
||||||
|
|
||||||
|
//TODO 下面3个后续看是啥
|
||||||
// this.newWorkSpace = false;
|
// this.newWorkSpace = false;
|
||||||
// this.newWorkSpaceEdit = false;
|
// this.newWorkSpaceEdit = false;
|
||||||
// this.workEdit = false;
|
// this.workEdit = false;
|
||||||
// })
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ const courseObj = reactive({
|
||||||
levelFirstId: '',
|
levelFirstId: '',
|
||||||
levelSecondId: '',
|
levelSecondId: '',
|
||||||
coursetitle:'',
|
coursetitle:'',
|
||||||
|
node: null, // 选择的课程节点
|
||||||
//
|
//
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -95,6 +96,7 @@ const getData = (data) => {
|
||||||
courseObj.levelFirstId = levelFirstId // 单元
|
courseObj.levelFirstId = levelFirstId // 单元
|
||||||
courseObj.levelSecondId = levelSecondId // 章节
|
courseObj.levelSecondId = levelSecondId // 章节
|
||||||
courseObj.coursetitle = node.itemtitle // (单元/章节) 名称
|
courseObj.coursetitle = node.itemtitle // (单元/章节) 名称
|
||||||
|
courseObj.node = node; // 保存当前节点
|
||||||
|
|
||||||
// 头部 教材分析打开外部链接需要当前章节ID
|
// 头部 教材分析打开外部链接需要当前章节ID
|
||||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||||
|
|
Loading…
Reference in New Issue