作业设计:习题训练添加

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> --> </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;
// }) })
} }
} }
} }

View File

@ -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}))