This commit is contained in:
parent
cc26ea4780
commit
2e27d3e7fb
|
@ -159,7 +159,7 @@ import { useRouter } from 'vue-router'
|
|||
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
import { homeworklist, delClasswork } from '@/api/teaching/classwork'
|
||||
import { listEntpcoursework, listClassworkeval,updateClasswork } from '@/api/classTask'
|
||||
import { listEntpcoursework, listClassworkeval,updateClasswork,getEvaluationclue } from '@/api/classTask'
|
||||
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { processList } from '@/hooks/useProcessList'
|
||||
|
@ -459,9 +459,10 @@ let classtaskObj = reactive({
|
|||
title: '', // 设计中的说明
|
||||
worktype: '', // 设计中的作业类型
|
||||
quizlist: [], // 设计中的试题列表
|
||||
chooseWorkLists: [],// 设计中的框架梳理list
|
||||
})
|
||||
// 作业内容编辑-跳转到设计界面
|
||||
const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
|
||||
const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
||||
// this.newWorkSpace = true;
|
||||
// this.newWorkSpaceEdit = true;
|
||||
// this.currentTask = row;
|
||||
|
@ -491,6 +492,8 @@ const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
|
|||
classtaskObj.title= row.title; // 设计中的说明
|
||||
classtaskObj.worktype= row.worktype; // 设计中的作业类型
|
||||
classtaskObj.quizlist= []; // 设计中的试题列表
|
||||
classtaskObj.chooseWorkLists = []; //设计中的 框架梳理list
|
||||
classtaskObj.bookObj = courseObj; // 教材对象
|
||||
|
||||
|
||||
if (row.worktype == '框架梳理') {
|
||||
|
@ -500,14 +503,22 @@ const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
|
|||
// queryParams.ppttype = '教材分析';
|
||||
// queryParams.title = '框架梳理';
|
||||
// queryParams.filetype = 'draw';
|
||||
// const res = await getEvaluationclue(listCourseWork[0].id);
|
||||
// if ( res.data==null || res.data==undefined ) {
|
||||
// return;
|
||||
// }
|
||||
const res = await getEvaluationclue(listCourseWork[0].id);
|
||||
if ( res.data==null || res.data==undefined ) {
|
||||
return;
|
||||
}
|
||||
console.log('res.data', res.data);
|
||||
// this.chooseWorkLists = [];
|
||||
// res.data.worktype = '框架梳理';
|
||||
// res.data.score = listCourseWork[0].score;
|
||||
// this.chooseWorkLists.push(res.data);
|
||||
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(",");
|
||||
|
@ -515,7 +526,6 @@ const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
|
|||
// for (var i=0; i<idres.rows.length; i++) {
|
||||
// idres.rows[i].titletext = idres.rows[i].title.replace(/<[^>]+>/g, '');
|
||||
// }
|
||||
|
||||
// 格式化试题
|
||||
if(idres.rows&&idres.rows.length > 0){
|
||||
processList(idres.rows);
|
||||
|
@ -529,8 +539,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
|
|||
});
|
||||
|
||||
classtaskObj.quizlist = idres.rows;
|
||||
// 跳转 作业设计 进行编辑页面
|
||||
classtaskObj.bookObj = courseObj; // 教材对象
|
||||
// TODO 待后续提共在下面 跳转 作业设计 进行编辑页面
|
||||
router.push({
|
||||
path: '/newClassTask',
|
||||
query: {
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
|
||||
<div v-if="classWorkForm.worktype!='习题训练'" :style="{'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
||||
<div style="margin: 5px; background-color: white">
|
||||
<template v-for="(item) in chooseWorkLists" :key="item.id">
|
||||
<template v-for="(item) in classWorkForm.chooseWorkLists" :key="item.id">
|
||||
<div v-if="item.worktype==classWorkForm.worktype">
|
||||
<div class="choose-work">
|
||||
<div class="choose-work-title">{{ item.worktype }}</div>
|
||||
|
@ -367,9 +367,9 @@ let classWorkForm = reactive({
|
|||
uniquekey: props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):'', // 作业唯一标识 作业名称
|
||||
worktype: props.propsformobj.worktype?cloneDeep(props.propsformobj.worktype): '习题训练', //作业类型
|
||||
title: props.propsformobj.title?cloneDeep(props.propsformobj.title):'',// 作业说明
|
||||
quizlist: props.propsformobj.quizlist?cloneDeep(props.propsformobj.quizlist):[] // 作业习题列表内容
|
||||
quizlist: props.propsformobj.quizlist?cloneDeep(props.propsformobj.quizlist):[], // 作业习题列表内容
|
||||
chooseWorkLists: props.propsformobj.chooseWorkLists?cloneDeep(props.propsformobj.chooseWorkLists):[] // 作业框架梳理list
|
||||
}); // 提交的作业内容
|
||||
const chooseWorkLists = ref([]); // 框架梳理、?课堂展示
|
||||
const whiteboardObj = ref(''); // 作业资源 - 课堂展示 白板
|
||||
// 课堂展示-------
|
||||
const boardLoading = ref(false);
|
||||
|
@ -632,7 +632,7 @@ const prevRead = async (item) => {
|
|||
// 把教学资源添加为作业
|
||||
const handleClassWorkAddOfResource = (work) => {
|
||||
// 当前资源下是否已存在
|
||||
let arrSole = chooseWorkLists.value.filter((item) => {
|
||||
let arrSole = classWorkForm.chooseWorkLists.filter((item) => {
|
||||
return item.worktype === classWorkForm.worktype
|
||||
})
|
||||
// 仅能添加一个
|
||||
|
@ -641,21 +641,21 @@ const handleClassWorkAddOfResource = (work) => {
|
|||
return;
|
||||
}
|
||||
//存入集合
|
||||
let arr = chooseWorkLists.value.filter((item) => {
|
||||
let arr = classWorkForm.chooseWorkLists.filter((item) => {
|
||||
return item.id === work.id
|
||||
})
|
||||
if (arr.length===0) {
|
||||
work.score = 1;
|
||||
chooseWorkLists.value.push(work);
|
||||
classWorkForm.chooseWorkLists.push(work);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 删除作业
|
||||
*/
|
||||
const deleteClassWorkAddOfResource = (work) => {
|
||||
chooseWorkLists.value.filter((item, index) => {
|
||||
classWorkForm.chooseWorkLists.filter((item, index) => {
|
||||
if (item.id === work.id) {
|
||||
chooseWorkLists.value.splice(index, 1);
|
||||
classWorkForm.chooseWorkLists.splice(index, 1);
|
||||
return;
|
||||
}
|
||||
})
|
||||
|
@ -731,7 +731,7 @@ const handleClassWorkSave = async () => {
|
|||
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||
|
||||
// 情况选择的资源缓存
|
||||
chooseWorkLists.value = [];
|
||||
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
||||
whiteboardObj.value = ''; // ? // 清空白板
|
||||
// refresh the list
|
||||
//这里分离了,所以不需要更新表单数据了
|
||||
|
@ -763,7 +763,7 @@ const handleClassWorkSave = async () => {
|
|||
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||
|
||||
// 情况选择的资源缓存
|
||||
chooseWorkLists.value = [];
|
||||
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
||||
whiteboardObj.value = ''; // ? // 清空白板
|
||||
fileHomeworkList.value = []; // 常规作业list
|
||||
// refresh the list
|
||||
|
@ -792,7 +792,7 @@ const handleClassWorkSave = async () => {
|
|||
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
|
||||
}
|
||||
}else if( classWorkForm.worktype === "框架梳理") {
|
||||
chooseWorkLists.value.filter((item) => {
|
||||
classWorkForm.chooseWorkLists.filter((item) => {
|
||||
if (item.worktype === classWorkForm.worktype) {
|
||||
ll.push({'id':item.id, 'score': item.score});
|
||||
}
|
||||
|
@ -816,7 +816,7 @@ const handleClassWorkSave = async () => {
|
|||
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||
|
||||
// 情况选择的资源缓存
|
||||
chooseWorkLists.value = [];
|
||||
classWorkForm.chooseWorkLists = [];
|
||||
whiteboardObj.value = ''; // ? // 清空白板
|
||||
// refresh the list
|
||||
//这里分离了,所以不需要更新表单数据了
|
||||
|
@ -848,7 +848,7 @@ const editWork = async (cform) =>{
|
|||
// 不做校验
|
||||
|
||||
}else {
|
||||
if (chooseWorkLists.value.length == 0) {
|
||||
if (classWorkForm.chooseWorkLists.length == 0) {
|
||||
// 框架梳理
|
||||
ElMessage.error('请先添加作业资源!');
|
||||
return;
|
||||
|
|
|
@ -62,6 +62,7 @@ const classWorkForm = reactive({
|
|||
title: classtaskObj? JSON.parse(classtaskObj).title : '', // 设计中的说明
|
||||
worktype: classtaskObj? JSON.parse(classtaskObj).worktype : '', // 设计中的作业类型
|
||||
quizlist: classtaskObj? JSON.parse(classtaskObj).quizlist : [], // 设计中的试题列表
|
||||
chooseWorkLists: classtaskObj? JSON.parse(classtaskObj).chooseWorkLists : [],// 设计中的框架梳理list
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue