作业设计:习题训练添加

This commit is contained in:
白了个白 2024-09-23 10:04:40 +08:00
parent e59071c16b
commit 6b24749db9
2 changed files with 37 additions and 41 deletions

View File

@ -197,7 +197,7 @@
</div> -->
</el-col>
<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">
<div style="margin: 5px; background-color: white">
<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 { updateClasswork } from '@/api/classTask'
import { useGetHomework } from '@/hooks/useGetHomework'
import { addClassworkReturnId } from '@/api/teaching/classwork'
import useUserStore from '@/store/modules/user'
@ -362,8 +363,9 @@ let classWorkForm = reactive({
worktype: '习题训练', //
title: '',//
quizlist: [], //
})
}); //
const chooseWorkLists = ref([]); // ? list
const whiteboardObj = ref(''); // -
/***
@ -640,7 +642,8 @@ const handleClassWorkSave = async () => {
this.chooseWorkLists = [];
// 4.
this.getClassWorkAllList();
//
// this.getClassWorkAllList();
this.classWorkForm.worktype = "习题训练";
this.newWorkSpace = false;
@ -649,10 +652,10 @@ const handleClassWorkSave = async () => {
return;
}
const { res, chapterId } = await useGetHomework(this.currentNode)
//
const { chapterId } = await useGetHomework(props.bookobj.node)
// this.entpcourseid = chapterId
if (classWorkForm.worktype === "课堂展示") {
this.boardLoading = true
let canvasJson = this.$refs.boardref.getCanvasJson()
@ -670,7 +673,7 @@ const handleClassWorkSave = async () => {
formObj.uniquekey = this.classWorkForm.uniquekey;
formObj.classid = 0;
formObj.classcourseid = 0;
formObj.entpcourseid = this.courseObj.id;
formObj.entpcourseid = chapterId;//
formObj.slideid = 0;
formObj.title = this.classWorkForm.title;
formObj.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
@ -686,7 +689,8 @@ const handleClassWorkSave = async () => {
this.chooseWorkLists = [];
this.whiteboardObj = '';
// refresh the list
this.getClassWorkAllList();
//
// this.getClassWorkAllList();
this.newWorkSpace = false;
this.newWorkSpaceEdit = false;
this.workEdit = false;
@ -727,7 +731,8 @@ const handleClassWorkSave = async () => {
this.fileHomeworkList = []
this.whiteboardObj = '';
// refresh the list
this.getClassWorkAllList();
//
// this.getClassWorkAllList();
this.newWorkSpace = false;
this.newWorkSpaceEdit = false;
this.workEdit = false;
@ -756,7 +761,7 @@ const handleClassWorkSave = async () => {
console.log(userStore,'userStoreuserStoreuserStore')
const cform = {
id: 0,
workdate: classWorkForm.workdate, // //
workdate: classWorkForm.workdate, // //web
deaddate: '', //
entpid: userStore.deptId, //
level: 1,
@ -767,7 +772,7 @@ const handleClassWorkSave = async () => {
uniquekey: classWorkForm.uniquekey,//
classid: 0,
classcourseid: 0,
entpcourseid: chapterId, //
entpcourseid: chapterId, //
slideid: 0,
title: classWorkForm.title, //
workcodes: JSON.stringify(classWorkForm.workcodes), //
@ -786,39 +791,28 @@ const handleClassWorkSave = async () => {
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
console.log(cform,'提交的数据');
// addClassworkReturnId(cform).then(workres => {
// this.classWorkForm.worktype = "";
// this.chooseWorkLists = [];
// this.whiteboardObj = '';
// // refresh the list
addClassworkReturnId(cform).then(workres => {
ElMessage({ type: 'success', message: '作业设计成功!'});
//
classWorkForm.worktype = "习题训练";
classWorkForm.uniquekey = props.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
// refresh the list
//
// this.getClassWorkAllList();
// // 使 240603
// // 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
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
// })
})
}
}
}

View File

@ -72,6 +72,7 @@ const courseObj = reactive({
levelFirstId: '',
levelSecondId: '',
coursetitle:'',
node: null, //
//
})
@ -95,6 +96,7 @@ const getData = (data) => {
courseObj.levelFirstId = levelFirstId //
courseObj.levelSecondId = levelSecondId //
courseObj.coursetitle = node.itemtitle // (/)
courseObj.node = node; //
// ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))