作业布置:新增常规作业编辑
This commit is contained in:
parent
aea10a5bba
commit
7a878fc5b0
|
@ -460,6 +460,7 @@ let classtaskObj = reactive({
|
|||
worktype: '', // 设计中的作业类型
|
||||
quizlist: [], // 设计中的试题列表
|
||||
chooseWorkLists: [],// 设计中的框架梳理list
|
||||
fileHomeworkList: [],// 设计中的常规作业list
|
||||
})
|
||||
// 作业内容编辑-跳转到设计界面
|
||||
const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
||||
|
@ -487,13 +488,15 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
|
||||
if (listCourseWork.length > 0) {
|
||||
classtaskObj.id= row.id; //
|
||||
classtaskObj.bookObj = courseObj; // 教材对象
|
||||
classtaskObj.bookName = row.evaltitle? row.evalparenttitle+'/'+row.evaltitle: row.evalparenttitle// 课程名称:单元/章节: 单元
|
||||
classtaskObj.uniquekey= row.uniquekey; // 设计中的标题
|
||||
classtaskObj.title= row.title; // 设计中的说明
|
||||
classtaskObj.worktype= row.worktype; // 设计中的作业类型
|
||||
classtaskObj.quizlist= []; // 设计中的试题列表
|
||||
classtaskObj.chooseWorkLists = []; //设计中的 框架梳理list
|
||||
classtaskObj.bookObj = courseObj; // 教材对象
|
||||
classtaskObj.fileHomeworkList = []; //设计中的 常规作业list
|
||||
|
||||
|
||||
|
||||
if (row.worktype == '框架梳理') {
|
||||
|
@ -550,7 +553,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
}
|
||||
})
|
||||
}
|
||||
else if (this.classWorkForm.worktype == '课堂展示') {
|
||||
else if (row.worktype == '课堂展示') {
|
||||
|
||||
// const workcodes = JSON.parse(this.currentTask.workcodes);
|
||||
// const jsonString = JSON.stringify(workcodes.json);
|
||||
|
@ -559,11 +562,18 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
// this.isShowBoard = true
|
||||
// this.whiteboardObj = jsonString;
|
||||
}
|
||||
else if (this.classWorkForm.worktype == '常规作业') {
|
||||
// this.fileHomeworkList = [];
|
||||
// if(isJson(this.currentTask.workcodes)){
|
||||
// this.fileHomeworkList = JSON.parse(this.currentTask.workcodes);
|
||||
// }
|
||||
else if (row.worktype == '常规作业') {
|
||||
if(isJson(row.workcodes)){
|
||||
classtaskObj.fileHomeworkList = JSON.parse(row.workcodes);
|
||||
|
||||
// TODO 待后续提共在下面 跳转 作业设计 进行编辑页面
|
||||
router.push({
|
||||
path: '/newClassTask',
|
||||
query: {
|
||||
classtaskObj: JSON.stringify(classtaskObj),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -574,7 +584,20 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
const isJson = (str) => {
|
||||
if (typeof str == 'string') {
|
||||
try {
|
||||
let obj = JSON.parse(str)
|
||||
if (typeof obj == 'object' && obj) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 作业说明编辑-确认
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
</template>
|
||||
<template v-if="classWorkForm.worktype =='常规作业'">
|
||||
<div v-loading="fileLoading" class="upload-homework">
|
||||
<FileUpload v-model="fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
|
||||
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
@ -363,7 +363,8 @@ let classWorkForm = reactive({
|
|||
worktype: props.propsformobj.worktype?cloneDeep(props.propsformobj.worktype): '习题训练', //作业类型
|
||||
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
|
||||
chooseWorkLists: props.propsformobj.chooseWorkLists?cloneDeep(props.propsformobj.chooseWorkLists):[], // 作业框架梳理list
|
||||
fileHomeworkList: props.propsformobj.fileHomeworkList?cloneDeep(props.propsformobj.fileHomeworkList):[] // 常规作业文件列表
|
||||
}); // 提交的作业内容
|
||||
const whiteboardObj = ref(''); // 作业资源 - 课堂展示 白板
|
||||
// ---------------------------------------------------
|
||||
|
@ -381,7 +382,6 @@ const prevReadMsg = reactive({
|
|||
const flowData = ref({})// 框架梳理
|
||||
//常规作业----------
|
||||
const fileLoading = ref(false); // 常规作业loading
|
||||
const fileHomeworkList = ref([]);// 常规作业
|
||||
|
||||
/***
|
||||
* 作业类型切换
|
||||
|
@ -752,7 +752,7 @@ const handleClassWorkSave = async () => {
|
|||
}
|
||||
else if(classWorkForm.worktype === "常规作业"){
|
||||
fileLoading.value = true
|
||||
cform.workcodes = JSON.stringify(fileHomeworkList.value);
|
||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
||||
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
||||
try {
|
||||
addClassworkReturnId(cform).then(() => {
|
||||
|
@ -766,7 +766,7 @@ const handleClassWorkSave = async () => {
|
|||
// 情况选择的资源缓存
|
||||
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
||||
whiteboardObj.value = ''; // ? // 清空白板
|
||||
fileHomeworkList.value = []; // 常规作业list
|
||||
classWorkForm.fileHomeworkList.value = []; // 常规作业list
|
||||
// refresh the list
|
||||
//这里分离了,所以不需要更新表单数据了
|
||||
// this.getClassWorkAllList();
|
||||
|
@ -933,10 +933,11 @@ const editWork = async (cform) =>{
|
|||
// }else if (classWorkForm.worktype=='课堂展示') {
|
||||
|
||||
|
||||
// }else if (classWorkForm.worktype=='常规作业') {
|
||||
// // 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
||||
// classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
|
||||
// }
|
||||
else if (classWorkForm.worktype=='常规作业') {
|
||||
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
||||
}
|
||||
|
||||
// 3.更新作业任务本身
|
||||
let res = await updateClasswork(cform);
|
||||
|
|
|
@ -65,6 +65,7 @@ const classWorkForm = reactive({
|
|||
worktype: classtaskObj? JSON.parse(classtaskObj).worktype : '', // 设计中的作业类型
|
||||
quizlist: classtaskObj? JSON.parse(classtaskObj).quizlist : [], // 设计中的试题列表
|
||||
chooseWorkLists: classtaskObj? JSON.parse(classtaskObj).chooseWorkLists : [],// 设计中的框架梳理list
|
||||
fileHomeworkList: classtaskObj? JSON.parse(classtaskObj).fileHomeworkList : [],// 设计中的常规文件作业list
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue