作业布置:列表新增 框架梳理编辑
This commit is contained in:
parent
4b3c511af1
commit
aea10a5bba
|
@ -7,7 +7,7 @@
|
||||||
<el-row class="top">
|
<el-row class="top">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="作业类型:">
|
<el-form-item label="作业类型:">
|
||||||
<el-radio-group v-model="formType" @change="changeFormType">
|
<el-radio-group v-model="classWorkForm.worktype" @change="changeFormType">
|
||||||
<template v-for="(item) in listWorkType" :key="item">
|
<template v-for="(item) in listWorkType" :key="item">
|
||||||
<el-radio :value="item" :disabled="props.isedit">{{ item }}</el-radio>
|
<el-radio :value="item" :disabled="props.isedit">{{ item }}</el-radio>
|
||||||
</template>
|
</template>
|
||||||
|
@ -252,7 +252,7 @@ import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
||||||
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
||||||
import { updateClasswork, listEvaluationclue,readFile, listClassworkeval,delClassworkeval,addClassworkeval } from '@/api/classTask'
|
import { updateClasswork, listEvaluationclue,readFile, listClassworkeval,delClassworkeval,addClassworkeval,updateClassworkeval } from '@/api/classTask'
|
||||||
import { listEvaluation } from '@/api/subject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
import { listEntpcoursefile } from '@/api/education/entpcoursefile'
|
import { listEntpcoursefile } from '@/api/education/entpcoursefile'
|
||||||
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
|
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
|
||||||
|
@ -293,11 +293,6 @@ const openDialog = () => {
|
||||||
isDialogOpen.value = true
|
isDialogOpen.value = true
|
||||||
}
|
}
|
||||||
const classWorkFormRef = ref(null);
|
const classWorkFormRef = ref(null);
|
||||||
const formType = ref('习题训练')
|
|
||||||
const newWorkSpaceEdit = ref(false); //修改学习任务
|
|
||||||
// ---------------------------------------------------
|
|
||||||
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型
|
|
||||||
|
|
||||||
const entpCourseWorkTypeList = ref([
|
const entpCourseWorkTypeList = ref([
|
||||||
{value: 0, label: "不限"},
|
{value: 0, label: "不限"},
|
||||||
{value: 1, label: "单选题"},
|
{value: 1, label: "单选题"},
|
||||||
|
@ -371,6 +366,9 @@ let classWorkForm = reactive({
|
||||||
chooseWorkLists: props.propsformobj.chooseWorkLists?cloneDeep(props.propsformobj.chooseWorkLists):[] // 作业框架梳理list
|
chooseWorkLists: props.propsformobj.chooseWorkLists?cloneDeep(props.propsformobj.chooseWorkLists):[] // 作业框架梳理list
|
||||||
}); // 提交的作业内容
|
}); // 提交的作业内容
|
||||||
const whiteboardObj = ref(''); // 作业资源 - 课堂展示 白板
|
const whiteboardObj = ref(''); // 作业资源 - 课堂展示 白板
|
||||||
|
// ---------------------------------------------------
|
||||||
|
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型
|
||||||
|
|
||||||
// 课堂展示-------
|
// 课堂展示-------
|
||||||
const boardLoading = ref(false);
|
const boardLoading = ref(false);
|
||||||
const isShowBoard = ref(false); // 是否展示白板
|
const isShowBoard = ref(false); // 是否展示白板
|
||||||
|
@ -389,8 +387,7 @@ const fileHomeworkList = ref([]);// 常规作业
|
||||||
* 作业类型切换
|
* 作业类型切换
|
||||||
*/
|
*/
|
||||||
const changeFormType = (val) => {
|
const changeFormType = (val) => {
|
||||||
console.log(val)
|
classWorkForm.worktype = val;
|
||||||
classWorkForm.worktype = val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(props.propsformobj)
|
console.log(props.propsformobj)
|
||||||
|
@ -650,7 +647,7 @@ const handleClassWorkAddOfResource = (work) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 删除作业
|
* 右侧资源删除作业 非习题list
|
||||||
*/
|
*/
|
||||||
const deleteClassWorkAddOfResource = (work) => {
|
const deleteClassWorkAddOfResource = (work) => {
|
||||||
classWorkForm.chooseWorkLists.filter((item, index) => {
|
classWorkForm.chooseWorkLists.filter((item, index) => {
|
||||||
|
@ -660,6 +657,10 @@ const deleteClassWorkAddOfResource = (work) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/** 右侧资源删除按钮 习题list */
|
||||||
|
const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
|
classWorkForm.quizlist.splice(index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -897,54 +898,38 @@ const editWork = async (cform) =>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3.更新作业任务信息
|
// 3.更新作业任务信息-判断最后更新了
|
||||||
// const evalid = this.homeworkLesson.length==0 ? '' : this.homeworkLesson.length==1 ? this.homeworkLesson[0] : this.homeworkLesson[1];
|
}
|
||||||
// const formObj = {
|
else if (classWorkForm.worktype=='框架梳理') {
|
||||||
// id: this.currentTask.id,
|
// 1.先查询该workid下所有的id
|
||||||
// uniquekey: this.classWorkForm.uniquekey, // 更新[作业名称]
|
const wevalres = await listClassworkeval({'workid': classWorkForm.id});
|
||||||
// // warn: 这里需确认是否可支持修改当前作业任务更换单元章节
|
if (wevalres.rows.length == 0) {
|
||||||
// //evalid = evalid, // 更新[作业范围]
|
ElMessage.error('未找到原框架梳理任务,请或退出重试');
|
||||||
// }
|
return;
|
||||||
// let res = await updateClasswork(cform);
|
|
||||||
// console.log('更新作业任务信息', cform);
|
|
||||||
let res = await updateClasswork(cform);
|
|
||||||
if (res.code == 200) {
|
|
||||||
ElMessage.success('更新成功');
|
|
||||||
// 返回上一页
|
|
||||||
router.back()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2.更新作业任务下的框架梳理
|
||||||
|
let needUplEval = false;
|
||||||
|
if (classWorkForm.chooseWorkLists.length !== props.propsformobj.chooseWorkLists.length) {
|
||||||
|
needUplEval = true;
|
||||||
|
}else {
|
||||||
|
// 只要有一个不一致则说明需要更新
|
||||||
|
needUplEval = classWorkForm.chooseWorkLists.some(cur =>
|
||||||
|
!props.propsformobj.chooseWorkLists.some(last =>
|
||||||
|
last.id === cur.id && last.score === cur.score
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (needUplEval) {
|
||||||
|
const uplParams = {
|
||||||
|
id: wevalres.rows[0].id,
|
||||||
|
entpcourseworkid: classWorkForm.chooseWorkLists[0].id,
|
||||||
|
score: classWorkForm.chooseWorkLists[0].score,
|
||||||
|
}
|
||||||
|
// 更新作业任务下的框架梳理
|
||||||
|
let res = await updateClassworkeval(uplParams);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// else if (classWorkForm.worktype=='框架梳理') {
|
|
||||||
// // 1.先查询该workid下所有的id
|
|
||||||
// const wevalres = await listClassworkeval({'workid': this.currentTask.id});
|
|
||||||
// if (wevalres.rows.length == 0) {
|
|
||||||
// ElMessage.error('未找到原框架梳理任务,请或退出重试');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 2.更新作业任务下的框架梳理
|
|
||||||
// let needUplEval = false;
|
|
||||||
// if (this.chooseWorkLists.length !== this.currentTask.entpcourseworklistarray.length) {
|
|
||||||
// needUplEval = true;
|
|
||||||
// }else {
|
|
||||||
// // 只要有一个不一致则说明需要更新
|
|
||||||
// needUplEval = this.chooseWorkLists.some(cur =>
|
|
||||||
// !this.currentTask.entpcourseworklistarray.some(last =>
|
|
||||||
// last.id === cur.id && last.score === cur.score
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// if (needUplEval) {
|
|
||||||
// const uplParams = {
|
|
||||||
// id: wevalres.rows[0].id,
|
|
||||||
// entpcourseworkid: this.chooseWorkLists[0].id,
|
|
||||||
// score: this.chooseWorkLists[0].score,
|
|
||||||
// }
|
|
||||||
// let res = await updateClassworkeval(uplParams);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }else if (classWorkForm.worktype=='课堂展示') {
|
// }else if (classWorkForm.worktype=='课堂展示') {
|
||||||
|
|
||||||
|
|
||||||
|
@ -953,19 +938,13 @@ const editWork = async (cform) =>{
|
||||||
// classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
|
// classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// // 3.更新作业任务本身
|
// 3.更新作业任务本身
|
||||||
// let res = await updateClasswork(cform);
|
let res = await updateClasswork(cform);
|
||||||
// this.fileHomeworkList = [];
|
if (res.code == 200) {
|
||||||
// this.chooseWorkLists = [];
|
ElMessage.success('更新成功');
|
||||||
|
// 返回上一页
|
||||||
// // 4.操作完成后重新更新表单数据
|
router.back()
|
||||||
// //这里分离了,所以不需要更新表单数据了
|
}
|
||||||
// // this.getClassWorkAllList();
|
|
||||||
|
|
||||||
// this.classWorkForm.worktype = "习题训练";
|
|
||||||
// this.newWorkSpace = false;
|
|
||||||
// this.newWorkSpaceEdit = false;
|
|
||||||
// this.workEdit = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ const props = defineProps({
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 10px 5px;
|
padding: 10px 5px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
.class-reserv-item-body {
|
.class-reserv-item-body {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
|
@ -15,12 +15,13 @@
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
|
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
|
||||||
<el-col :span="12" style="padding-left: 20px; text-align: left;">
|
<el-col :span="12" style="padding-left: 20px; text-align: left;">
|
||||||
<div v-if="!isOpenLeftBook" class="unit-top-left" @click="onOpenLeftBook">
|
<div v-if="!isOpenLeftBook" class="unit-top-left cursor-pointer" @click="onOpenLeftBook">
|
||||||
<i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i>
|
<i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i>
|
||||||
<span>课程目录</span>
|
<span>课程目录</span>
|
||||||
<i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i>
|
<i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="unit-top-left">
|
<div v-else class="unit-top-left">
|
||||||
|
<i class="iconfont icon-xiangzuo cursor-pointer" style="color: blue;" @click="goBack">返回上页</i>
|
||||||
<span>课程:</span>
|
<span>课程:</span>
|
||||||
<span>{{bookTitle}}</span>
|
<span>{{bookTitle}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -49,6 +50,7 @@ import { getCurrentTime } from '@/utils/date'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter()
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
const classtaskObj = route.query.classtaskObj;//作业布置的内容对象
|
const classtaskObj = route.query.classtaskObj;//作业布置的内容对象
|
||||||
|
@ -110,6 +112,10 @@ const onOpenLeftBook = () => {
|
||||||
isCollapse.value = !isCollapse.value
|
isCollapse.value = !isCollapse.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 返回上一页---返回布置页面
|
||||||
|
const goBack = () =>{
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 编辑状态下……更新课程信息
|
// 编辑状态下……更新课程信息
|
||||||
|
@ -139,8 +145,10 @@ onMounted(() => {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
|
.cursor-pointer {
|
||||||
|
cursor: pointer;// 鼠标变成小手可点样式
|
||||||
|
}
|
||||||
.unit-top-left {
|
.unit-top-left {
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
.icon-xiangzuo {
|
.icon-xiangzuo {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
|
|
@ -136,6 +136,7 @@ watch(
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
.class-left {
|
.class-left {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
Loading…
Reference in New Issue