baigl #305

Merged
baigl merged 12 commits from baigl into main 2024-10-10 15:53:19 +08:00
4 changed files with 59 additions and 70 deletions
Showing only changes of commit aea10a5bba - Show all commits

View File

@ -7,7 +7,7 @@
<el-row class="top">
<el-col :span="24">
<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">
<el-radio :value="item" :disabled="props.isedit">{{ item }}</el-radio>
</template>
@ -252,7 +252,7 @@ import { useRouter } from 'vue-router'
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
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 { listEntpcoursefile } from '@/api/education/entpcoursefile'
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
@ -293,11 +293,6 @@ const openDialog = () => {
isDialogOpen.value = true
}
const classWorkFormRef = ref(null);
const formType = ref('习题训练')
const newWorkSpaceEdit = ref(false); //
// ---------------------------------------------------
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //
const entpCourseWorkTypeList = ref([
{value: 0, label: "不限"},
{value: 1, label: "单选题"},
@ -371,6 +366,9 @@ let classWorkForm = reactive({
chooseWorkLists: props.propsformobj.chooseWorkLists?cloneDeep(props.propsformobj.chooseWorkLists):[] // list
}); //
const whiteboardObj = ref(''); // -
// ---------------------------------------------------
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //
// -------
const boardLoading = ref(false);
const isShowBoard = ref(false); //
@ -389,8 +387,7 @@ const fileHomeworkList = ref([]);// 常规作业
* 作业类型切换
*/
const changeFormType = (val) => {
console.log(val)
classWorkForm.worktype = val;
classWorkForm.worktype = val;
}
console.log(props.propsformobj)
@ -650,7 +647,7 @@ const handleClassWorkAddOfResource = (work) => {
}
};
/**
* 删除作业
* 右侧资源删除作业 非习题list
*/
const deleteClassWorkAddOfResource = (work) => {
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.
// const evalid = this.homeworkLesson.length==0 ? '' : this.homeworkLesson.length==1 ? this.homeworkLesson[0] : this.homeworkLesson[1];
// const formObj = {
// id: this.currentTask.id,
// uniquekey: this.classWorkForm.uniquekey, // []
// // warn:
// //evalid = evalid, // []
// }
// let res = await updateClasswork(cform);
// console.log('', cform);
let res = await updateClasswork(cform);
if (res.code == 200) {
ElMessage.success('更新成功');
//
router.back()
// 3.-
}
else if (classWorkForm.worktype=='框架梳理') {
// 1.workidid
const wevalres = await listClassworkeval({'workid': classWorkForm.id});
if (wevalres.rows.length == 0) {
ElMessage.error('未找到原框架梳理任务,请或退出重试');
return;
}
// 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.workidid
// 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=='') {
@ -953,19 +938,13 @@ const editWork = async (cform) =>{
// classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
// }
// // 3.
// let res = await updateClasswork(cform);
// this.fileHomeworkList = [];
// this.chooseWorkLists = [];
// // 4.
// //
// // this.getClassWorkAllList();
// this.classWorkForm.worktype = "";
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
// 3.
let res = await updateClasswork(cform);
if (res.code == 200) {
ElMessage.success('更新成功');
//
router.back()
}
}

View File

@ -77,6 +77,7 @@ const props = defineProps({
border-radius: 10px;
padding: 10px 5px;
margin-bottom: 10px;
cursor: pointer;
.class-reserv-item-body {
flex: 1;

View File

@ -15,12 +15,13 @@
<!-- 标题 -->
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
<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>
<span>课程目录</span>
<i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i>
</div>
<div v-else class="unit-top-left">
<i class="iconfont icon-xiangzuo cursor-pointer" style="color: blue;" @click="goBack">返回上页</i>
<span>课程</span>
<span>{{bookTitle}}</span>
</div>
@ -49,6 +50,7 @@ import { getCurrentTime } from '@/utils/date'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user
const route = useRoute();
const router = useRouter()
const { proxy } = getCurrentInstance()
const classtaskObj = route.query.classtaskObj;//
@ -110,6 +112,10 @@ const onOpenLeftBook = () => {
isCollapse.value = !isCollapse.value
}
}
// ---
const goBack = () =>{
router.back()
}
onMounted(() => {
//
@ -139,8 +145,10 @@ onMounted(() => {
width: 300px;
min-height: 100%;
}
.cursor-pointer {
cursor: pointer;//
}
.unit-top-left {
cursor: pointer;
.icon-xiangzuo {
margin-right: 5px;

View File

@ -136,6 +136,7 @@ watch(
border-radius: 5px;
margin-bottom: 10px;
padding: 10px;
cursor: pointer;
.class-left {
flex-direction: column;