Merge pull request 'baigl' (#282) from baigl into main
Reviewed-on: #282
This commit is contained in:
commit
042f8e5907
|
@ -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>
|
||||
|
|
|
@ -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.先查询该workid下所有的id
|
||||
// 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=='框架梳理') {
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue