baigl #282

Merged
baigl merged 2 commits from baigl into main 2024-09-27 14:50:24 +08:00
4 changed files with 56 additions and 81 deletions
Showing only changes of commit 2887528e9e - Show all commits

View File

@ -171,10 +171,10 @@
<el-collapse-item title="老师布置详情" name="1">
<div class="image_list">
<div v-if="teachImageList.length > 0">
<div style="margin-bottom: 5px">
<div style="margin-bottom: 5px;text-align: left;">
<span style="color: red">温馨提示点击图片可放大预览 </span>
</div>
<div v-for="(imageItem, index) in teachImageList" :key="index">
<div v-for="(imageItem, index) in teachImageList" :key="index" style="text-align: left;">
<el-image
style="width: 400px; height: 400px"
:src="imageItem.url"
@ -198,7 +198,7 @@
</div>
<div v-if="teachFileList.length > 0">
<div style="margin: 10px 0">
<div style="margin: 10px 0;text-align: left;">
<span style="color: red" @click="openFile"
>温馨提示点击此处 可预览其他类型附件
</span>
@ -214,16 +214,16 @@
<div v-if="feedContentList.length > 0">
<div v-if="dialogProps.studentObj.worktype == '常规作业' && stuItem.rightanswer != ''&& stuItem.rightanswer != null">
<!-- 常规作业学生有的会答复 -->
<p style="padding: 10px 0;">学生答复内容</p>
<div style="padding: 0 20px">{{stuItem.rightanswer}}</div>
<p style="padding: 10px 0;text-align: left;">学生答复内容</p>
<div style="padding: 0 20px;text-align: left;">{{stuItem.rightanswer}}</div>
</div>
<p>学生答题附件内容</p>
<p style="text-align: left;">学生答题附件内容</p>
<div class="image_list">
<div v-if="imageList.length > 0">
<div style="margin-bottom: 5px">
<div style="margin-bottom: 5px;text-align: left;">
<span style="color: red">温馨提示点击图片可放大预览 </span>
</div>
<div v-for="(imageItem, index) in imageList" :key="index">
<div v-for="(imageItem, index) in imageList" :key="index" style="text-align: left;">
<el-image
style="width: 500px; height: 500px"
:src="imageItem.url"
@ -247,7 +247,7 @@
</div>
<div v-if="fileList.length > 0">
<div style="margin: 10px 0">
<div style="margin: 10px 0;text-align: left;">
<span style="color: red" @click="openFile"
>温馨提示点击此处 可预览其他类型附件
</span>
@ -255,7 +255,7 @@
</div>
<!-- 无附件内容 -->
<div v-if="imageList.length == 0 && fileList.length == 0" style="padding: 0 20px">未提交附件内容</div>
<div v-if="imageList.length == 0 && fileList.length == 0" style="padding: 0 20px;text-align: left;">未提交附件内容</div>
</div>
</div>
<div v-else>

View File

@ -247,7 +247,9 @@
<script setup>
import { onMounted, ref, nextTick, watch, reactive, getCurrentInstance } from 'vue'
import { ElMessage } from 'element-plus'
import { useToolState } from '@/store/modules/tool'
import { cloneDeep } from 'lodash'
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'
@ -263,10 +265,11 @@ import FileUpload from "@/components/FileUpload/index.vue";
import whiteboard from '@/components/whiteboard/whiteboard.vue'
import { useToolState } from '@/store/modules/tool'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user
const { proxy } = getCurrentInstance()
const router = useRouter()
const props = defineProps({
bookobj: {
@ -356,11 +359,11 @@ const workResource = reactive({
entpCourseWorkTotal: 0, //
}); //
let classWorkForm = reactive({
id: props.propsformobj.id,
uniquekey: props.propsformobj.uniquekey, //
worktype: props.propsformobj.worktype?props.propsformobj.worktype: '习题训练', //
title: props.propsformobj.title?props.propsformobj.title:'',//
quizlist: props.propsformobj.quizlist?props.propsformobj.quizlist:[] //
id: cloneDeep(props.propsformobj.id),
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):[] //
}); //
const chooseWorkLists = ref([]); //
const whiteboardObj = ref(''); // -
@ -854,7 +857,7 @@ const editWork = async (cform) =>{
// 1.
let needUplEval = false;
if (classWorkForm.quizlist.length !== props.propsformobj.quizlist.length) {
if (classWorkForm.quizlist.length != props.propsformobj.quizlist.length) {
needUplEval = true;
}else {
//
@ -864,72 +867,31 @@ const editWork = async (cform) =>{
)
);
}
//
if(needUplEval){
//
var ll = [];
for (var i=0; i< classWorkForm.quizlist.length; i++) {
//
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
}
// list
if (ll.length > 0) {
cform.entpcourseworklist = JSON.stringify(ll);
} else {
cform.entpcourseworklist = '';
}
console.log(cform,'提交的数据');
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
addClassworkReturnId(cform).then(workres => {
ElMessage({ type: 'success', message: '修改设计成功!'});
//
classWorkForm.worktype = "习题训练";
classWorkForm.uniquekey = props.propsformobj.uniquekey, //
classWorkForm.title = "";
classWorkForm.quizlist = [], //
//
chooseWorkLists.value = [];
whiteboardObj.value = ''; // ? //
// refresh the list
//
// this.getClassWorkAllList();
// TODO
//TODO 3
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
})
}
// 2.eval
// if (needUplEval) {
if (needUplEval) {
// : , ,
// 2.1.workidid
// let arrEvalids = [];
// const wevalres = await listClassworkeval({'workid': classWorkForm.id});
// wevalres.rows.forEach(element => {
// arrEvalids.push(element.id);
// });
// const ids = arrEvalids.join(',');
let arrEvalids = [];
const wevalres = await listClassworkeval({'workid': classWorkForm.id});
wevalres.rows.forEach(element => {
arrEvalids.push(element.id);
});
const ids = arrEvalids.join(',');
// // 2.2.
// const delRes = await delClassworkeval(ids);
// 2.2.
const delRes = await delClassworkeval(ids);
// // 2.3.
// for(let i=0; i< classWorkForm.quizlist.length; i++){
// const addRes = await addClassworkeval({
// 'workid': classWorkForm.id,
// 'entpcourseworkid': classWorkForm.quizlist[i].id,
// 'workdataid': 0,
// 'score': classWorkForm.quizlist[i].score}
// );
// }
// }
// 2.3.
for(let i=0; i< classWorkForm.quizlist.length; i++){
const addRes = await addClassworkeval({
'workid': classWorkForm.id,
'entpcourseworkid': classWorkForm.quizlist[i].id,
'workdataid': 0,
'score': classWorkForm.quizlist[i].score}
);
}
}
// 3.
// const evalid = this.homeworkLesson.length==0 ? '' : this.homeworkLesson.length==1 ? this.homeworkLesson[0] : this.homeworkLesson[1];
@ -940,6 +902,13 @@ const editWork = async (cform) =>{
// //evalid = evalid, // []
// }
// let res = await updateClasswork(cform);
let res = await updateClasswork(cform);
if (res.code == 200) {
ElMessage.success('更新成功');
//
router.back()
}
}
// else if (classWorkForm.worktype=='') {

View File

@ -309,7 +309,7 @@ watchEffect(() => { initData() })
//
.c-warp{
background: #F2F3F5;
height: 73vh;
height: 100%;
margin: 0 !important;
.left{padding-left: 0 !important;}
.right{padding-right: 0 !important;}
@ -318,7 +318,7 @@ watchEffect(() => { initData() })
background: #fff;
border: none;
overflow-y: auto;
height: 73vh;
height: 100%;
}
.collapse-item{
.item-title-o{

View File

@ -65,7 +65,7 @@
v-loading="loading_dt_table"
:data="tableRadio.list"
row-key="id"
style="height: 69vh;"
style="height: 100%;overflow: hidden;"
highlight-current-row
@row-click="getStudentClassWorkDataDetail"
>
@ -531,6 +531,9 @@ const workHandle = (type) => {
classWorkAnalysis.view = type
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
if(type == 'quizStats') {
getWorkFeedList();
}
if (isClose) clearInterval(classWorkActiveData.timerId) //
if (isOpen) {
//
@ -678,6 +681,9 @@ onUnmounted(() => {
flex: 0 0 auto;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
}
.view_teachrting {
flex: 1;